* [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan for SR-IOV case
@ 2020-03-03 1:29 Dey, Souvik
2020-03-03 23:01 ` Rasesh Mody
2020-04-06 16:57 ` [dpdk-dev] [PATCH v3] net/bnx2x: handle guest VLAN " Dey, Souvik
0 siblings, 2 replies; 7+ messages in thread
From: Dey, Souvik @ 2020-03-03 1:29 UTC (permalink / raw)
To: rmody, shshaikh, jerinj, ferruh.yigit, thomas; +Cc: dev, stable, Dey, Souvik
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:
* Fix compilation issues.
* Changed the Subject Line as recommended.
drivers/net/bnx2x/bnx2x.c | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 0b4030e..0afa602 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -2216,11 +2216,25 @@ 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.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.
-----------------------------------------------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan for SR-IOV case
2020-03-03 1:29 [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan for SR-IOV case Dey, Souvik
@ 2020-03-03 23:01 ` Rasesh Mody
2020-03-05 13:51 ` Dey, Souvik
2020-04-06 16:57 ` [dpdk-dev] [PATCH v3] net/bnx2x: handle guest VLAN " Dey, Souvik
1 sibling, 1 reply; 7+ messages in thread
From: Rasesh Mody @ 2020-03-03 23:01 UTC (permalink / raw)
To: Dey, Souvik, Shahed Shaikh, Jerin Jacob Kollanukkaran,
ferruh.yigit, thomas
Cc: dev, stable
>From: dev <dev-bounces@dpdk.org> On Behalf Of Dey, Souvik
>Sent: Monday, March 02, 2020 5:29 PM
>
>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>
>---
May be it would be good to use --in-reply-to when generating the patch and resubmit. This will ensure it lands up in the same thread as the first patch.
http://mails.dpdk.org/archives/test-report/2020-March/119108.html
Acked-by: Rasesh Mody <rmody@marvell.com>
>v2:
> * Fix compilation issues.
> * Changed the Subject Line as recommended.
>
>
> drivers/net/bnx2x/bnx2x.c | 20 +++++++++++++++++---
> 1 file changed, 17 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index
>0b4030e..0afa602 100644
>--- a/drivers/net/bnx2x/bnx2x.c
>+++ b/drivers/net/bnx2x/bnx2x.c
>@@ -2216,11 +2216,25 @@ 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.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.
>-----------------------------------------------------------------------------------------------
>------------------------
When we are doing open source work, the contents of above footer is not compatible with what we are doing. Please remove the footer in patches and mailing list interactions for future.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan for SR-IOV case
2020-03-03 23:01 ` Rasesh Mody
@ 2020-03-05 13:51 ` Dey, Souvik
2020-04-05 13:06 ` Jerin Jacob
0 siblings, 1 reply; 7+ messages in thread
From: Dey, Souvik @ 2020-03-05 13:51 UTC (permalink / raw)
To: Rasesh Mody, Shahed Shaikh, Jerin Jacob Kollanukkaran,
ferruh.yigit, thomas
Cc: dev, stable
Thanks will do that. And will also try to remove the trailer in the patches. Thanks for pointing it out.
From: dev <dev-bounces@dpdk.org> On Behalf Of Rasesh Mody
Sent: Tuesday, March 3, 2020 6:01 PM
To: Dey, Souvik <sodey@rbbn.com>; Shahed Shaikh <shshaikh@marvell.com>; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; ferruh.yigit@intel.com; thomas@monjalon.net
Cc: dev@dpdk.org; stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan for SR-IOV case
________________________________
NOTICE: This email was received from an EXTERNAL sender
________________________________
>From: dev <dev-bounces@dpdk.org<mailto:dev-bounces@dpdk.org>> On Behalf Of Dey, Souvik
>Sent: Monday, March 02, 2020 5:29 PM
>
>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<mailto:sodey@rbbn.com>>
>---
May be it would be good to use --in-reply-to when generating the patch and resubmit. This will ensure it lands up in the same thread as the first patch.
http://mails.dpdk.org/archives/test-report/2020-March/119108.html<http://mails.dpdk.org/archives/test-report/2020-March/119108.html>
Acked-by: Rasesh Mody <rmody@marvell.com<mailto:rmody@marvell.com>>
>v2:
> * Fix compilation issues.
> * Changed the Subject Line as recommended.
>
>
> drivers/net/bnx2x/bnx2x.c | 20 +++++++++++++++++---
> 1 file changed, 17 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c index
>0b4030e..0afa602 100644
>--- a/drivers/net/bnx2x/bnx2x.c
>+++ b/drivers/net/bnx2x/bnx2x.c
>@@ -2216,11 +2216,25 @@ 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.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.
>-----------------------------------------------------------------------------------------------
>------------------------
When we are doing open source work, the contents of above footer is not compatible with what we are doing. Please remove the footer in patches and mailing list interactions for future.
-----------------------------------------------------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan for SR-IOV case
2020-03-05 13:51 ` Dey, Souvik
@ 2020-04-05 13:06 ` Jerin Jacob
2020-04-06 16:59 ` Dey, Souvik
0 siblings, 1 reply; 7+ messages in thread
From: Jerin Jacob @ 2020-04-05 13:06 UTC (permalink / raw)
To: Dey, Souvik
Cc: Rasesh Mody, Shahed Shaikh, Jerin Jacob Kollanukkaran,
ferruh.yigit, thomas, dev, stable
On Thu, Mar 5, 2020 at 7:21 PM Dey, Souvik <sodey@rbbn.com> wrote:
>
> Thanks will do that. And will also try to remove the trailer in the patches. Thanks for pointing it out.
>
> From: dev <dev-bounces@dpdk.org> On Behalf Of Rasesh Mody
> Sent: Tuesday, March 3, 2020 6:01 PM
> To: Dey, Souvik <sodey@rbbn.com>; Shahed Shaikh <shshaikh@marvell.com>; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; ferruh.yigit@intel.com; thomas@monjalon.net
> Cc: dev@dpdk.org; stable@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan for SR-IOV case
1) Please change vlan to VLAN
2) Fix the following checkpatch issue. Probably move the new code to a
new function
to get enough space.
[master][dpdk-next-net-mrvl] $ ./devtools/checkpatches.sh
### net/bnx2x: handle guest VLAN for SR-IOV case
WARNING:BAD_SIGN_OFF: email address '"Dey Souvik" <sodey@rbbn.com>'
might be better as 'Dey Souvik <sodey@rbbn.com>'
#16:
Signed-off-by: "Dey Souvik" <sodey@rbbn.com>
WARNING:LONG_LINE_COMMENT: line over 80 characters
#27: FILE: drivers/net/bnx2x/bnx2x.c:2219:
+ /* when transmitting in a vf, start bd must
hold the ethertype
WARNING:LONG_LINE: line over 80 characters
#36: FILE: drivers/net/bnx2x/bnx2x.c:2225:
+ if (eh->ether_type ==
rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN)) {
WARNING:LONG_LINE: line over 80 characters
#41: FILE: drivers/net/bnx2x/bnx2x.c:2230:
+
ETH_TX_BD_FLAGS_VLAN_MODE_SHIFT);
WARNING:LONG_LINE: line over 80 characters
#47: FILE: drivers/net/bnx2x/bnx2x.c:2236:
+
(rte_be_to_cpu_16(eh->ether_type)));
WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal
patch author 'Dey, Souvik <sodey@rbbn.com>'
total: 0 errors, 6 warnings, 0 checks, 28 lines checked
0/1 valid patch
----------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan for SR-IOV case
2020-04-05 13:06 ` Jerin Jacob
@ 2020-04-06 16:59 ` Dey, Souvik
0 siblings, 0 replies; 7+ messages in thread
From: Dey, Souvik @ 2020-04-06 16:59 UTC (permalink / raw)
To: Jerin Jacob
Cc: Rasesh Mody, Shahed Shaikh, Jerin Jacob Kollanukkaran,
ferruh.yigit, thomas, dev, stable
Just for reference also attached the changed patch in text format with the changes requested below. Have raised a v3 of the patch too.
Now bit ceckpatches and check-git-logs works fine and also updated vlan to VLAN.
--
Thanks,
Souvik
From: Jerin Jacob <jerinjacobk@gmail.com>
Sent: Sunday, April 5, 2020 9:06 AM
To: Dey, Souvik <sodey@rbbn.com>
Cc: Rasesh Mody <rmody@marvell.com>; Shahed Shaikh <shshaikh@marvell.com>; Jerin Jacob Kollanukkaran <jerinj@marvell.com>; ferruh.yigit@intel.com; thomas@monjalon.net; dev@dpdk.org; stable@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan for SR-IOV case
________________________________
NOTICE: This email was received from an EXTERNAL sender
________________________________
On Thu, Mar 5, 2020 at 7:21 PM Dey, Souvik <sodey@rbbn.com<mailto:sodey@rbbn.com>> wrote:
>
> Thanks will do that. And will also try to remove the trailer in the patches. Thanks for pointing it out.
>
> From: dev <dev-bounces@dpdk.org<mailto:dev-bounces@dpdk.org>> On Behalf Of Rasesh Mody
> Sent: Tuesday, March 3, 2020 6:01 PM
> To: Dey, Souvik <sodey@rbbn.com<mailto:sodey@rbbn.com>>; Shahed Shaikh <shshaikh@marvell.com<mailto:shshaikh@marvell.com>>; Jerin Jacob Kollanukkaran <jerinj@marvell.com<mailto:jerinj@marvell.com>>; ferruh.yigit@intel.com<mailto:ferruh.yigit@intel.com>; thomas@monjalon.net<mailto:thomas@monjalon.net>
> Cc: dev@dpdk.org<mailto:dev@dpdk.org>; stable@dpdk.org<mailto:stable@dpdk.org>
> Subject: Re: [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan for SR-IOV case
1) Please change vlan to VLAN
2) Fix the following checkpatch issue. Probably move the new code to a
new function
to get enough space.
[master][dpdk-next-net-mrvl] $ ./devtools/checkpatches.sh
### net/bnx2x: handle guest VLAN for SR-IOV case
WARNING:BAD_SIGN_OFF: email address '"Dey Souvik" <sodey@rbbn.com<mailto:sodey@rbbn.com>>'
might be better as 'Dey Souvik <sodey@rbbn.com<mailto:sodey@rbbn.com>>'
#16:
Signed-off-by: "Dey Souvik" <sodey@rbbn.com<mailto:sodey@rbbn.com>>
WARNING:LONG_LINE_COMMENT: line over 80 characters
#27: FILE: drivers/net/bnx2x/bnx2x.c:2219:
+ /* when transmitting in a vf, start bd must
hold the ethertype
WARNING:LONG_LINE: line over 80 characters
#36: FILE: drivers/net/bnx2x/bnx2x.c:2225:
+ if (eh->ether_type ==
rte_cpu_to_be_16(RTE_ETHER_TYPE_VLAN)) {
WARNING:LONG_LINE: line over 80 characters
#41: FILE: drivers/net/bnx2x/bnx2x.c:2230:
+
ETH_TX_BD_FLAGS_VLAN_MODE_SHIFT);
WARNING:LONG_LINE: line over 80 characters
#47: FILE: drivers/net/bnx2x/bnx2x.c:2236:
+
(rte_be_to_cpu_16(eh->ether_type)));
WARNING:NO_AUTHOR_SIGN_OFF: Missing Signed-off-by: line by nominal
patch author 'Dey, Souvik <sodey@rbbn.com<mailto:sodey@rbbn.com>>'
total: 0 errors, 6 warnings, 0 checks, 28 lines checked
0/1 valid patch
----------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH v3] net/bnx2x: handle guest VLAN for SR-IOV case
2020-03-03 1:29 [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan for SR-IOV case Dey, Souvik
2020-03-03 23:01 ` Rasesh Mody
@ 2020-04-06 16:57 ` Dey, Souvik
1 sibling, 0 replies; 7+ messages in thread
From: Dey, Souvik @ 2020-04-06 16:57 UTC (permalink / raw)
To: dev; +Cc: Souvik Dey
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.
Signed-off-by: Souvik Dey <"sodey@rbbn.com>
---
v3:
* Fixed the checkpatch issue.
* Changed vlan to VLAN in the headline.
v2:
* Fix compilation issues.
* Changed the Subject Line as recommended.
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 0b4030e..ff7646b 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.9.3.windows.1
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH] bnx2x: handle guest vlan for SR-IOV case
@ 2020-02-26 16:36 Dey, Souvik
2020-02-28 18:28 ` [dpdk-dev] [PATCH v2] net/bnx2x: " Dey, Souvik
0 siblings, 1 reply; 7+ messages in thread
From: Dey, Souvik @ 2020-02-26 16:36 UTC (permalink / raw)
To: rmody, shshaikh, jerinj, ferruh.yigit, thomas; +Cc: dev, Dey, Souvik
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>
---
drivers/net/bnx2x/bnx2x.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x.c b/drivers/net/bnx2x/bnx2x.c
index 0b4030e..f7cca21 100644
--- a/drivers/net/bnx2x/bnx2x.c
+++ b/drivers/net/bnx2x/bnx2x.c
@@ -2216,11 +2216,23 @@ 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 {
- 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));
+ /* when transmitting in a vf, start bd must hold the ethertype
+ * for fw to enforce it
+ */
+ struct 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);
+ 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.9.3.windows.1
-----------------------------------------------------------------------------------------------------------------------
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.
-----------------------------------------------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan for SR-IOV case
2020-02-26 16:36 [dpdk-dev] [PATCH] bnx2x: handle guest vlan " Dey, Souvik
@ 2020-02-28 18:28 ` Dey, Souvik
0 siblings, 0 replies; 7+ messages in thread
From: Dey, Souvik @ 2020-02-28 18:28 UTC (permalink / raw)
To: rmody, shshaikh, jerinj, ferruh.yigit, thomas; +Cc: dev, stable, Dey, Souvik
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.
-----------------------------------------------------------------------------------------------------------------------
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2020-04-06 16:59 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-03 1:29 [dpdk-dev] [PATCH v2] net/bnx2x: handle guest vlan for SR-IOV case 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
2020-04-06 16:57 ` [dpdk-dev] [PATCH v3] net/bnx2x: handle guest VLAN " Dey, Souvik
-- strict thread matches above, loose matches on Subject: below --
2020-02-26 16:36 [dpdk-dev] [PATCH] bnx2x: handle guest vlan " Dey, Souvik
2020-02-28 18:28 ` [dpdk-dev] [PATCH v2] net/bnx2x: " Dey, Souvik
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).