diff mbox series

net/bnxt: fix configuring LRO

Message ID 20210402032551.24484-1-kalesh-anakkur.purayil@broadcom.com (mailing list archive)
State Accepted
Delegated to: Ajit Khaparde
Headers show
Series net/bnxt: fix configuring LRO | expand

Checks

Context Check Description
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot success github build: passed
ci/travis-robot success travis build: passed
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Kalesh A P April 2, 2021, 3:25 a.m. UTC
From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

While configuring LRO, driver should check the return value
of bnxt_hwrm_vnic_tpa_cfg() HWRM command and return error
when the FW command fails.

Fixes: 0958d8b6435d ("net/bnxt: support LRO")
Cc: stable@dpdk.org

Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_ethdev.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Ajit Khaparde April 7, 2021, 3:04 a.m. UTC | #1
On Thu, Apr 1, 2021 at 8:03 PM Kalesh A P
<kalesh-anakkur.purayil@broadcom.com> wrote:
>
> From: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
>
> While configuring LRO, driver should check the return value
> of bnxt_hwrm_vnic_tpa_cfg() HWRM command and return error
> when the FW command fails.
>
> Fixes: 0958d8b6435d ("net/bnxt: support LRO")
> Cc: stable@dpdk.org
>
> Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
> Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>

Patch applied to dpdk-next-net-brcm.

>
> ---
>  drivers/net/bnxt/bnxt_ethdev.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
> index 0042d8a..463beaa 100644
> --- a/drivers/net/bnxt/bnxt_ethdev.c
> +++ b/drivers/net/bnxt/bnxt_ethdev.c
> @@ -479,10 +479,11 @@ static int bnxt_setup_one_vnic(struct bnxt *bp, uint16_t vnic_id)
>
>         bnxt_hwrm_vnic_plcmode_cfg(bp, vnic);
>
> -       if (rx_offloads & DEV_RX_OFFLOAD_TCP_LRO)
> -               bnxt_hwrm_vnic_tpa_cfg(bp, vnic, 1);
> -       else
> -               bnxt_hwrm_vnic_tpa_cfg(bp, vnic, 0);
> +       rc = bnxt_hwrm_vnic_tpa_cfg(bp, vnic,
> +                                   (rx_offloads & DEV_RX_OFFLOAD_TCP_LRO) ?
> +                                   true : false);
> +       if (rc)
> +               goto err_out;
>
>         return 0;
>  err_out:
> --
> 2.10.1
>
diff mbox series

Patch

diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 0042d8a..463beaa 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -479,10 +479,11 @@  static int bnxt_setup_one_vnic(struct bnxt *bp, uint16_t vnic_id)
 
 	bnxt_hwrm_vnic_plcmode_cfg(bp, vnic);
 
-	if (rx_offloads & DEV_RX_OFFLOAD_TCP_LRO)
-		bnxt_hwrm_vnic_tpa_cfg(bp, vnic, 1);
-	else
-		bnxt_hwrm_vnic_tpa_cfg(bp, vnic, 0);
+	rc = bnxt_hwrm_vnic_tpa_cfg(bp, vnic,
+				    (rx_offloads & DEV_RX_OFFLOAD_TCP_LRO) ?
+				    true : false);
+	if (rc)
+		goto err_out;
 
 	return 0;
 err_out: