From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id CBBC3A05D3 for ; Mon, 25 Mar 2019 22:28:03 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DAD993772; Mon, 25 Mar 2019 22:28:02 +0100 (CET) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id BE4D83256 for ; Mon, 25 Mar 2019 22:28:01 +0100 (CET) Received: by mail-pl1-f193.google.com with SMTP id m10so554526plt.10 for ; Mon, 25 Mar 2019 14:28:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=xKpbhco58xMMAdTv/eQ9oGEZdgeyb6NRgNAABqoWGCs=; b=ozp3Us3Wb1FEfjHGA7M4JX71wpSsvtP7u5whmZxFDS2nu5TL+HPZ6iExndm/jlgVpe THwmuI/wn3RRhZtdJz5g4AQEZrykXihw3QpLQZ5lao/C73B3EV13dm7TTB9+naumEXH4 OWvd2SnbMgEri4WKKgObHGCylToi5mpQ1ZAhzDjNFT5gb+MFU7kv69UUfZTP+GEJPeeO 4roEH4EdcnLB1wNSP112RwkOyNCLjNImuovU6HcrTENS8tO9LphkSdK+DT5Cw9+pPWbv dk2niZC6wB33KipyVVuKb+S5C2jM9BJCcuyKkUDxkfuXlZvohakfI+LDFiYW5KytZV2n mS3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=xKpbhco58xMMAdTv/eQ9oGEZdgeyb6NRgNAABqoWGCs=; b=SgJP9l23WvH4F15GQkmKqRnt3xSiq5wOy+dmH7nALpymd5WCtDRf0I+Tmsg6iRGwCC d4lUytGNMOBTlX4iIJH1fscs1QhEn+YoQpT5nehKIqaXJvHCC//+M9u2+lwSve43Dhty g0ZdNBFzYrwijtAeBYfEsqrVKOttSF3ibnyG83B0MVt7NkXPUD7AcQWLFuqBx2rcZ+kP fHYzqiG0cfsWiTNUbMMZeekPbguoAW1wupdWw9N+SU70tZrMffxGPsiyga4Cg1GS2z1B y47co4Ivtf+Iz43IQkC+mdzyqjCnJIHeFEZEiSFfEVxG1BL/bSqsPVfsBfRYLmb3J1jo QoMw== X-Gm-Message-State: APjAAAWeXVZDlRBkV8m/gT0J0Uy+BY4/ft23yeKEbTNbmjy8/M+tBPw3 wpkr3J5UWwFm599VzVzbxfP+pQ== X-Google-Smtp-Source: APXvYqyubpc3BgRdkYZh1fC2aI9hzBM3UUaoYUx1QrCuYhZN7cHGVHcNzXgfvsVDtAgNNZVTbu1MhA== X-Received: by 2002:a17:902:a60c:: with SMTP id u12mr26289200plq.301.1553549280750; Mon, 25 Mar 2019 14:28:00 -0700 (PDT) Received: from shemminger-XPS-13-9360.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id n82sm29856881pfi.63.2019.03.25.14.27.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Mar 2019 14:27:59 -0700 (PDT) From: Stephen Hemminger To: ajit.khaparde@broadcom.com, somnath.kotur@broadcom.com Cc: dev@dpdk.org, Stephen Hemminger Date: Mon, 25 Mar 2019 14:27:54 -0700 Message-Id: <20190325212754.13786-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] bnxt: fix receive VLAN offload flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Content-Type: text/plain; charset="UTF-8" Message-ID: <20190325212754.YLT9F45tcnIg-_WWP3lWd6KuKDZawD-8zG0ZIbh7msw@z> From: Stephen Hemminger 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 --- 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