[dpdk-dev] [PATCH v1] net/mlx4: fix CRC stripping capability report

Ophir Munk ophirmu at mellanox.com
Mon Apr 30 14:25:01 CEST 2018


There are two capabilities related to CRC stripping:
1. mlx4 HW capability to perform CRC stripping on a recieved packet.
This capability is built in mlx4 HW. It should be returned by the API
call mlx4_get_rx_queue_offloads().
2. mlx4 driver capability to enable/disable HW CRC stripping. This
capability is dependent on the driver version.
Before this commit the seccond capability was falsely returned by
the mentioned API. This commit fixes it by returning the first
capability.

Fixes: de1df14e6e6ec ("net/mlx4: support CRC strip toggling")
Cc: stable at dpdk.org

Signed-off-by: Ophir Munk <ophirmu at mellanox.com>
---
 drivers/net/mlx4/mlx4_rxq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index b430678..88e5912 100644
--- a/drivers/net/mlx4/mlx4_rxq.c
+++ b/drivers/net/mlx4/mlx4_rxq.c
@@ -658,10 +658,9 @@ mlx4_rxq_detach(struct rxq *rxq)
 uint64_t
 mlx4_get_rx_queue_offloads(struct priv *priv)
 {
-	uint64_t offloads = DEV_RX_OFFLOAD_SCATTER;
+	uint64_t offloads = DEV_RX_OFFLOAD_SCATTER |
+			    DEV_RX_OFFLOAD_CRC_STRIP;
 
-	if (priv->hw_fcs_strip)
-		offloads |= DEV_RX_OFFLOAD_CRC_STRIP;
 	if (priv->hw_csum)
 		offloads |= DEV_RX_OFFLOAD_CHECKSUM;
 	return offloads;
-- 
2.7.4



More information about the dev mailing list