* [dpdk-dev] [PATCH] bnxt: fix receive VLAN offload flags
@ 2019-03-25 21:27 Stephen Hemminger
2019-03-25 21:27 ` Stephen Hemminger
2019-03-25 21:34 ` Ajit Khaparde
0 siblings, 2 replies; 6+ messages in thread
From: Stephen Hemminger @ 2019-03-25 21:27 UTC (permalink / raw)
To: ajit.khaparde, somnath.kotur; +Cc: dev, Stephen Hemminger
From: Stephen Hemminger <sthemmin@microsoft.com>
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 <sthemmin@microsoft.com>
---
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* [dpdk-dev] [PATCH] bnxt: fix receive VLAN offload flags
2019-03-25 21:27 [dpdk-dev] [PATCH] bnxt: fix receive VLAN offload flags Stephen Hemminger
@ 2019-03-25 21:27 ` Stephen Hemminger
2019-03-25 21:34 ` Ajit Khaparde
1 sibling, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2019-03-25 21:27 UTC (permalink / raw)
To: ajit.khaparde, somnath.kotur; +Cc: dev, Stephen Hemminger
From: Stephen Hemminger <sthemmin@microsoft.com>
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 <sthemmin@microsoft.com>
---
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] bnxt: fix receive VLAN offload flags
2019-03-25 21:27 [dpdk-dev] [PATCH] bnxt: fix receive VLAN offload flags Stephen Hemminger
2019-03-25 21:27 ` Stephen Hemminger
@ 2019-03-25 21:34 ` Ajit Khaparde
2019-03-25 21:34 ` Ajit Khaparde
2019-03-26 17:37 ` Ferruh Yigit
1 sibling, 2 replies; 6+ messages in thread
From: Ajit Khaparde @ 2019-03-25 21:34 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Somnath Kotur, dev, Stephen Hemminger
On Mon, Mar 25, 2019 at 2:28 PM Stephen Hemminger <
stephen@networkplumber.org> wrote:
> From: Stephen Hemminger <sthemmin@microsoft.com>
>
> 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 <sthemmin@microsoft.com>
>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
> 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
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] bnxt: fix receive VLAN offload flags
2019-03-25 21:34 ` Ajit Khaparde
@ 2019-03-25 21:34 ` Ajit Khaparde
2019-03-26 17:37 ` Ferruh Yigit
1 sibling, 0 replies; 6+ messages in thread
From: Ajit Khaparde @ 2019-03-25 21:34 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Somnath Kotur, dev, Stephen Hemminger
On Mon, Mar 25, 2019 at 2:28 PM Stephen Hemminger <
stephen@networkplumber.org> wrote:
> From: Stephen Hemminger <sthemmin@microsoft.com>
>
> 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 <sthemmin@microsoft.com>
>
Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
> ---
> 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
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] bnxt: fix receive VLAN offload flags
2019-03-25 21:34 ` Ajit Khaparde
2019-03-25 21:34 ` Ajit Khaparde
@ 2019-03-26 17:37 ` Ferruh Yigit
2019-03-26 17:37 ` Ferruh Yigit
1 sibling, 1 reply; 6+ messages in thread
From: Ferruh Yigit @ 2019-03-26 17:37 UTC (permalink / raw)
To: Ajit Khaparde, Stephen Hemminger
Cc: Somnath Kotur, dev, Stephen Hemminger, Rasesh Mody,
Shahed Shaikh, Hemant Agrawal, Shreyansh Jain, Allain Legacy,
Matt Peters, Qi Zhang, Xiao Wang
On 3/25/2019 9:34 PM, Ajit Khaparde wrote:
> On Mon, Mar 25, 2019 at 2:28 PM Stephen Hemminger <
> stephen@networkplumber.org> wrote:
>
>> From: Stephen Hemminger <sthemmin@microsoft.com>
>>
>> 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 <sthemmin@microsoft.com>
>>
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Applied to dpdk-next-net/master, thanks.
In a quick glance, following PMDs as well set "PKT_RX_VLAN" but not
"PKT_RX_VLAN_STRIPPED", their maintainers are cc'ed, can you please double check:
- bnx2x
- qede (it doesn't set 'vlan_tci' if not stripped, should be fixed)
- dpaa2
- dpaa (is 'vlan_tci' set?)
- avp
- fm10k
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-dev] [PATCH] bnxt: fix receive VLAN offload flags
2019-03-26 17:37 ` Ferruh Yigit
@ 2019-03-26 17:37 ` Ferruh Yigit
0 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2019-03-26 17:37 UTC (permalink / raw)
To: Ajit Khaparde, Stephen Hemminger
Cc: Somnath Kotur, dev, Stephen Hemminger, Rasesh Mody,
Shahed Shaikh, Hemant Agrawal, Shreyansh Jain, Allain Legacy,
Matt Peters, Qi Zhang, Xiao Wang
On 3/25/2019 9:34 PM, Ajit Khaparde wrote:
> On Mon, Mar 25, 2019 at 2:28 PM Stephen Hemminger <
> stephen@networkplumber.org> wrote:
>
>> From: Stephen Hemminger <sthemmin@microsoft.com>
>>
>> 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 <sthemmin@microsoft.com>
>>
> Acked-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Applied to dpdk-next-net/master, thanks.
In a quick glance, following PMDs as well set "PKT_RX_VLAN" but not
"PKT_RX_VLAN_STRIPPED", their maintainers are cc'ed, can you please double check:
- bnx2x
- qede (it doesn't set 'vlan_tci' if not stripped, should be fixed)
- dpaa2
- dpaa (is 'vlan_tci' set?)
- avp
- fm10k
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-03-26 17:37 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-25 21:27 [dpdk-dev] [PATCH] bnxt: fix receive VLAN offload flags Stephen Hemminger
2019-03-25 21:27 ` Stephen Hemminger
2019-03-25 21:34 ` Ajit Khaparde
2019-03-25 21:34 ` Ajit Khaparde
2019-03-26 17:37 ` Ferruh Yigit
2019-03-26 17:37 ` Ferruh Yigit
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).