p4lang / pna

Portable NIC Architecture
Apache License 2.0
55 stars 21 forks source link

Any desire to define behavior of add_on_miss=true table WITHOUT data plane deletions of expired entries? #71

Open jfingerh opened 1 year ago

jfingerh commented 1 year ago

Currently if we have a table T1 that uses this combination of features:

Then T1 seems to be a very useful kind of table. The data plane can add entries without the control plane having to do so, presumably at very high rate in the data plane, and the control plane need not be bothered to add such table entries.

Similarly, the data plane will auto-delete entries that have expired, without the control plane having to bother to do so. Presumably high quality PNA implementations would support as high a rate for auto-deleting expired entries as it supports for adding new entries in the data plane, at least long term if not over arbitrary duration time intervals.

The question raised by this issue is whether we wish to expect PNA implementations to support the following slightly different combination of features for a table (which I will call T2 for an example name):

T2 is similar to T1 in that the data plane can add entries, without the control plane being required to do so.

T2 is different than T1 in that the data plane WILL NOT auto-delete expired entries. Instead it will notify the control plane of expired entries, each notification containing some identifying information about the key of the expired entry. It is up to the control plane to decide what to do about such notifications. For example, the control plane writer could choose to delete every entry for which it receives such an idle timeout notification as soon as possible. Another control plane writer could choose to perform some additional sanity checks on the entry, and delete some such entries quickly, but leave other entries in table T2 for an arbitrarily long period of time.

The main reason I ask is that for such a table, the control plane now has a potential burden to try to either:

Is this combination worth supporting? The behavior seems clear to define, but the usefulness seems questionable.

jfingerh commented 1 year ago

More generally, it seems we should document one of the alternatives below about tables with data plane add-on-miss, and also data plane delete-on-expire:

jfingerh commented 1 year ago

Note that the current pna.p4 definition of the add_entry() extern function currently requires an ExpireTimeProfileId_t parameter, which really only makes sense if the table also has pna_idle_timeout not equal to NO_TIMEOUT.

If anyone wants to support add-on-miss tables with pna_idle_timeout = NO_TIMEOUT, that parameter is unnecessary, and there should probably be another extern function that adds an entry without that parameter.

As mentioned above, though, this seems unlikely to be desired, at least for the most common use cases of add-on-miss tables.