DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/bnxt: fix a segfault during Tx
@ 2020-07-13  5:17 Somnath Kotur
  2020-07-14 22:02 ` Ajit Khaparde
  0 siblings, 1 reply; 2+ messages in thread
From: Somnath Kotur @ 2020-07-13  5:17 UTC (permalink / raw)
  To: dev; +Cc: ferruh.yigit

From: Ajit Khaparde <ajit.khaparde@broadcom.com>

When TRUFLOW is not enabled ulp_ctx is not allocated.
In non-vector Tx datapath we are accessing this invalid pointer
resulting in a segfault. Check if TRUFLOW is enabled before
accessing ulp_ctx to avoid this.

Fixes: f86dc320a894 ("net/bnxt: fill cfa action in Tx descriptor")

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
---
 drivers/net/bnxt/bnxt_txr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
index f588426..c741c71 100644
--- a/drivers/net/bnxt/bnxt_txr.c
+++ b/drivers/net/bnxt/bnxt_txr.c
@@ -132,8 +132,9 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
 				PKT_TX_TUNNEL_GRE | PKT_TX_TUNNEL_VXLAN |
 				PKT_TX_TUNNEL_GENEVE | PKT_TX_IEEE1588_TMST |
 				PKT_TX_QINQ_PKT) ||
-	     txq->bp->ulp_ctx->cfg_data->tx_cfa_action ||
-	     txq->vfr_tx_cfa_action)
+	     (BNXT_TRUFLOW_EN(txq->bp) &&
+	      (txq->bp->ulp_ctx->cfg_data->tx_cfa_action ||
+	       txq->vfr_tx_cfa_action)))
 		long_bd = true;
 
 	nr_bds = long_bd + tx_pkt->nb_segs;
-- 
2.7.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] net/bnxt: fix a segfault during Tx
  2020-07-13  5:17 [dpdk-dev] [PATCH] net/bnxt: fix a segfault during Tx Somnath Kotur
@ 2020-07-14 22:02 ` Ajit Khaparde
  0 siblings, 0 replies; 2+ messages in thread
From: Ajit Khaparde @ 2020-07-14 22:02 UTC (permalink / raw)
  To: Somnath Kotur; +Cc: dpdk-dev, Ferruh Yigit

On Sun, Jul 12, 2020 at 10:23 PM Somnath Kotur <somnath.kotur@broadcom.com>
wrote:

> From: Ajit Khaparde <ajit.khaparde@broadcom.com>
>
> When TRUFLOW is not enabled ulp_ctx is not allocated.
> In non-vector Tx datapath we are accessing this invalid pointer
> resulting in a segfault. Check if TRUFLOW is enabled before
> accessing ulp_ctx to avoid this.
>
> Fixes: f86dc320a894 ("net/bnxt: fill cfa action in Tx descriptor")
>
> Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Reviewed-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
> Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> Signed-off-by: Venkat Duvvuru <venkatkumar.duvvuru@broadcom.com>
>
Patch applied to dpdk-next-net-brcm. Thanks


> ---
>  drivers/net/bnxt/bnxt_txr.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
> index f588426..c741c71 100644
> --- a/drivers/net/bnxt/bnxt_txr.c
> +++ b/drivers/net/bnxt/bnxt_txr.c
> @@ -132,8 +132,9 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf
> *tx_pkt,
>                                 PKT_TX_TUNNEL_GRE | PKT_TX_TUNNEL_VXLAN |
>                                 PKT_TX_TUNNEL_GENEVE |
> PKT_TX_IEEE1588_TMST |
>                                 PKT_TX_QINQ_PKT) ||
> -            txq->bp->ulp_ctx->cfg_data->tx_cfa_action ||
> -            txq->vfr_tx_cfa_action)
> +            (BNXT_TRUFLOW_EN(txq->bp) &&
> +             (txq->bp->ulp_ctx->cfg_data->tx_cfa_action ||
> +              txq->vfr_tx_cfa_action)))
>                 long_bd = true;
>
>         nr_bds = long_bd + tx_pkt->nb_segs;
> --
> 2.7.4
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-14 22:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-13  5:17 [dpdk-dev] [PATCH] net/bnxt: fix a segfault during Tx Somnath Kotur
2020-07-14 22:02 ` Ajit Khaparde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).