All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/bonding: strengthen the judgment of lacp packets
@ 2017-08-30  3:46 ZengGanghui
  2017-09-04 13:19 ` Radu Nicolau
  2017-09-18  9:14 ` Doherty, Declan
  0 siblings, 2 replies; 12+ messages in thread
From: ZengGanghui @ 2017-08-30  3:46 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty

When the nic does not support vlan rx offload may be wrong, resulting in
lacp packets will not be processed.

Signed-off-by: ZengGanghui <zengganghui@huawei.com>
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 383e27c..7feb12f 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -125,11 +125,12 @@
 }
 
 static inline uint8_t
-is_lacp_packets(uint16_t ethertype, uint8_t subtype, uint16_t vlan_tci)
+is_lacp_packets(uint16_t ethertype, uint8_t subtype, struct rte_mbuf *mbuf)
 {
 	const uint16_t ether_type_slow_be = rte_be_to_cpu_16(ETHER_TYPE_SLOW);
 
-	return !vlan_tci && (ethertype == ether_type_slow_be &&
+	return !((mbuf->ol_flags & PKT_RX_VLAN_PKT) ? mbuf->vlan_tci : 0) &&
+		(ethertype == ether_type_slow_be &&
 		(subtype == SLOW_SUBTYPE_MARKER || subtype == SLOW_SUBTYPE_LACP));
 }
 
@@ -444,7 +445,7 @@
 			/* Remove packet from array if it is slow packet or slave is not
 			 * in collecting state or bonding interface is not in promiscuous
 			 * mode and packet address does not match. */
-			if (unlikely(is_lacp_packets(hdr->ether_type, subtype, bufs[j]->vlan_tci) ||
+			if (unlikely(is_lacp_packets(hdr->ether_type, subtype, bufs[j]) ||
 				!collecting || (!promisc &&
 					!is_multicast_ether_addr(&hdr->d_addr) &&
 					!is_same_ether_addr(&bond_mac, &hdr->d_addr)))) {
-- 
1.9.5.msysgit.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] net/bonding: strengthen the judgment of lacp packets
  2017-08-30  3:46 [PATCH] net/bonding: strengthen the judgment of lacp packets ZengGanghui
@ 2017-09-04 13:19 ` Radu Nicolau
  2017-10-10 19:55   ` Ferruh Yigit
  2017-09-18  9:14 ` Doherty, Declan
  1 sibling, 1 reply; 12+ messages in thread
From: Radu Nicolau @ 2017-09-04 13:19 UTC (permalink / raw)
  To: ZengGanghui, dev; +Cc: declan.doherty


On 8/30/2017 4:46 AM, ZengGanghui wrote:
> When the nic does not support vlan rx offload may be wrong, resulting in
> lacp packets will not be processed.
>
> Signed-off-by: ZengGanghui <zengganghui@huawei.com>
Reviewed-by:  Radu Nicolau <radu.nicolau@intel.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net/bonding: strengthen the judgment of lacp packets
  2017-08-30  3:46 [PATCH] net/bonding: strengthen the judgment of lacp packets ZengGanghui
  2017-09-04 13:19 ` Radu Nicolau
@ 2017-09-18  9:14 ` Doherty, Declan
  2017-09-18 11:12   ` zengganghui
  1 sibling, 1 reply; 12+ messages in thread
From: Doherty, Declan @ 2017-09-18  9:14 UTC (permalink / raw)
  To: ZengGanghui, dev

On 30/08/2017 4:46 AM, ZengGanghui wrote:
> When the nic does not support vlan rx offload may be wrong, resulting in
> lacp packets will not be processed.
> 
> Signed-off-by: ZengGanghui <zengganghui@huawei.com>
> ---
...
> 

Acked-by: Declan Doherty <declan.doherty@intel.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net/bonding: strengthen the judgment of lacp packets
  2017-09-18  9:14 ` Doherty, Declan
@ 2017-09-18 11:12   ` zengganghui
  2017-09-18 12:33     ` Doherty, Declan
  0 siblings, 1 reply; 12+ messages in thread
From: zengganghui @ 2017-09-18 11:12 UTC (permalink / raw)
  To: Doherty, Declan, dev

For example, when packets received from an MLX network card, the value of mbuf->vlan_tci is a random value. So that this value cannot be used to determine whether VLAN packets . We need to judgment mbuf->ol_flags first.

BR.
Zeng Ganghui
Huawei Technologies Co., Ltd.

-----Original Message-----
From: Doherty, Declan [mailto:declan.doherty@intel.com] 
Sent: Monday, September 18, 2017 5:14 PM
To: zengganghui; dev@dpdk.org
Subject: Re: [PATCH] net/bonding: strengthen the judgment of lacp packets

On 30/08/2017 4:46 AM, ZengGanghui wrote:
> When the nic does not support vlan rx offload may be wrong, resulting 
> in lacp packets will not be processed.
> 
> Signed-off-by: ZengGanghui <zengganghui@huawei.com>
> ---
...
> 

Acked-by: Declan Doherty <declan.doherty@intel.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net/bonding: strengthen the judgment of lacp packets
  2017-09-18 11:12   ` zengganghui
@ 2017-09-18 12:33     ` Doherty, Declan
  2017-09-18 12:50       ` zengganghui
  0 siblings, 1 reply; 12+ messages in thread
From: Doherty, Declan @ 2017-09-18 12:33 UTC (permalink / raw)
  To: zengganghui, dev

On 18/09/2017 12:12 PM, zengganghui wrote:
> For example, when packets received from an MLX network card, the value of mbuf->vlan_tci is a random value. So that this value cannot be used to determine whether VLAN packets . We need to judgment mbuf->ol_flags first.
> 
> BR.
> Zeng Ganghui
> Huawei Technologies Co., Ltd.
> 
> -----Original Message-----
> From: Doherty, Declan [mailto:declan.doherty@intel.com]
> Sent: Monday, September 18, 2017 5:14 PM
> To: zengganghui; dev@dpdk.org
> Subject: Re: [PATCH] net/bonding: strengthen the judgment of lacp packets
> 
> On 30/08/2017 4:46 AM, ZengGanghui wrote:
>> When the nic does not support vlan rx offload may be wrong, resulting
>> in lacp packets will not be processed.
>>
>> Signed-off-by: ZengGanghui <zengganghui@huawei.com>
>> ---
> ...
>>
> 
> Acked-by: Declan Doherty <declan.doherty@intel.com>
> 

Ok, I see your point. A LACP PDU can't be encapsulated in a VLAN packet 
anyway, as it is link local traffic. So a check for ol_flags & 
PKT_RX_VLAN_PKT != 0 should be sufficient, otherwise if the 
PKT_RX_VLAN_PKT flag is true the packet cannot be link local and 
therefore a LACP PDU. I think that it's safe to assume all PMDs must set 
this flag if VLAN stripping is enabled?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net/bonding: strengthen the judgment of lacp packets
  2017-09-18 12:33     ` Doherty, Declan
@ 2017-09-18 12:50       ` zengganghui
  2017-09-18 13:11         ` Doherty, Declan
  0 siblings, 1 reply; 12+ messages in thread
From: zengganghui @ 2017-09-18 12:50 UTC (permalink / raw)
  To: Doherty, Declan, dev

All mbuf packets have been init to zero when pktmbuf pool create. So judgment this flag is safe, whether or not support VLAN stripping.

BR.
Zeng Ganghui
Huawei Technologies Co., Ltd.

-----Original Message-----
From: Doherty, Declan [mailto:declan.doherty@intel.com] 
Sent: Monday, September 18, 2017 8:34 PM
To: zengganghui; dev@dpdk.org
Subject: Re: [PATCH] net/bonding: strengthen the judgment of lacp packets

On 18/09/2017 12:12 PM, zengganghui wrote:
> For example, when packets received from an MLX network card, the value of mbuf->vlan_tci is a random value. So that this value cannot be used to determine whether VLAN packets . We need to judgment mbuf->ol_flags first.
> 
> BR.
> Zeng Ganghui
> Huawei Technologies Co., Ltd.
> 
> -----Original Message-----
> From: Doherty, Declan [mailto:declan.doherty@intel.com]
> Sent: Monday, September 18, 2017 5:14 PM
> To: zengganghui; dev@dpdk.org
> Subject: Re: [PATCH] net/bonding: strengthen the judgment of lacp 
> packets
> 
> On 30/08/2017 4:46 AM, ZengGanghui wrote:
>> When the nic does not support vlan rx offload may be wrong, resulting 
>> in lacp packets will not be processed.
>>
>> Signed-off-by: ZengGanghui <zengganghui@huawei.com>
>> ---
> ...
>>
> 
> Acked-by: Declan Doherty <declan.doherty@intel.com>
> 

Ok, I see your point. A LACP PDU can't be encapsulated in a VLAN packet anyway, as it is link local traffic. So a check for ol_flags & PKT_RX_VLAN_PKT != 0 should be sufficient, otherwise if the PKT_RX_VLAN_PKT flag is true the packet cannot be link local and therefore a LACP PDU. I think that it's safe to assume all PMDs must set this flag if VLAN stripping is enabled?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net/bonding: strengthen the judgment of lacp packets
  2017-09-18 12:50       ` zengganghui
@ 2017-09-18 13:11         ` Doherty, Declan
  2017-09-19  4:09           ` zengganghui
  0 siblings, 1 reply; 12+ messages in thread
From: Doherty, Declan @ 2017-09-18 13:11 UTC (permalink / raw)
  To: zengganghui, dev

On 18/09/2017 1:50 PM, zengganghui wrote:
> All mbuf packets have been init to zero when pktmbuf pool create. So judgment this flag is safe, whether or not support VLAN stripping.

Ok, but is there any need to check the ol_flags for PKT_RX_VLAN_PKT or 
check the vlan_tci at all. I haven't come across anything in the 
specification which allows LACP links to be formed on top of VLANs but I 
may be missing something? So if the ethertype is not ETHER_TYPE_SLOW it 
is irrelevant whether the packet has a VLAN tag or not.

Also on the basis that you could have LAG groups on top of VLANs, if the 
NIC doesn't support VLAN stripping/insertion then we would miss all the 
ingress LACP PDU at the moment now anyway, since the ethertype would be 
VLAN and not ETHER_TYPE_SLOW, so is_lacp_packet() would always return 0, 
and we would also fail to encapsulate the LACP PDU in the correct VLAN 
on egress as that isn't supported in the bonding implementation.

> 
> BR.
> Zeng Ganghui
> Huawei Technologies Co., Ltd.
> 
> -----Original Message-----
> From: Doherty, Declan [mailto:declan.doherty@intel.com]
> Sent: Monday, September 18, 2017 8:34 PM
> To: zengganghui; dev@dpdk.org
> Subject: Re: [PATCH] net/bonding: strengthen the judgment of lacp packets
> 
> On 18/09/2017 12:12 PM, zengganghui wrote:
>> For example, when packets received from an MLX network card, the value of mbuf->vlan_tci is a random value. So that this value cannot be used to determine whether VLAN packets . We need to judgment mbuf->ol_flags first.
>>
>> BR.
>> Zeng Ganghui
>> Huawei Technologies Co., Ltd.
>>
>> -----Original Message-----
>> From: Doherty, Declan [mailto:declan.doherty@intel.com]
>> Sent: Monday, September 18, 2017 5:14 PM
>> To: zengganghui; dev@dpdk.org
>> Subject: Re: [PATCH] net/bonding: strengthen the judgment of lacp
>> packets
>>
>> On 30/08/2017 4:46 AM, ZengGanghui wrote:
>>> When the nic does not support vlan rx offload may be wrong, resulting
>>> in lacp packets will not be processed.
>>>
>>> Signed-off-by: ZengGanghui <zengganghui@huawei.com>
>>> ---
>> ...
>>>
>>
>> Acked-by: Declan Doherty <declan.doherty@intel.com>
>>
> 
> Ok, I see your point. A LACP PDU can't be encapsulated in a VLAN packet anyway, as it is link local traffic. So a check for ol_flags & PKT_RX_VLAN_PKT != 0 should be sufficient, otherwise if the PKT_RX_VLAN_PKT flag is true the packet cannot be link local and therefore a LACP PDU. I think that it's safe to assume all PMDs must set this flag if VLAN stripping is enabled?
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net/bonding: strengthen the judgment of lacp packets
  2017-09-18 13:11         ` Doherty, Declan
@ 2017-09-19  4:09           ` zengganghui
  2017-10-03 15:49             ` Ferruh Yigit
  0 siblings, 1 reply; 12+ messages in thread
From: zengganghui @ 2017-09-19  4:09 UTC (permalink / raw)
  To: Doherty, Declan, dev

Local LACP packets do not have VLANs, and ethertype must be ETHER_TYPE_SLOW. But when the PMD supports VLAN strip, you cannot directly determine the ethertype from the packet, but depends on whether the VLAN is stripped. If a VLAN is stripped, then this is not a local LACP packet, but it may be a need to pass through packet. The previous code was not rigorous in determining whether the VLAN was being stripped.
Did I answer your question?

BR.
Zeng Ganghui
Huawei Technologies Co., Ltd.

-----Original Message-----
From: Doherty, Declan [mailto:declan.doherty@intel.com] 
Sent: Monday, September 18, 2017 9:11 PM
To: zengganghui; dev@dpdk.org
Subject: Re: [PATCH] net/bonding: strengthen the judgment of lacp packets

On 18/09/2017 1:50 PM, zengganghui wrote:
> All mbuf packets have been init to zero when pktmbuf pool create. So judgment this flag is safe, whether or not support VLAN stripping.

Ok, but is there any need to check the ol_flags for PKT_RX_VLAN_PKT or check the vlan_tci at all. I haven't come across anything in the specification which allows LACP links to be formed on top of VLANs but I may be missing something? So if the ethertype is not ETHER_TYPE_SLOW it is irrelevant whether the packet has a VLAN tag or not.

Also on the basis that you could have LAG groups on top of VLANs, if the NIC doesn't support VLAN stripping/insertion then we would miss all the ingress LACP PDU at the moment now anyway, since the ethertype would be VLAN and not ETHER_TYPE_SLOW, so is_lacp_packet() would always return 0, and we would also fail to encapsulate the LACP PDU in the correct VLAN on egress as that isn't supported in the bonding implementation.

> 
> BR.
> Zeng Ganghui
> Huawei Technologies Co., Ltd.
> 
> -----Original Message-----
> From: Doherty, Declan [mailto:declan.doherty@intel.com]
> Sent: Monday, September 18, 2017 8:34 PM
> To: zengganghui; dev@dpdk.org
> Subject: Re: [PATCH] net/bonding: strengthen the judgment of lacp 
> packets
> 
> On 18/09/2017 12:12 PM, zengganghui wrote:
>> For example, when packets received from an MLX network card, the value of mbuf->vlan_tci is a random value. So that this value cannot be used to determine whether VLAN packets . We need to judgment mbuf->ol_flags first.
>>
>> BR.
>> Zeng Ganghui
>> Huawei Technologies Co., Ltd.
>>
>> -----Original Message-----
>> From: Doherty, Declan [mailto:declan.doherty@intel.com]
>> Sent: Monday, September 18, 2017 5:14 PM
>> To: zengganghui; dev@dpdk.org
>> Subject: Re: [PATCH] net/bonding: strengthen the judgment of lacp 
>> packets
>>
>> On 30/08/2017 4:46 AM, ZengGanghui wrote:
>>> When the nic does not support vlan rx offload may be wrong, 
>>> resulting in lacp packets will not be processed.
>>>
>>> Signed-off-by: ZengGanghui <zengganghui@huawei.com>
>>> ---
>> ...
>>>
>>
>> Acked-by: Declan Doherty <declan.doherty@intel.com>
>>
> 
> Ok, I see your point. A LACP PDU can't be encapsulated in a VLAN packet anyway, as it is link local traffic. So a check for ol_flags & PKT_RX_VLAN_PKT != 0 should be sufficient, otherwise if the PKT_RX_VLAN_PKT flag is true the packet cannot be link local and therefore a LACP PDU. I think that it's safe to assume all PMDs must set this flag if VLAN stripping is enabled?
> 

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net/bonding: strengthen the judgment of lacp packets
  2017-09-19  4:09           ` zengganghui
@ 2017-10-03 15:49             ` Ferruh Yigit
  2017-10-10  8:53               ` Doherty, Declan
  0 siblings, 1 reply; 12+ messages in thread
From: Ferruh Yigit @ 2017-10-03 15:49 UTC (permalink / raw)
  To: zengganghui, Doherty, Declan, dev

On 9/19/2017 5:09 AM, zengganghui wrote:
> Local LACP packets do not have VLANs, and ethertype must be ETHER_TYPE_SLOW. But when the PMD supports VLAN strip, you cannot directly determine the ethertype from the packet, but depends on whether the VLAN is stripped. If a VLAN is stripped, then this is not a local LACP packet, but it may be a need to pass through packet. The previous code was not rigorous in determining whether the VLAN was being stripped.
> Did I answer your question?

Hi Declan,

Are you OK with the patch?
You already have your ack on patch but discussion was going on...


> 
> BR.
> Zeng Ganghui
> Huawei Technologies Co., Ltd.
> 
> -----Original Message-----
> From: Doherty, Declan [mailto:declan.doherty@intel.com] 
> Sent: Monday, September 18, 2017 9:11 PM
> To: zengganghui; dev@dpdk.org
> Subject: Re: [PATCH] net/bonding: strengthen the judgment of lacp packets
> 
> On 18/09/2017 1:50 PM, zengganghui wrote:
>> All mbuf packets have been init to zero when pktmbuf pool create. So judgment this flag is safe, whether or not support VLAN stripping.
> 
> Ok, but is there any need to check the ol_flags for PKT_RX_VLAN_PKT or check the vlan_tci at all. I haven't come across anything in the specification which allows LACP links to be formed on top of VLANs but I may be missing something? So if the ethertype is not ETHER_TYPE_SLOW it is irrelevant whether the packet has a VLAN tag or not.
> 
> Also on the basis that you could have LAG groups on top of VLANs, if the NIC doesn't support VLAN stripping/insertion then we would miss all the ingress LACP PDU at the moment now anyway, since the ethertype would be VLAN and not ETHER_TYPE_SLOW, so is_lacp_packet() would always return 0, and we would also fail to encapsulate the LACP PDU in the correct VLAN on egress as that isn't supported in the bonding implementation.
> 
>>
>> BR.
>> Zeng Ganghui
>> Huawei Technologies Co., Ltd.
>>
>> -----Original Message-----
>> From: Doherty, Declan [mailto:declan.doherty@intel.com]
>> Sent: Monday, September 18, 2017 8:34 PM
>> To: zengganghui; dev@dpdk.org
>> Subject: Re: [PATCH] net/bonding: strengthen the judgment of lacp 
>> packets
>>
>> On 18/09/2017 12:12 PM, zengganghui wrote:
>>> For example, when packets received from an MLX network card, the value of mbuf->vlan_tci is a random value. So that this value cannot be used to determine whether VLAN packets . We need to judgment mbuf->ol_flags first.
>>>
>>> BR.
>>> Zeng Ganghui
>>> Huawei Technologies Co., Ltd.
>>>
>>> -----Original Message-----
>>> From: Doherty, Declan [mailto:declan.doherty@intel.com]
>>> Sent: Monday, September 18, 2017 5:14 PM
>>> To: zengganghui; dev@dpdk.org
>>> Subject: Re: [PATCH] net/bonding: strengthen the judgment of lacp 
>>> packets
>>>
>>> On 30/08/2017 4:46 AM, ZengGanghui wrote:
>>>> When the nic does not support vlan rx offload may be wrong, 
>>>> resulting in lacp packets will not be processed.
>>>>
>>>> Signed-off-by: ZengGanghui <zengganghui@huawei.com>
>>>> ---
>>> ...
>>>>
>>>
>>> Acked-by: Declan Doherty <declan.doherty@intel.com>
>>>
>>
>> Ok, I see your point. A LACP PDU can't be encapsulated in a VLAN packet anyway, as it is link local traffic. So a check for ol_flags & PKT_RX_VLAN_PKT != 0 should be sufficient, otherwise if the PKT_RX_VLAN_PKT flag is true the packet cannot be link local and therefore a LACP PDU. I think that it's safe to assume all PMDs must set this flag if VLAN stripping is enabled?
>>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net/bonding: strengthen the judgment of lacp packets
  2017-10-03 15:49             ` Ferruh Yigit
@ 2017-10-10  8:53               ` Doherty, Declan
  0 siblings, 0 replies; 12+ messages in thread
From: Doherty, Declan @ 2017-10-10  8:53 UTC (permalink / raw)
  To: Ferruh Yigit, zengganghui, dev

On 03/10/2017 4:49 PM, Ferruh Yigit wrote:
> On 9/19/2017 5:09 AM, zengganghui wrote:
>> Local LACP packets do not have VLANs, and ethertype must be ETHER_TYPE_SLOW. But when the PMD supports VLAN strip, you cannot directly determine the ethertype from the packet, but depends on whether the VLAN is stripped. If a VLAN is stripped, then this is not a local LACP packet, but it may be a need to pass through packet. The previous code was not rigorous in determining whether the VLAN was being stripped.
>> Did I answer your question?
> 
> Hi Declan,
> 
> Are you OK with the patch?
> You already have your ack on patch but discussion was going on...
> 
>
...
> 

Hey Ferruh, sorry I missed this mail, yes I'm happy for this to be applied.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] net/bonding: strengthen the judgment of lacp packets
  2017-09-04 13:19 ` Radu Nicolau
@ 2017-10-10 19:55   ` Ferruh Yigit
  0 siblings, 0 replies; 12+ messages in thread
From: Ferruh Yigit @ 2017-10-10 19:55 UTC (permalink / raw)
  To: Radu Nicolau, ZengGanghui, dev; +Cc: declan.doherty

On 9/4/2017 2:19 PM, Radu Nicolau wrote:
> 
> On 8/30/2017 4:46 AM, ZengGanghui wrote:
>> When the nic does not support vlan rx offload may be wrong, resulting in
>> lacp packets will not be processed.
>>
>> Signed-off-by: ZengGanghui <zengganghui@huawei.com>

> Reviewed-by:  Radu Nicolau <radu.nicolau@intel.com>

Acked-by: Declan Doherty <declan.doherty@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH] net/bonding: strengthen the judgment of lacp packets
@ 2017-08-30  3:43 ZengGanghui
  0 siblings, 0 replies; 12+ messages in thread
From: ZengGanghui @ 2017-08-30  3:43 UTC (permalink / raw)
  To: dev; +Cc: declan.doherty

When the nic does not support vlan rx offload may be wrong, resulting in
lacp packets will not be processed.
---
 drivers/net/bonding/rte_eth_bond_pmd.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 383e27c..7feb12f 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -125,11 +125,12 @@
 }
 
 static inline uint8_t
-is_lacp_packets(uint16_t ethertype, uint8_t subtype, uint16_t vlan_tci)
+is_lacp_packets(uint16_t ethertype, uint8_t subtype, struct rte_mbuf *mbuf)
 {
 	const uint16_t ether_type_slow_be = rte_be_to_cpu_16(ETHER_TYPE_SLOW);
 
-	return !vlan_tci && (ethertype == ether_type_slow_be &&
+	return !((mbuf->ol_flags & PKT_RX_VLAN_PKT) ? mbuf->vlan_tci : 0) &&
+		(ethertype == ether_type_slow_be &&
 		(subtype == SLOW_SUBTYPE_MARKER || subtype == SLOW_SUBTYPE_LACP));
 }
 
@@ -444,7 +445,7 @@
 			/* Remove packet from array if it is slow packet or slave is not
 			 * in collecting state or bonding interface is not in promiscuous
 			 * mode and packet address does not match. */
-			if (unlikely(is_lacp_packets(hdr->ether_type, subtype, bufs[j]->vlan_tci) ||
+			if (unlikely(is_lacp_packets(hdr->ether_type, subtype, bufs[j]) ||
 				!collecting || (!promisc &&
 					!is_multicast_ether_addr(&hdr->d_addr) &&
 					!is_same_ether_addr(&bond_mac, &hdr->d_addr)))) {
-- 
1.9.5.msysgit.1

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2017-10-10 19:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-30  3:46 [PATCH] net/bonding: strengthen the judgment of lacp packets ZengGanghui
2017-09-04 13:19 ` Radu Nicolau
2017-10-10 19:55   ` Ferruh Yigit
2017-09-18  9:14 ` Doherty, Declan
2017-09-18 11:12   ` zengganghui
2017-09-18 12:33     ` Doherty, Declan
2017-09-18 12:50       ` zengganghui
2017-09-18 13:11         ` Doherty, Declan
2017-09-19  4:09           ` zengganghui
2017-10-03 15:49             ` Ferruh Yigit
2017-10-10  8:53               ` Doherty, Declan
  -- strict thread matches above, loose matches on Subject: below --
2017-08-30  3:43 ZengGanghui

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.