DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: Ferruh Yigit <ferruh.yigit@xilinx.com>
Cc: Kalesh A P <kalesh-anakkur.purayil@broadcom.com>,
	dpdk-dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH 1/8] net/bnxt: remove assert for zero data len in Tx path
Date: Sun, 19 Jun 2022 16:09:15 -0700	[thread overview]
Message-ID: <CACZ4nhvsccoLjw6LgTBeceGwwmp6nED4zqur289stMRVSbjngA@mail.gmail.com> (raw)
In-Reply-To: <9bb5c847-cde8-ff20-8468-3c69e7b2af3b@xilinx.com>

[-- Attachment #1: Type: text/plain, Size: 2927 bytes --]

On Thu, Jun 16, 2022 at 10:03 AM Ferruh Yigit <ferruh.yigit@xilinx.com> wrote:
>
> On 6/15/2022 3:56 PM, Kalesh A P wrote:
> > CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email.
> >
> >
> > From: Somnath Kotur <somnath.kotur@broadcom.com>
> >
> > Currently the PMD tries to detect a potential 0 byte DMA by
> > using RTE_VERIFY.
> > But since RTE_VERIFY internally calls rte_panic() it is fatal to
> > the application and some applications want to avoid that.
> > So return an error from the bnxt xmit handler if such a bad pkt is
> > encountered by logging an error message, dumping the pkt header and
> > dump the current stack as well
> >
> > Signed-off-by: Somnath Kotur <somnath.kotur@broadcom.com>
> > Reviewed-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> > ---
> >   drivers/net/bnxt/bnxt_txr.c | 29 ++++++++++++++++++++++++++---
> >   1 file changed, 26 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/net/bnxt/bnxt_txr.c b/drivers/net/bnxt/bnxt_txr.c
> > index 7a7196a..67e0167 100644
> > --- a/drivers/net/bnxt/bnxt_txr.c
> > +++ b/drivers/net/bnxt/bnxt_txr.c
> > @@ -123,6 +123,26 @@ bnxt_xmit_need_long_bd(struct rte_mbuf *tx_pkt, struct bnxt_tx_queue *txq)
> >          return false;
> >   }
> >
> > +static bool
> > +bnxt_zero_data_len_tso_segsz(struct rte_mbuf *tx_pkt, uint8_t data_len_chk)
> > +{
> > +       const char *type_str = "Data len";
> > +       uint16_t len_to_check = tx_pkt->data_len;
> > +
> > +       if (data_len_chk == 0) {
> > +               type_str = "TSO Seg size";
> > +               len_to_check = tx_pkt->tso_segsz;
> > +       }
> > +
> > +       if (len_to_check == 0) {
> > +               PMD_DRV_LOG(ERR, "Error! Tx pkt %s == 0\n", type_str);
> > +               rte_pktmbuf_dump(stdout, tx_pkt, 64);
> > +               rte_dump_stack();
> > +               return true;
> > +       }
> > +       return false;
> > +}
> > +
> >   static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
> >                                  struct bnxt_tx_queue *txq,
> >                                  uint16_t *coal_pkts,
> > @@ -179,7 +199,8 @@ static uint16_t bnxt_start_xmit(struct rte_mbuf *tx_pkt,
> >          }
> >
> >          /* Check non zero data_len */
> > -       RTE_VERIFY(tx_pkt->data_len);
> > +       if (unlikely(bnxt_zero_data_len_tso_segsz(tx_pkt, 1)))
> > +               return -EIO;
> >
>
> Some PMDs does the similar verification in the 'rte_eth_tx_prepare()'
> API (tx_pkt_prepare() dev_ops), this helps to separate the checks and Tx
> data path code, do you want to do the same?


When we originally added these checks, we were not sure how prevalent
is the usage of tx_pkt_prepare() dev_op by various applications.

We will stick with this patch for now  and implement that
rte_eth_tx_prepare() in the next release?

Thanks

>

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4218 bytes --]

  reply	other threads:[~2022-06-19 23:09 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-15 14:56 [dpdk-dev] [PATCH 0/8] bnxt PMD fixes Kalesh A P
2022-06-15 14:56 ` [dpdk-dev] [PATCH 1/8] net/bnxt: remove assert for zero data len in Tx path Kalesh A P
2022-06-16 17:03   ` Ferruh Yigit
2022-06-19 23:09     ` Ajit Khaparde [this message]
2022-06-20 10:55       ` Ferruh Yigit
2022-06-20 17:03         ` Ajit Khaparde
2022-06-15 14:56 ` [dpdk-dev] [PATCH 2/8] net/bnxt: fix switch domain allocation Kalesh A P
2022-06-15 14:56 ` [dpdk-dev] [PATCH 3/8] net/bnxt: reduce the verbosity of a log Kalesh A P
2022-06-15 14:56 ` [dpdk-dev] [PATCH 4/8] net/bnxt: allow Tx only or Rx only configs in PMD Kalesh A P
2022-06-16 17:03   ` Ferruh Yigit
2022-06-21  4:46     ` Kalesh Anakkur Purayil
2022-06-21  4:54       ` Damodharam Ammepalli
2022-06-21  7:57         ` Ferruh Yigit
2022-06-15 14:57 ` [dpdk-dev] [PATCH 5/8] net/bnxt: fix setting forced speed Kalesh A P
2022-06-15 14:57 ` [dpdk-dev] [PATCH 6/8] net/bnxt: disallow MTU change when device is started Kalesh A P
2022-06-15 14:57 ` [dpdk-dev] [PATCH 7/8] net/bnxt: cleanups in MTU set callback Kalesh A P
2022-06-15 14:57 ` [dpdk-dev] [PATCH 8/8] net/bnxt: fix the check for autoneg enablement in the PHY FW Kalesh A P
2022-06-16 17:04   ` Ferruh Yigit
2022-06-19 23:11     ` Ajit Khaparde
2022-06-26 20:45 ` [dpdk-dev] [PATCH 0/8] bnxt PMD fixes Ajit Khaparde
2022-06-27  2:08   ` Thomas Monjalon
2022-06-27  3:28     ` Ajit Khaparde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CACZ4nhvsccoLjw6LgTBeceGwwmp6nED4zqur289stMRVSbjngA@mail.gmail.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@xilinx.com \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).