DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: Somnath Kotur <somnath.kotur@broadcom.com>,
	dev@dpdk.org,  Stephen Hemminger <sthemmin@microsoft.com>
Subject: Re: [dpdk-dev] [PATCH] bnxt: fix receive VLAN offload flags
Date: Mon, 25 Mar 2019 14:34:26 -0700	[thread overview]
Message-ID: <CACZ4nhvyHcebyCUxX4xoOUJj=AuRZZ7XeQsAejoPFQ3Cy7Kpew@mail.gmail.com> (raw)
In-Reply-To: <20190325212754.13786-1-stephen@networkplumber.org>

On Mon, Mar 25, 2019 at 2:28 PM Stephen Hemminger <
stephen@networkplumber.org> wrote:

> From: Stephen Hemminger <sthemmin@microsoft.com>
>
> The bnxt driver is not correctly setting the receive VLAN offload
> flags. When VLAN is offloaded the driver must set the PKT_RX_VLAN_STRIPPED
> flag.
>
> Actually, several drivers have the same bug, only most of the
> Intel drivers look right. Any driver that sets vlan_tci is probably
> stripping the tag, and should be setting RX_VLAN_STRIPPED.
>
> To quote rte_mbuf.h:
>
> /**
>  * The RX packet is a 802.1q VLAN packet, and the tci has been
>  * saved in in mbuf->vlan_tci.
>  * If the flag PKT_RX_VLAN_STRIPPED is also present, the VLAN
>  * header has been stripped from mbuf data, else it is still
>  * present.
>  */
>
> Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code")
> Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>


> ---
>  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 1bfc63d9304c..dc695e17771b 100644
> --- a/drivers/net/bnxt/bnxt_rxr.c
> +++ b/drivers/net/bnxt/bnxt_rxr.c
> @@ -154,7 +154,7 @@ static void bnxt_tpa_start(struct bnxt_rx_queue *rxq,
>         if (tpa_start1->flags2 &
>             rte_cpu_to_le_32(RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN)) {
>                 mbuf->vlan_tci = rte_le_to_cpu_32(tpa_start1->metadata);
> -               mbuf->ol_flags |= PKT_RX_VLAN;
> +               mbuf->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
>         }
>         if (likely(tpa_start1->flags2 &
>                    rte_cpu_to_le_32(RX_TPA_START_CMPL_FLAGS2_L4_CS_CALC)))
> @@ -437,7 +437,7 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt,
>                         (RX_PKT_CMPL_METADATA_VID_MASK |
>                         RX_PKT_CMPL_METADATA_DE |
>                         RX_PKT_CMPL_METADATA_PRI_MASK);
> -               mbuf->ol_flags |= PKT_RX_VLAN;
> +               mbuf->ol_flags |= PKT_RX_VLAN | PKT_RX_VLAN_STRIPPED;
>         }
>
>         if (likely(RX_CMP_IP_CS_OK(rxcmp1)))
> --
> 2.17.1
>
>

  parent reply	other threads:[~2019-03-25 21:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-25 21:27 Stephen Hemminger
2019-03-25 21:27 ` Stephen Hemminger
2019-03-25 21:34 ` Ajit Khaparde [this message]
2019-03-25 21:34   ` Ajit Khaparde
2019-03-26 17:37   ` Ferruh Yigit
2019-03-26 17:37     ` Ferruh Yigit

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='CACZ4nhvyHcebyCUxX4xoOUJj=AuRZZ7XeQsAejoPFQ3Cy7Kpew@mail.gmail.com' \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=somnath.kotur@broadcom.com \
    --cc=stephen@networkplumber.org \
    --cc=sthemmin@microsoft.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).