From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A22D4A034F for ; Mon, 6 Dec 2021 09:28:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9C41240040; Mon, 6 Dec 2021 09:28:06 +0100 (CET) Received: from smtp-relay-internal-0.canonical.com (smtp-relay-internal-0.canonical.com [185.125.188.122]) by mails.dpdk.org (Postfix) with ESMTP id 5B67540040 for ; Mon, 6 Dec 2021 09:28:05 +0100 (CET) Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 3B2D33F1BF for ; Mon, 6 Dec 2021 08:28:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1638779285; bh=3g+3ZmzFT76rhgjSRmUcjUNTvkJ3mroibROL1KjVwsQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=jUzPydceuO4v8fZFXbW+ggcAnmHv56a2RXMTB79B5Ro2U1119aLXJrjP2B+NMBA9p k43K8Alsy1VLu1zo5Vw6qyEE6cZwkxoRoX3Hhzb2w2/PordOLw77aM5LHZt4Jb3Knl X0pDCEwNSu4IJwXb3bq5XU0YQdpFuXRvIaFfzNT3bTf4DSPuQlITXyIfa8a9Csw8CJ /DSpTkNm3ELwNnuyBIyhhb0cwkkeLFPLyyvCCJyOB8r2cMQ3VQD0Zlb2fqL88FMuu+ wzdtsUI5DxWXu61TkU87R1BPjIoGc6LxGgizER1kXxVPSShp7/TVMSlglHe5wckHQB y/LUKxnWIGdwQ== Received: by mail-qv1-f72.google.com with SMTP id j9-20020a05621419c900b003b815c01a54so10966247qvc.10 for ; Mon, 06 Dec 2021 00:28:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3g+3ZmzFT76rhgjSRmUcjUNTvkJ3mroibROL1KjVwsQ=; b=RK1UHCTlo4w8OVrK5GZPWK8uLASVuT9FUj9T4xn6IAk9SPXEA/FPKpknUucITUX7Vy 22e7JRdqnNcDg/r/RrnqLa970U2yw3PBkk9TW9sbRKTCJ4gcBGGR8mrJYDkONKziEc6A uyLEenlRMrHctp5Gkj2xqfcjo1NJp+0fe9+13lIpzNT3VKXNhRqL1YQzVnBhhbUsMi2Q nh2EoMYiJ5gAFAouKgoFxkGy9E+jdA1uoABC//xhUxOwVJ+qHWYSOY4gziNa67xKfFV1 km7gSqfp3Wny7fFRI+6e/BscA3221srtu2zf7+MmTvwbxmCkUz0Dp4MPhArCHBo8axhT jTLg== X-Gm-Message-State: AOAM530nh6E7s2U1x04ufbHmLd2/ObDp6eiOHKRiJIqXa+2JAg+9gPvk 6TQX8CKJC0hkf3JlEDKysGg5x4RoMuJ7HEf2YdDpps1yVXBzg4PvP9t0wOGpPyQGmkzWM0HLb1d ehci/oLbBE8Hxeh1nxNEj0oDEJgewmgUZUR1iIc9G X-Received: by 2002:a05:620a:25cf:: with SMTP id y15mr31704613qko.21.1638779283636; Mon, 06 Dec 2021 00:28:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNST72vKPleDy4ieoMLvR5hUxmfmDRPbdbflMESDkRRLrPYtDApTxYz6ApD3jgTak5tsvQm4Fbs9ioXidQoO0= X-Received: by 2002:a05:620a:25cf:: with SMTP id y15mr31704605qko.21.1638779283434; Mon, 06 Dec 2021 00:28:03 -0800 (PST) MIME-Version: 1.0 References: <20211205040206.8050-1-kalesh-anakkur.purayil@broadcom.com> <20211205040206.8050-2-kalesh-anakkur.purayil@broadcom.com> In-Reply-To: <20211205040206.8050-2-kalesh-anakkur.purayil@broadcom.com> From: Christian Ehrhardt Date: Mon, 6 Dec 2021 09:27:37 +0100 Message-ID: Subject: Re: [PATCH 19.11 2/2] net/bnxt: fix VLAN indication in Rx mbuf To: Kalesh A P Cc: stable@dpdk.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Sun, Dec 5, 2021 at 4:42 AM Kalesh A P wrote: > > From: Kalesh AP > > [ upstream commit 620e0290d14cc9a1126ef1af4eaa71ef9eadca72 ] Applied, thanks! > Fix to ignore the RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN > when the firmware doesn't support the VLAN strip offload. > > Fixes: 2eb53b134aae ("net/bnxt: add initial Rx code") > > Signed-off-by: Kalesh AP > Reviewed-by: Somnath Kotur > Reviewed-by: Lance Richardson > Reviewed-by: Ajit Khaparde > --- > drivers/net/bnxt/bnxt.h | 1 + > drivers/net/bnxt/bnxt_rxr.c | 8 +++++--- > drivers/net/bnxt/bnxt_rxtx_vec_sse.c | 5 +++-- > 3 files changed, 9 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h > index 63d7475..73001b1 100644 > --- a/drivers/net/bnxt/bnxt.h > +++ b/drivers/net/bnxt/bnxt.h > @@ -599,6 +599,7 @@ struct bnxt { > uint32_t vnic_cap_flags; > #define BNXT_VNIC_CAP_COS_CLASSIFY BIT(0) > #define BNXT_VNIC_CAP_VLAN_RX_STRIP BIT(1) > +#define BNXT_RX_VLAN_STRIP_EN(bp) ((bp)->vnic_cap_flags & BNXT_VNIC_CAP_VLAN_RX_STRIP) > unsigned int rx_nr_rings; > unsigned int rx_cp_nr_rings; > unsigned int rx_num_qs_per_vnic; > diff --git a/drivers/net/bnxt/bnxt_rxr.c b/drivers/net/bnxt/bnxt_rxr.c > index 56213f0..3355e00 100644 > --- a/drivers/net/bnxt/bnxt_rxr.c > +++ b/drivers/net/bnxt/bnxt_rxr.c > @@ -209,8 +209,9 @@ static void bnxt_tpa_start(struct bnxt_rx_queue *rxq, > mbuf->hash.fdir.id = rte_le_to_cpu_16(tpa_start1->cfa_code); > mbuf->ol_flags |= PKT_RX_FDIR | PKT_RX_FDIR_ID; > } > - if (tpa_start1->flags2 & > - rte_cpu_to_le_32(RX_TPA_START_CMPL_FLAGS2_META_FORMAT_VLAN)) { > + if (BNXT_RX_VLAN_STRIP_EN(rxq->bp) && > + (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 | PKT_RX_VLAN_STRIPPED; > } > @@ -601,7 +602,8 @@ static int bnxt_rx_pkt(struct rte_mbuf **rx_pkt, > if (agg_buf) > bnxt_rx_pages(rxq, mbuf, &tmp_raw_cons, agg_buf, NULL); > > - if (rxcmp1->flags2 & RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN) { > + if (BNXT_RX_VLAN_STRIP_EN(rxq->bp) && > + (rxcmp1->flags2 & RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN)) { > mbuf->vlan_tci = rxcmp1->metadata & > (RX_PKT_CMPL_METADATA_VID_MASK | > RX_PKT_CMPL_METADATA_DE | > diff --git a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c > index 9c3ae39..3d2081b 100644 > --- a/drivers/net/bnxt/bnxt_rxtx_vec_sse.c > +++ b/drivers/net/bnxt/bnxt_rxtx_vec_sse.c > @@ -287,8 +287,9 @@ recv_burst_vec_sse(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts) > if (rxcmp->flags_type & RX_PKT_CMPL_FLAGS_RSS_VALID) > mbuf->ol_flags |= PKT_RX_RSS_HASH; > > - if (rxcmp1->flags2 & > - RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN) { > + if (BNXT_RX_VLAN_STRIP_EN(rxq->bp) && > + (rxcmp1->flags2 & > + RX_PKT_CMPL_FLAGS2_META_FORMAT_VLAN)) { > mbuf->vlan_tci = rxcmp1->metadata & > (RX_PKT_CMPL_METADATA_VID_MASK | > RX_PKT_CMPL_METADATA_DE | > -- > 2.10.1 > -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd