From: "Dey, Souvik" <sodey@rbbn.com>
To: rmody@marvell.com, shshaikh@marvell.com, jerinj@marvell.com,
ferruh.yigit@intel.com, thomas@monjalon.net
Cc: dev@dpdk.org, stable@dpdk.org, "Dey, Souvik" <sodey@rbbn.com>
Subject: [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan for SR-IOV case
Date: Fri, 28 Feb 2020 13:28:43 -0500 [thread overview]
Message-ID: <20200228182843.14568-1-sodey@rbbn.com> (raw)
In-Reply-To: <20200226163635.18252-1-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.
Signed-off-by: "Dey, Souvik" <sodey@rbbn.com>
---
v2:
* Fixed complitaion issues
ether_type to rte_ether_type/
ETHER_TYPE_VLAN to RTE_ETHER_TYPE_VLAN/
vlan_hdr to rte_vlan_hdr/
* Changed the subject line from bnx2x to net/bnx2x.
drivers/net/bnx2x/bnx2x.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index f7cca21..a96e8c2 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -2219,11 +2219,11 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0)
/* when transmitting in a vf, start bd must hold the ethertype
* for fw to enforce it
*/
- struct ether_hdr *eh =
+ struct rte_ether_hdr *eh =
rte_pktmbuf_mtod(m0, struct ether_hdr *);
/* Still need to consider inband vlan for enforced */
- if (eh->ether_type == rte_cpu_to_be_16(ETHER_TYPE_VLAN)) {
- struct vlan_hdr *vh = (struct vlan_hdr *)(eh + 1);
+ if (eh->ether_type == rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN)) {
+ struct rte_vlan_hdr *vh = (struct vlan_hdr *)(eh + 1);
tx_start_bd->bd_flags.as_bitfield |=
(X_ETH_INBAND_VLAN <<
ETH_TX_BD_FLAGS_VLAN_MODE_SHIFT);
@@ -2231,7 +2231,8 @@ int bnx2x_tx_encap(struct bnx2x_tx_queue *txq, struct rte_mbuf *m0)
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));
+ (rte_cpu_to_le_16(
+ rte_be_to_cpu_16(eh->ether_type)));
}
}
}
--
2.9.3
-----------------------------------------------------------------------------------------------------------------------
Notice: This e-mail together with any attachments may contain information of Ribbon Communications Inc. that
is confidential and/or proprietary for the sole use of the intended recipient. Any review, disclosure, reliance or
distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended
recipient, please notify the sender immediately and then delete all copies, including any attachments.
-----------------------------------------------------------------------------------------------------------------------
next prev parent reply other threads:[~2020-02-28 18:29 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-26 16:36 [dpdk-dev] [PATCH] bnx2x: " Dey, Souvik
2020-02-26 23:05 ` [dpdk-dev] [EXT] " Rasesh Mody
2020-02-28 18:28 ` Dey, Souvik [this message]
2020-02-28 19:48 ` [dpdk-dev] [PATCH v2] " 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
2020-03-03 1:29 [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan " Dey, Souvik
2020-03-03 23:01 ` Rasesh Mody
2020-03-05 13:51 ` Dey, Souvik
2020-04-05 13:06 ` Jerin Jacob
2020-04-06 16:59 ` 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=20200228182843.14568-1-sodey@rbbn.com \
--to=sodey@rbbn.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.com \
--cc=jerinj@marvell.com \
--cc=rmody@marvell.com \
--cc=shshaikh@marvell.com \
--cc=stable@dpdk.org \
--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 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).