[dpdk-dev] net/bnxt: fix Rx checksum flags

Message ID 20180206133931.23991-1-olivier.matz@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

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

Commit Message

Olivier Matz Feb. 6, 2018, 1:39 p.m. UTC
  Fix the Rx offload flags when the IP or L4 checksum is seen as incorrect
by the hardware. In this case, the proper value is PKT_RX_IP_CKSUM_BAD.

PKT_RX_IP_CKSUM_NONE means that the checksum may be incorrect in the
packet headers, but the integrity of the IP header is verified. This is
mostly useful for virtual drivers.

Fixes: 7ec39d8c524b ("net/bnxt: update status of Rx IP/L4 CKSUM")
Cc: stable@dpdk.org

Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---

Hi Ajit,

PKT_RX_IP_CKSUM_UNKNOWN is also a good candidate instead of
PKT_RX_IP_CKSUM_BAD. Please can you check?

Thanks
Olivier



 drivers/net/bnxt/bnxt_rxr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

Ajit Khaparde Feb. 6, 2018, 11:27 p.m. UTC | #1
On Tue, Feb 6, 2018 at 5:39 AM, Olivier Matz <olivier.matz@6wind.com> wrote:

> Fix the Rx offload flags when the IP or L4 checksum is seen as incorrect
> by the hardware. In this case, the proper value is PKT_RX_IP_CKSUM_BAD.
>
> PKT_RX_IP_CKSUM_NONE means that the checksum may be incorrect in the
> packet headers, but the integrity of the IP header is verified. This is
> mostly useful for virtual drivers.
>
> Fixes: 7ec39d8c524b ("net/bnxt: update status of Rx IP/L4 CKSUM")
> Cc: stable@dpdk.org
>
> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
>
​Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
​


> ---
>
> Hi Ajit,
>
> PKT_RX_IP_CKSUM_UNKNOWN is also a good candidate instead of
> PKT_RX_IP_CKSUM_BAD. Please can you check?
>
​Thanks Oliver. Sure. I will take a look.​

Ajit



>
> Thanks
> Olivier
>
>
>
>  drivers/net/bnxt/bnxt_rxr.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
> index 9e70c8604..9b88a64bf 100644
> --- a/drivers/net/bnxt/bnxt_rxr.c
> +++ b/drivers/net/bnxt/bnxt_rxr.c
> @@ -475,12 +475,12 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
>         if (likely(RX_CMP_IP_CS_OK(rxcmp1)))
>                 mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
>         else
> -               mbuf->ol_flags |= PKT_RX_IP_CKSUM_NONE;
> +               mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD;
>
>         if (likely(RX_CMP_L4_CS_OK(rxcmp1)))
>                 mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
>         else
> -               mbuf->ol_flags |= PKT_RX_L4_CKSUM_NONE;
> +               mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
>
>         mbuf->packet_type = bnxt_parse_pkt_type(rxcmp, rxcmp1);
>
> --
> 2.11.0
>
>
  
Ferruh Yigit Feb. 8, 2018, 1:03 p.m. UTC | #2
On 2/6/2018 11:27 PM, Ajit Khaparde wrote:
> On Tue, Feb 6, 2018 at 5:39 AM, Olivier Matz <olivier.matz@6wind.com> wrote:
> 
>> Fix the Rx offload flags when the IP or L4 checksum is seen as incorrect
>> by the hardware. In this case, the proper value is PKT_RX_IP_CKSUM_BAD.
>>
>> PKT_RX_IP_CKSUM_NONE means that the checksum may be incorrect in the
>> packet headers, but the integrity of the IP header is verified. This is
>> mostly useful for virtual drivers.
>>
>> Fixes: 7ec39d8c524b ("net/bnxt: update status of Rx IP/L4 CKSUM")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
>>
> ​Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>

Applied to dpdk-next-net/master, thanks.
  

Patch

diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c
index 9e70c8604..9b88a64bf 100644
--- a/drivers/net/bnxt/bnxt_rxr.c
+++ b/drivers/net/bnxt/bnxt_rxr.c
@@ -475,12 +475,12 @@  static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
 	if (likely(RX_CMP_IP_CS_OK(rxcmp1)))
 		mbuf->ol_flags |= PKT_RX_IP_CKSUM_GOOD;
 	else
-		mbuf->ol_flags |= PKT_RX_IP_CKSUM_NONE;
+		mbuf->ol_flags |= PKT_RX_IP_CKSUM_BAD;
 
 	if (likely(RX_CMP_L4_CS_OK(rxcmp1)))
 		mbuf->ol_flags |= PKT_RX_L4_CKSUM_GOOD;
 	else
-		mbuf->ol_flags |= PKT_RX_L4_CKSUM_NONE;
+		mbuf->ol_flags |= PKT_RX_L4_CKSUM_BAD;
 
 	mbuf->packet_type = bnxt_parse_pkt_type(rxcmp, rxcmp1);