p4lang / tdi

Table-Driven Interface (TDI) for a P4-programmable backend device.
Apache License 2.0
40 stars 23 forks source link

Removed enable command #107

Closed satish153 closed 1 year ago

satish153 commented 1 year ago

Removed enable command as it is not applicable to all the targets.

qobilidop commented 1 year ago

I have some questions about this change. Does it mean we could simply skip the .enable() calls when using TDI? Or are there other things we should do instead of .enable()?

For example, currently https://github.com/p4lang/p4-dpdk-target README suggests doing:

bfshell> tdi_python

tdi.<P4 program>.enable()
pipe = tdi.<P4 program>.pipe.ingress
from netaddr import IPAddress
pipe.<P4 table>.<P4 action>(<action parameters>)
eg) pipe.ipv4_lpm.add_with_send(dst_addr=IPAddress('192.168.2.0'),dst_addr_p_length=24, port=1)

After this change, I guess we can just do:

bfshell> tdi_python

pipe = tdi.<P4 program>.pipe.ingress
from netaddr import IPAddress
pipe.<P4 table>.<P4 action>(<action parameters>)
eg) pipe.ipv4_lpm.add_with_send(dst_addr=IPAddress('192.168.2.0'),dst_addr_p_length=24, port=1)

Is this correct?

satish153 commented 1 year ago

This PR is to remove the 'enable' command from the common code. The choice to support this command is left to the targets. I see that dpdk target is pointing to tdi older than this commit. So you need to use the 'enable' command.

qobilidop commented 1 year ago

That clarified my understanding. Thanks @satish153!