summaryrefslogtreecommitdiff
path: root/drivers/net/octeontx
diff options
context:
space:
mode:
authorFerruh Yigit <ferruh.yigit@intel.com>2018-06-29 13:41:13 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2018-07-03 01:35:58 +0200
commit70815c9ecadd780af101810119d385009cb0eb2d (patch)
treecb3eaf16b2569665df505dcbc6c5b7a0d18d0da6 /drivers/net/octeontx
parent4ed05fcd441bc7720386950a95d0bd85a72a5cee (diff)
downloaddpdk-next-eventdev-70815c9ecadd780af101810119d385009cb0eb2d.zip
dpdk-next-eventdev-70815c9ecadd780af101810119d385009cb0eb2d.tar.gz
dpdk-next-eventdev-70815c9ecadd780af101810119d385009cb0eb2d.tar.xz
ethdev: add new offload flag to keep CRC
DEV_RX_OFFLOAD_KEEP_CRC offload flag is added. PMDs that support keeping CRC should advertise this offload capability. DEV_RX_OFFLOAD_CRC_STRIP flag will remain one more release default behavior in PMDs are to keep the CRC until this flag removed 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 keep the CRC A helper function rte_eth_dev_is_keep_crc() has been added to be able to change the no flag behavior with minimal changes in PMDs. The PMDs that doesn't report the DEV_RX_OFFLOAD_KEEP_CRC offload can remove rte_eth_dev_is_keep_crc() checks next release, related code commented to help the maintenance task. And DEV_RX_OFFLOAD_CRC_STRIP has been added to virtual drivers since they don't use CRC at all, when an application requires this offload virtual PMDs should not return error. Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com> Acked-by: Allain Legacy <allain.legacy@windriver.com> Acked-by: Andrew Rybchenko <arybchenko@solarflare.com> Acked-by: Thomas Monjalon <thomas@monjalon.net>
Diffstat (limited to 'drivers/net/octeontx')
-rw-r--r--drivers/net/octeontx/octeontx_ethdev.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index 1eb453b..6eb6836 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -283,7 +283,10 @@ octeontx_dev_configure(struct rte_eth_dev *dev)
return -EINVAL;
}
- if (!(rxmode->offloads & DEV_RX_OFFLOAD_CRC_STRIP)) {
+ /* KEEP_CRC offload flag is not supported by PMD
+ * can remove the below block when DEV_RX_OFFLOAD_CRC_STRIP removed
+ */
+ if (rte_eth_dev_must_keep_crc(rxmode->offloads)) {
PMD_INIT_LOG(NOTICE, "can't disable hw crc strip");
rxmode->offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
}