On Mon, Dec 9, 2019 at 2:47 PM Andrew Rybchenko <arybche...@solarflare.com> wrote: > > On 12/5/19 11:12 AM, Jerin Jacob wrote: > > On Mon, Dec 2, 2019 at 5:27 PM Andrew Rybchenko > > <arybche...@solarflare.com> wrote: > >>
>> >>> > >>> Ack. > >> > >> Yes, I agree as well, but in general we already have an > >> exception MBUF_FAST_FREE which is just a nice wrap for > >> enabled by default support for mbufs from different > >> mempools and support for mbuf reference counters. > >> I don't suggest to change it. Just want to highlight > >> that we already have exceptions (nicely wrapped). > >> That's why I would not touch packet type parsing > >> "offload". Packet type parsing is not just on/off and > >> adding on/off in addition to existing API looks overkill. > >> Yes, it is one more exception, but nicely wrapped as well. > > > > I am all for making offloads disabled by default. > > > >> > >>>>> And what would be DEFAULT behavior for the mbuf MARK updation feature? > >>>>> (That's where this thread started). > >>>> > >>>> As all other features, mark is disabled by default. > >>>> Using a rte_flow rule, it can be enabled. > >>>> No need to pre-enable it. > >>> > >>> Ok. > >> > >> But it returns us to the point where we started [1]: > >> > >> The problem: > >> ~~~~~~~~~~~~ > >> PMD wants to know before port start if application wants to > >> to use flow MARK/FLAG in the future. It is required because: > >> > >> 1. HW may be configured in a different way to reserve resources > >> for MARK/FLAG delivery. > >> > >> 2. Datapath implementation choice may depend on it (e.g. vPMD > >> is faster, but does not support MARK). > >> > >> opt-in/opt-out solution has drawbacks mentioned above. > >> Also I'm not sure if opt-in/opt-out is per-queue or per-port. > >> (Offloads may be naturally per-queue and it is a big advantage). > >> > >> IMHO feature which should be opt-out is almost equivalent to > >> offload enabled by default. It has the same negative properties > >> as enabled by default offloads. > >> > >> Am I missing something again? > >> > >> From my point of view I see no problem in necessity to say > >> in advance (before device start) that application would like > >> to use some features at run time. > > > > I agree with your problem definition and solution as offload. > > > > I think, our constraint is, we can not change functional ABI behavior > > for the next year. i.e The existing application should work for the > > next year without > > changing the code. > > > > I think, it all boiling down to adhere to that constraint or not for > > this specific case. > > May be the escape is to avoid consistency checks in generic > code (not sure that such checks are doable/required in this > case, but anyway) and make the behaviour change vendor/driver- > specific. I understand that it is far from ideal solution. > > May be offload should be combined with opt-out as a way to > disable. I.e. offload is positive (not negative), but enabled > by default (i.e. automatically added to offloads as we do > for RSS_HASH) with an experimental opt-out to disable it. > > As the result: > 1. There is no changes in behaviour from application point of > view. > 2. Application which care about performance and ready to use > experimental opt-out to optimize performance can do it. > (i.e. use opt-out to avoid the offload enabled by default). > 3. Later when window to normalize behaviour opens, opt-out > becomes NOP (i.e. it still could be preserved for some > time to simplify transition). > 4. The offload is enabled by default during transition > period only since it represents a feature which had > no offload flag before and was always enabled before. > 5. As an offload the feature may be controlled per-device > and per-queue natively. Looks good to me. It makes sense to have a generic opt API to have for year ABI, which works on - per queue/per port - Enable by default to keep backward compatible. - Have a generic signature to allow probe() all the enabled opt-in features and then disable if required by the application. - I think, rte_eth_dev_set_ptypes() needs to change to generic API as it comes under opt-in/out scheme. > > It still does not sort out "necessity to enable twice" > concern which for specified above "the problem", IMO, > contradicts to "disabled by default offloads" (I read > it as "the best performance" by default). > > > Once that is decided, we can wrap it in offload flags vs opt scheme > > (by default enabled scheme). > > Yes. May be I don't understand all the details of the opt > scheme right now, but I don't like what I can imagine as > described above. > > >> > >> Yes, all features which may be controlled at run-time are > >> headache for optimizations (VLAN offloads). > >> > >> [1] > >> http://inbox.dpdk.org/dev/f170105b-9c60-1b04-cb18-52e0951dd...@solarflare.com/ >