Thursday, March 29, 2018 10:43 AM, Thomas Monjalon: > 29/03/2018 07:38, Shahaf Shuler: > > Wednesday, March 21, 2018 9:48 PM, Ferruh Yigit: > > > DEV_RX_OFFLOAD_KEEP_CRC offload flag added. > > > > > > DEV_RX_OFFLOAD_CRC_STRIP flag will remain one more release but > > > default behavior in PMDs is to strip the CRC independent from this flag. > > > > > > Until DEV_RX_OFFLOAD_CRC_STRIP flag is removed: > > > - Setting both KEEP_CRC & CRC_STRIP is INVALID > > > - Setting only CRC_STRIP PMD should strip the CRC > > > - Setting only KEEP_CRC PMD should keep the CRC > > > - Not setting both PMD should strip the CRC > > > > We cannot have such default behavior, it may break existing applications. > > > > The API of ethdev offloads says (even though it is not well documented) : > DEV_RX_OFFLOAD_CRC_STRIP (emphasis the STRIP). > > meaning, if set -> STRIP, if not set -> don't strip. I am aware to at > > least one > application which wants to have the CRC, and for that purpose it naturally > don't set the offload flag. > > > > The fact some PMDs lack the ability to toggle the CRC stripping should be > exposed in the "limitations" section of their related guide. > > > > Up to here, this is the behavior as defined by the API. > > > > Now, we want to change it, and I think it makes sense. However I think we > should take similar approach to what we did with the ethdev offloads API: > > 1. at first stage a new offload flag is exposed DEV_RX_OFFLOAD_KEEP_CRC > and implemented on the PMDs. > > This is what is proposed above, except that we change the default > behaviour. > If we introduce a new flag which is the contrary of the old one, we need to > choose which one is the default, so which one has no effect.
The default behavior should remain as long as we don't deprecate the DEV_RX_OFFLOAD_CRC_STRIP flag. Logic should be : Until DEV_RX_OFFLOAD_CRC_STRIP flag is removed: - Setting both KEEP_CRC & CRC_STRIP is INVALID - enforced by ethdev. - Setting only CRC_STRIP PMD should strip the CRC - Setting only KEEP_CRC PMD should keep the CRC - Not setting both PMD should *not* strip the CRC > > > 2. there is a conversion function on ethdev. Which for example converts > ~DEV_RX_OFFLOAD_CRC_STRIP -> DEV_RX_OFFLOAD_KEEP_CRC for the > PMDs. > > 3. deprecation of DEV_RX_OFFLOAD_CRC_STRIP for applications and > remove of the conversion functions. > > >