From: ZengGanghui <zengganghui@huawei.com>
To: <dev@dpdk.org>
Cc: <declan.doherty@intel.com>
Subject: [dpdk-dev] [PATCH] net/bonding: strengthen the judgment of lacp packets
Date: Wed, 30 Aug 2017 11:43:13 +0800 [thread overview]
Message-ID: <1504064593-9068-1-git-send-email-zengganghui@huawei.com> (raw)
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
next reply other threads:[~2017-08-30 3:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-30 3:43 ZengGanghui [this message]
2017-08-30 3:46 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
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=1504064593-9068-1-git-send-email-zengganghui@huawei.com \
--to=zengganghui@huawei.com \
--cc=declan.doherty@intel.com \
--cc=dev@dpdk.org \
/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).