[dpdk-dev,v2] net/mlx4: fix CRC stripping capability report

Message ID 1525782363-426-1-git-send-email-ophirmu@mellanox.com (mailing list archive)
State Accepted, archived
Delegated to: Shahaf Shuler
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Ophir Munk May 8, 2018, 12:26 p.m. UTC
  There are two capabilities related to CRC stripping:
1. mlx4 HW capability to perform CRC stripping on a received 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 second capability was falsely returned by
the mentioned API. This commit fixes it by returning the first
capability.

mlx4 HW performs CRC stripping by default and this capability is
always reported as "true".
The ability to enable/disable CRC stripping is supported since this
commit and requires OFED version 4.3-1.5.0.0 or rdma-core version v18.
CRC stripping will be done by default regardless of its configuration
when working with OFED or rdma-core versions earlier than those
previously specified or before this commit.

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

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
---
v1:
Initial version
v2:
Update commit log message based on reviews

 drivers/net/mlx4/mlx4_rxq.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
  

Comments

Shahaf Shuler May 9, 2018, 11:13 a.m. UTC | #1
Tuesday, May 8, 2018 3:26 PM, Ophir Munk:
> Subject: [PATCH v2] net/mlx4: fix CRC stripping capability report
> 
> There are two capabilities related to CRC stripping:
> 1. mlx4 HW capability to perform CRC stripping on a received 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 second capability was falsely returned by the
> mentioned API. This commit fixes it by returning the first capability.
> 
> mlx4 HW performs CRC stripping by default and this capability is always
> reported as "true".
> The ability to enable/disable CRC stripping is supported since this commit and
> requires OFED version 4.3-1.5.0.0 or rdma-core version v18.
> CRC stripping will be done by default regardless of its configuration when
> working with OFED or rdma-core versions earlier than those previously
> specified or before this commit.
> 
> Fixes: de1df14e6e6ec ("net/mlx4: support CRC strip toggling")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Ophir Munk <ophirmu@mellanox.com>

Applied to next-net-mlx, thanks.
  

Patch

diff --git a/drivers/net/mlx4/mlx4_rxq.c b/drivers/net/mlx4/mlx4_rxq.c
index 65f0994..0650b10 100644
--- a/drivers/net/mlx4/mlx4_rxq.c
+++ b/drivers/net/mlx4/mlx4_rxq.c
@@ -665,10 +665,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;