From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1EBAAA057B; Tue, 14 Apr 2020 15:46:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EAA611C29D; Tue, 14 Apr 2020 15:46:55 +0200 (CEST) Received: from mail-io1-f67.google.com (mail-io1-f67.google.com [209.85.166.67]) by dpdk.org (Postfix) with ESMTP id 035BF1C297 for ; Tue, 14 Apr 2020 15:46:53 +0200 (CEST) Received: by mail-io1-f67.google.com with SMTP id h6so13200565iok.11 for ; Tue, 14 Apr 2020 06:46:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=1YlGHfK5QD2fPrgI2kODmm5LK5HBTfJC3MlJNTXGgHU=; b=SoO1DF/nVYWFL/sNjblyqfWkSW2bC1Rpz5vACer4xKHmfMSohrgxKzMZHUzOL3pTYW AVrDUmGcpwz6DTIFyd5aRvsTOqxdur8M9ba7zB0hlO/qrbRAlTKmoTN40n0navr46WYq evqLl7lK/Bq3SDGuM+aZSv2Rxh3WPjIp6djecfCfaDM++klKXmvvqwPjSMDF4PCIvoU3 dZmIZJHyeCbpW582cJsGhVo58rwBswgYSl0mVZ/slF/ThpkhK9e4kW/GkXKDLXC67YRw hXDmAecbzPpgxKzzq7Lk/6HbT+wBpqJ5BRo+2WqHQ1ENSaRgjIJiI+vQd7SJHAUVXYBf XgXg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1YlGHfK5QD2fPrgI2kODmm5LK5HBTfJC3MlJNTXGgHU=; b=KWXBx3oWDieyUQ24rizI9np2I3iroV7afEQpO00UYUtZo/UcglNz8D3GbYMwEY87br 38L8O462fGoBNxWwL0QMYAh18BIm6SmmhaNqcYrdupPRheVJ5D80SY7MIJh5gpDpNzdE TKokw1XHSyCM0l9QzvVag4oCGzrYRNQd6XPt9utEpuT7tQa7x6Mhzf9gW4JDbdth8gRj VuPPpTZ2eDpzxWtGMvO4TJ9BMc53TK5ueQUpa5kSQvuCCezCu7FbQTtphsYgRmsnA1/D RZAQNZuJUxkVjPiH/Ceg7e3jRfbgz9wE6/N5hbU/ZQp2TibKZ0vwLKxI7a8joLsJE6wh dUNw== X-Gm-Message-State: AGi0PuYQrCuEwvWq4BBappj9huPr89UkDPlyWRqOTINf+3xB30CvUWVv 7MG0ADycNsDtiPoT92hepSd+WBvOB2GSo06fg1g= X-Google-Smtp-Source: APiQypKqPeN+pLaa2sRWWIbatndfn3quXyqjAFW4BZvJoZ6gZyTjB+rItZ9ZFvDibgmQWgdM8P5sk6iMUR90T03Jz7I= X-Received: by 2002:a05:6602:21c6:: with SMTP id c6mr13705631ioc.163.1586872013226; Tue, 14 Apr 2020 06:46:53 -0700 (PDT) MIME-Version: 1.0 References: <20200226163635.18252-1-sodey@rbbn.com> <20200413230930.23514-1-rmody@marvell.com> In-Reply-To: <20200413230930.23514-1-rmody@marvell.com> From: Jerin Jacob Date: Tue, 14 Apr 2020 19:16:37 +0530 Message-ID: To: Rasesh Mody Cc: Jerin Jacob , Souvik Dey , dpdk-dev , Ferruh Yigit , Thomas Monjalon Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v3] net/bnx2x: handle guest VLAN for SR-IOV case 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" On Tue, Apr 14, 2020 at 4:39 AM Rasesh Mody wrote: > > From: Souvik Dey > > In case of bnx2xvf pmd, tx packets can support vland id in 2 ways: > 1. setting the mbuf ol_flags=PKT_TX_VLAN_PKT and passing the > vlanid in mbuf->vlan_tci. > 2. the tx packet itself has the vlan id included in the packet. > The first case is working as expected but the second case where > the vlan id is included in thetx packets itself was found not > working as expected. To handle that we need to properly set the > start_bd bitfield and the vlan_or_ethertype instead of setting it > to just the ethertype in case of VF. > > v3: > * Fixed the checkpatch issue. > * Changed vlan to VLAN in the headline. > > v2: > * Fix compilation issues. > * Changed the Subject Line as recommended. > > Signed-off-by: Souvik Dey > Acked-by: Rasesh Mody Applied to dpdk-next-net-mrvl/master. Thanks > --- > drivers/net/bnx2x/bnx2x.c | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c > index 0b4030e2b9..ff7646b25d 100644 > --- a/drivers/net/bnx2x/bnx2x.c > +++ b/drivers/net/bnx2x/bnx2x.c > @@ -2216,11 +2216,27 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0) > tx_start_bd->vlan_or_ethertype = > rte_cpu_to_le_16(pkt_prod); > else { > + /* when transmitting in a vf, start bd > + * must hold the ethertype for fw to enforce it > + */ > struct rte_ether_hdr *eh = > rte_pktmbuf_mtod(m0, struct rte_ether_hdr *); > > - tx_start_bd->vlan_or_ethertype = > - rte_cpu_to_le_16(rte_be_to_cpu_16(eh->ether_type)); > + /* Still need to consider inband vlan for enforced */ > + if (eh->ether_type == > + rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN)) { > + struct rte_vlan_hdr *vh = > + (struct rte_vlan_hdr *)(eh + 1); > + tx_start_bd->bd_flags.as_bitfield |= > + (X_ETH_INBAND_VLAN << > + ETH_TX_BD_FLAGS_VLAN_MODE_SHIFT); > + tx_start_bd->vlan_or_ethertype = > + rte_cpu_to_le_16(ntohs(vh->vlan_tci)); > + } else { > + tx_start_bd->vlan_or_ethertype = > + (rte_cpu_to_le_16 > + (rte_be_to_cpu_16(eh->ether_type))); > + } > } > } > > -- > 2.18.0 >