DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [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	[flat|nested] 12+ messages in thread
* [dpdk-dev] [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	[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 [dpdk-dev] [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 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).