All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jerin Jacob <jerinjacobk@gmail.com>
To: Rasesh Mody <rmody@marvell.com>
Cc: Jerin Jacob <jerinj@marvell.com>, Souvik Dey <sodey@rbbn.com>,
	dpdk-dev <dev@dpdk.org>,  Ferruh Yigit <ferruh.yigit@intel.com>,
	Thomas Monjalon <thomas@monjalon.net>
Subject: Re: [dpdk-dev] [PATCH v3] net/bnx2x: handle guest VLAN for SR-IOV case
Date: Tue, 14 Apr 2020 19:16:37 +0530	[thread overview]
Message-ID: <CALBAE1Na3aLTAj30NkEmnnZ9pQr5eBLx-Eiw4VwsjCMctOw+Bw@mail.gmail.com> (raw)
In-Reply-To: <20200413230930.23514-1-rmody@marvell.com>

On Tue, Apr 14, 2020 at 4:39 AM Rasesh Mody <rmody@marvell.com> wrote:
>
> From: Souvik Dey <sodey@rbbn.com>
>
> 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 <sodey@rbbn.com>
> Acked-by: Rasesh Mody <rmody@marvell.com>

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
>

  reply	other threads:[~2020-04-14 13:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 16:36 [dpdk-dev] [PATCH] bnx2x: handle guest vlan for SR-IOV case Dey, Souvik
2020-02-26 23:05 ` [dpdk-dev] [EXT] " Rasesh Mody
2020-02-28 18:28 ` [dpdk-dev] [PATCH v2] net/bnx2x: " Dey, Souvik
2020-02-28 19:48 ` [dpdk-dev] [PATCH v2] bnx2x: " Dey, Souvik
2020-04-13 23:09 ` [dpdk-dev] [PATCH v3] net/bnx2x: handle guest VLAN " Rasesh Mody
2020-04-14 13:46   ` Jerin Jacob [this message]
2020-03-03  1:29 [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan " Dey, Souvik
2020-04-06 16:57 ` [dpdk-dev] [PATCH v3] net/bnx2x: handle guest VLAN " Dey, Souvik

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=CALBAE1Na3aLTAj30NkEmnnZ9pQr5eBLx-Eiw4VwsjCMctOw+Bw@mail.gmail.com \
    --to=jerinjacobk@gmail.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jerinj@marvell.com \
    --cc=rmody@marvell.com \
    --cc=sodey@rbbn.com \
    --cc=thomas@monjalon.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.