backport bond patch
(cherry picked from commit 471caaceb108db9e1f914306c619c6eed3c5a87e)
This commit is contained in:
parent
a3f9d43c7b
commit
a0ebfb4579
124
backport-change-state-machine-to-defaulted.patch
Normal file
124
backport-change-state-machine-to-defaulted.patch
Normal file
@ -0,0 +1,124 @@
|
||||
From 0bf68c660e932e76087dc8c87f8b1dacba89c2be Mon Sep 17 00:00:00 2001
|
||||
From: Weifeng Li <liweifeng96@126.com>
|
||||
Date: Sat, 18 Jul 2020 12:35:38 +0800
|
||||
Subject: net/bonding: change state machine to defaulted
|
||||
|
||||
A dpdk bonding 802.3ad network as follows:
|
||||
+----------+ +-----------+
|
||||
|dpdk lacp |bond1.1 <------> bond2.1|switch lacp|
|
||||
| |bond1.2 <------> bond2.2| |
|
||||
+----------+ +-----------+
|
||||
If a fiber optic go wrong about single pass during normal running like
|
||||
this:
|
||||
bond1.2 -----> bond2.2 ok
|
||||
bond1.2 <--x-- bond2.2 error: bond1.2 receive no LACPDU Some packets
|
||||
from switch to dpdk will choose bond2.2
|
||||
and lost.
|
||||
|
||||
DPDK lacp state machine will transits to the expired state if no LACPDU
|
||||
is received before the current_while_timer expires. But if no LACPDU is
|
||||
received before the current_while_timer expires again, DPDK lacp state
|
||||
machine has no change. Bond2.2 can not change to inactive depend on the
|
||||
received LACPDU.
|
||||
According to IEEE 802.3ad, if no lacpdu is received before the
|
||||
current_while_timer expires again, the state machine should transits
|
||||
from expired to defaulted. Bond2.2 will change to inactive depend on the
|
||||
LACPDU with defaulted state.
|
||||
|
||||
This patch adds a state machine change from expired to defaulted when no
|
||||
lacpdu is received before the current_while_timer expires again
|
||||
according to IEEE 802.3ad:
|
||||
If no LACPDU is received before the current_while timer expires again,
|
||||
the state machine transits to the DEFAULTED state. The record Default
|
||||
function overwrites the current operational parameters for the Partner
|
||||
with administratively configured values. This allows configuration of
|
||||
aggregations and individual links when no protocol partner is present,
|
||||
while still permitting an active partner to override default settings.
|
||||
The update_Default_Selected function sets the Selected variable FALSE
|
||||
if the Link Aggregation Group has changed. Since all operational
|
||||
parameters are now set to locally administered values there can be no
|
||||
disagreement as to the Link Aggregation Group, so the Matched variable
|
||||
is set TRUE.
|
||||
|
||||
The relevant description is in the chapter 43.4.12 of the link below:
|
||||
https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=850426
|
||||
|
||||
Signed-off-by: Weifeng Li <liweifeng96@126.com>
|
||||
Acked-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
|
||||
---
|
||||
drivers/net/bonding/eth_bond_8023ad_private.h | 3 +++
|
||||
drivers/net/bonding/rte_eth_bond_8023ad.c | 21 +++++++++++++++++----
|
||||
2 files changed, 20 insertions(+), 4 deletions(-)
|
||||
|
||||
(limited to 'drivers/net/bonding')
|
||||
|
||||
diff --git a/drivers/net/bonding/eth_bond_8023ad_private.h b/drivers/net/bonding/eth_bond_8023ad_private.h
|
||||
index 6e44ffdb1c..9b5738afee 100644
|
||||
--- a/drivers/net/bonding/eth_bond_8023ad_private.h
|
||||
+++ b/drivers/net/bonding/eth_bond_8023ad_private.h
|
||||
@@ -50,6 +50,7 @@
|
||||
#define SM_FLAGS_MOVED 0x0100
|
||||
#define SM_FLAGS_PARTNER_SHORT_TIMEOUT 0x0200
|
||||
#define SM_FLAGS_NTT 0x0400
|
||||
+#define SM_FLAGS_EXPIRED 0x0800
|
||||
|
||||
#define BOND_LINK_FULL_DUPLEX_KEY 0x01
|
||||
#define BOND_LINK_SPEED_KEY_10M 0x02
|
||||
@@ -103,6 +104,8 @@ struct port {
|
||||
|
||||
/** The operational Partner's port parameters */
|
||||
struct port_params partner;
|
||||
+ /** Partner administrative parameter values */
|
||||
+ struct port_params partner_admin;
|
||||
|
||||
/* Additional port parameters not listed in documentation */
|
||||
/** State machine flags */
|
||||
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
|
||||
index b24a446862..67ca0730fa 100644
|
||||
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
|
||||
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
|
||||
@@ -356,16 +356,28 @@ rx_machine(struct bond_dev_private *internals, uint16_t slave_id,
|
||||
|
||||
timer_set(&port->current_while_timer, timeout);
|
||||
ACTOR_STATE_CLR(port, EXPIRED);
|
||||
+ SM_FLAG_CLR(port, EXPIRED);
|
||||
return; /* No state change */
|
||||
}
|
||||
|
||||
/* If CURRENT state timer is not running (stopped or expired)
|
||||
* transit to EXPIRED state from DISABLED or CURRENT */
|
||||
if (!timer_is_running(&port->current_while_timer)) {
|
||||
- ACTOR_STATE_SET(port, EXPIRED);
|
||||
- PARTNER_STATE_CLR(port, SYNCHRONIZATION);
|
||||
- PARTNER_STATE_SET(port, LACP_SHORT_TIMEOUT);
|
||||
- timer_set(&port->current_while_timer, internals->mode4.short_timeout);
|
||||
+ if (SM_FLAG(port, EXPIRED)) {
|
||||
+ port->selected = UNSELECTED;
|
||||
+ memcpy(&port->partner, &port->partner_admin,
|
||||
+ sizeof(struct port_params));
|
||||
+ record_default(port);
|
||||
+ ACTOR_STATE_CLR(port, EXPIRED);
|
||||
+ timer_cancel(&port->current_while_timer);
|
||||
+ } else {
|
||||
+ SM_FLAG_SET(port, EXPIRED);
|
||||
+ ACTOR_STATE_SET(port, EXPIRED);
|
||||
+ PARTNER_STATE_CLR(port, SYNCHRONIZATION);
|
||||
+ PARTNER_STATE_SET(port, LACP_SHORT_TIMEOUT);
|
||||
+ timer_set(&port->current_while_timer,
|
||||
+ internals->mode4.short_timeout);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1021,6 +1033,7 @@ bond_mode_8023ad_activate_slave(struct rte_eth_dev *bond_dev,
|
||||
port->actor.port_number = rte_cpu_to_be_16(slave_id + 1);
|
||||
|
||||
memcpy(&port->partner, &initial, sizeof(struct port_params));
|
||||
+ memcpy(&port->partner_admin, &initial, sizeof(struct port_params));
|
||||
|
||||
/* default states */
|
||||
port->actor_state = STATE_AGGREGATION | STATE_LACP_ACTIVE | STATE_DEFAULTED;
|
||||
--
|
||||
cgit v1.2.1
|
||||
|
||||
|
||||
41
backport-fix-LACP-negotiation.patch
Normal file
41
backport-fix-LACP-negotiation.patch
Normal file
@ -0,0 +1,41 @@
|
||||
From a9cbca743083ace5232e9df90119b4defa7df6e5 Mon Sep 17 00:00:00 2001
|
||||
From: Yicai Lu <luyicai@huawei.com>
|
||||
Date: Fri, 10 Jul 2020 11:29:35 +0800
|
||||
Subject: net/bonding: fix LACP negotiation
|
||||
|
||||
When two host is connected directly without any devices like switch,
|
||||
rx_machine_update would receiving partner LACP negotiation packets,
|
||||
and partner's port mac is filled with zeros in this packet, which is
|
||||
different with internal's mode4 mac. So in this situation, it would
|
||||
never go rx_machine branch and then execute mac swap for negotiation!
|
||||
Thus bond mode 4 will negotiation failed.
|
||||
|
||||
Fixes: 56cbc0817399 ("net/bonding: fix LACP negotiation")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Yicai Lu <luyicai@huawei.com>
|
||||
Reviewed-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
|
||||
---
|
||||
drivers/net/bonding/rte_eth_bond_8023ad.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
(limited to 'drivers/net/bonding')
|
||||
|
||||
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
|
||||
index b7ffa2f2cf..3991825ad9 100644
|
||||
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
|
||||
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
|
||||
@@ -798,7 +798,8 @@ rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id,
|
||||
RTE_ASSERT(lacp->lacpdu.subtype == SLOW_SUBTYPE_LACP);
|
||||
|
||||
partner = &lacp->lacpdu.partner;
|
||||
- if (rte_is_same_ether_addr(&partner->port_params.system,
|
||||
+ if (rte_is_zero_ether_addr(&partner->port_params.system) ||
|
||||
+ rte_is_same_ether_addr(&partner->port_params.system,
|
||||
&internals->mode4.mac_addr)) {
|
||||
/* This LACP frame is sending to the bonding port
|
||||
* so pass it to rx_machine.
|
||||
--
|
||||
cgit v1.2.1
|
||||
|
||||
|
||||
74
backport-fix-LACP-system-address-check.patch
Normal file
74
backport-fix-LACP-system-address-check.patch
Normal file
@ -0,0 +1,74 @@
|
||||
From fad80ab3698e7f7d3e9c2a28c371da6a17fbc477 Mon Sep 17 00:00:00 2001
|
||||
From: Vadim Podovinnikov <podovinnikov@protei.ru>
|
||||
Date: Wed, 17 Feb 2021 16:26:55 +0000
|
||||
Subject: net/bonding: fix LACP system address check
|
||||
|
||||
In bond (LACP) we have several NICs (ports), when we have negotiation
|
||||
with peer about what port we prefer, we send information about what
|
||||
system we preferred in partner system name field. Peer also sends us
|
||||
what partner system name it prefer.
|
||||
|
||||
When we receive a message from it we must compare its preferred system
|
||||
name with our system name, but not with our port mac address
|
||||
|
||||
In my test I have several problems with that:
|
||||
1. If master port (mac address same as system address) shuts down (I
|
||||
have two ports) I loose connection
|
||||
2. If secondary port (mac address not same as system address) receives
|
||||
message before master port, my connection is not established.
|
||||
|
||||
Fixes: 56cbc0817399 ("net/bonding: fix LACP negotiation")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Vadim Podovinnikov <podovinnikov@protei.ru>
|
||||
Acked-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/bonding/rte_eth_bond_8023ad.c | 17 ++++++++++++++++-
|
||||
1 file changed, 16 insertions(+), 1 deletion(-)
|
||||
|
||||
(limited to 'drivers/net/bonding')
|
||||
|
||||
diff --git a/drivers/net/bonding/rte_eth_bond_8023ad.c b/drivers/net/bonding/rte_eth_bond_8023ad.c
|
||||
index 5fe004e551..128754f459 100644
|
||||
--- a/drivers/net/bonding/rte_eth_bond_8023ad.c
|
||||
+++ b/drivers/net/bonding/rte_eth_bond_8023ad.c
|
||||
@@ -804,19 +804,34 @@ rx_machine_update(struct bond_dev_private *internals, uint16_t slave_id,
|
||||
struct rte_mbuf *lacp_pkt) {
|
||||
struct lacpdu_header *lacp;
|
||||
struct lacpdu_actor_partner_params *partner;
|
||||
+ struct port *port, *agg;
|
||||
|
||||
if (lacp_pkt != NULL) {
|
||||
lacp = rte_pktmbuf_mtod(lacp_pkt, struct lacpdu_header *);
|
||||
RTE_ASSERT(lacp->lacpdu.subtype == SLOW_SUBTYPE_LACP);
|
||||
|
||||
partner = &lacp->lacpdu.partner;
|
||||
+ port = &bond_mode_8023ad_ports[slave_id];
|
||||
+ agg = &bond_mode_8023ad_ports[port->aggregator_port_id];
|
||||
+
|
||||
if (rte_is_zero_ether_addr(&partner->port_params.system) ||
|
||||
rte_is_same_ether_addr(&partner->port_params.system,
|
||||
- &internals->mode4.mac_addr)) {
|
||||
+ &agg->actor.system)) {
|
||||
/* This LACP frame is sending to the bonding port
|
||||
* so pass it to rx_machine.
|
||||
*/
|
||||
rx_machine(internals, slave_id, &lacp->lacpdu);
|
||||
+ } else {
|
||||
+ char preferred_system_name[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
+ char self_system_name[RTE_ETHER_ADDR_FMT_SIZE];
|
||||
+
|
||||
+ rte_ether_format_addr(preferred_system_name,
|
||||
+ RTE_ETHER_ADDR_FMT_SIZE, &partner->port_params.system);
|
||||
+ rte_ether_format_addr(self_system_name,
|
||||
+ RTE_ETHER_ADDR_FMT_SIZE, &agg->actor.system);
|
||||
+ MODE4_DEBUG("preferred partner system %s "
|
||||
+ "is not equal with self system: %s\n",
|
||||
+ preferred_system_name, self_system_name);
|
||||
}
|
||||
rte_pktmbuf_free(lacp_pkt);
|
||||
} else
|
||||
--
|
||||
cgit v1.2.1
|
||||
|
||||
|
||||
78
backport-fix-MAC-address-when-one-port-resets.patch
Normal file
78
backport-fix-MAC-address-when-one-port-resets.patch
Normal file
@ -0,0 +1,78 @@
|
||||
From 2d944002762e85e351be7cea432919f159d2ecae Mon Sep 17 00:00:00 2001
|
||||
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
|
||||
Date: Fri, 17 Apr 2020 16:19:18 +0800
|
||||
Subject: net/bonding: fix MAC address when one port resets
|
||||
|
||||
The current bonding PMD driver call mac_address_slaves_update function
|
||||
to modify the MAC address of all slaves devices. In
|
||||
mac_address_slaves_update function, the rte_eth_dev_default_mac_addr_set
|
||||
API function is called to set the MAC address of the slave devices in
|
||||
turn in the for loop statement.
|
||||
|
||||
When one port reset, calling rte_eth_dev_default_mac_addr_set API fails
|
||||
because the firmware will not respond to the commands from the driver,
|
||||
and exit the loop, so other slave devices cannot continue to update the
|
||||
MAC address.
|
||||
|
||||
This patch fixes the issue by avoid exiting the loop when calling
|
||||
rte_eth_dev_default_mac_addr_set fails.
|
||||
|
||||
Fixes: 2efb58cbab6e ("bond: new link bonding library")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
|
||||
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
|
||||
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
|
||||
Signed-off-by: Xuan Li <lixuan47@hisilicon.com>
|
||||
---
|
||||
drivers/net/bonding/rte_eth_bond_pmd.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
(limited to 'drivers/net/bonding')
|
||||
|
||||
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
|
||||
index 6f361c7b2c..116e2f29de 100644
|
||||
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
|
||||
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
|
||||
@@ -1502,6 +1502,7 @@ int
|
||||
mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
|
||||
{
|
||||
struct bond_dev_private *internals = bonded_eth_dev->data->dev_private;
|
||||
+ bool set;
|
||||
int i;
|
||||
|
||||
/* Update slave devices MAC addresses */
|
||||
@@ -1529,6 +1530,7 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
|
||||
case BONDING_MODE_TLB:
|
||||
case BONDING_MODE_ALB:
|
||||
default:
|
||||
+ set = true;
|
||||
for (i = 0; i < internals->slave_count; i++) {
|
||||
if (internals->slaves[i].port_id ==
|
||||
internals->current_primary_port) {
|
||||
@@ -1537,7 +1539,7 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
|
||||
bonded_eth_dev->data->mac_addrs)) {
|
||||
RTE_BOND_LOG(ERR, "Failed to update port Id %d MAC address",
|
||||
internals->current_primary_port);
|
||||
- return -1;
|
||||
+ set = false;
|
||||
}
|
||||
} else {
|
||||
if (rte_eth_dev_default_mac_addr_set(
|
||||
@@ -1545,10 +1547,11 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
|
||||
&internals->slaves[i].persisted_mac_addr)) {
|
||||
RTE_BOND_LOG(ERR, "Failed to update port Id %d MAC address",
|
||||
internals->slaves[i].port_id);
|
||||
- return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
+ if (!set)
|
||||
+ return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
--
|
||||
cgit v1.2.1
|
||||
|
||||
|
||||
88
backport-fix-MAC-address-when-switching-active-port.patch
Normal file
88
backport-fix-MAC-address-when-switching-active-port.patch
Normal file
@ -0,0 +1,88 @@
|
||||
From edf6489ea43ec9c27d54dbe9e94adcdc43b70e04 Mon Sep 17 00:00:00 2001
|
||||
From: "Wei Hu (Xavier)" <xavier.huwei@huawei.com>
|
||||
Date: Fri, 17 Apr 2020 16:19:17 +0800
|
||||
Subject: net/bonding: fix MAC address when switching active port
|
||||
|
||||
Currently, based on a active-backup bond device, when the link status of
|
||||
the primary port changes from up to down, one slave port changes to the
|
||||
primary port, but the new primary port's MAC address cannot change to
|
||||
the bond device's MAC address. And we can't continue receive packets
|
||||
whose destination MAC addresses are the same as the bond devices's MAC
|
||||
address.
|
||||
|
||||
The current bonding PMD driver call mac_address_slaves_update function
|
||||
to modify the MAC address of all slaves devices: the primary port using
|
||||
bond device's MAC address, and other slaves devices using the respective
|
||||
MAC address. We found that one error using primary_port instead of
|
||||
current_primary_port in mac_address_slaves_update function.
|
||||
|
||||
On the other hand, The current bonding PMD driver sets slave devices's
|
||||
MAC address according to the variable named current_primary_port. The
|
||||
variable named current_primary_port changes in the following scenario:
|
||||
1. Add the slave devices to bond, the first slave port will be regarded
|
||||
as the current_primary_port. If changing the order of adding the
|
||||
slave devices, the value of the variable named current_primary_port
|
||||
will be different.
|
||||
2. The upper application specifies primary_port via calling the
|
||||
rte_eth_bond_primary_set API function.
|
||||
3. Delete the primary slave device.
|
||||
4. The link status of the primary port changes from up to down.
|
||||
|
||||
We have tested the above 4 cases and found that there are problems that
|
||||
the new primary port's MAC address didn't change to the bond device's
|
||||
MAC address when running case 3 and 4. When current_primary_port
|
||||
changes, the new primary port's MAC address should change at the same
|
||||
time. We also need to call mac_address_slaves_update function to update
|
||||
MAC addresses in case
|
||||
3 and 4.
|
||||
|
||||
Bugzilla ID: 256
|
||||
Fixes: 2efb58cbab6e ("bond: new link bonding library")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Chunsong Feng <fengchunsong@huawei.com>
|
||||
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
|
||||
---
|
||||
drivers/net/bonding/rte_eth_bond_api.c | 1 +
|
||||
drivers/net/bonding/rte_eth_bond_pmd.c | 3 ++-
|
||||
2 files changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
(limited to 'drivers/net/bonding')
|
||||
|
||||
diff --git a/drivers/net/bonding/rte_eth_bond_api.c b/drivers/net/bonding/rte_eth_bond_api.c
|
||||
index d77dc40963..97c667e007 100644
|
||||
--- a/drivers/net/bonding/rte_eth_bond_api.c
|
||||
+++ b/drivers/net/bonding/rte_eth_bond_api.c
|
||||
@@ -698,6 +698,7 @@ __eth_bond_slave_remove_lock_free(uint16_t bonded_port_id,
|
||||
internals->current_primary_port = internals->slaves[0].port_id;
|
||||
else
|
||||
internals->primary_port = 0;
|
||||
+ mac_address_slaves_update(bonded_eth_dev);
|
||||
}
|
||||
|
||||
if (internals->active_slave_count < 1) {
|
||||
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
|
||||
index 044a1cfbc3..6f361c7b2c 100644
|
||||
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
|
||||
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
|
||||
@@ -1533,7 +1533,7 @@ mac_address_slaves_update(struct rte_eth_dev *bonded_eth_dev)
|
||||
if (internals->slaves[i].port_id ==
|
||||
internals->current_primary_port) {
|
||||
if (rte_eth_dev_default_mac_addr_set(
|
||||
- internals->primary_port,
|
||||
+ internals->current_primary_port,
|
||||
bonded_eth_dev->data->mac_addrs)) {
|
||||
RTE_BOND_LOG(ERR, "Failed to update port Id %d MAC address",
|
||||
internals->current_primary_port);
|
||||
@@ -2873,6 +2873,7 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
|
||||
internals->active_slaves[0]);
|
||||
else
|
||||
internals->current_primary_port = internals->primary_port;
|
||||
+ mac_address_slaves_update(bonded_eth_dev);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
cgit v1.2.1
|
||||
|
||||
|
||||
37
backport-fix-dead-loop-on-RSS-RETA-update.patch
Normal file
37
backport-fix-dead-loop-on-RSS-RETA-update.patch
Normal file
@ -0,0 +1,37 @@
|
||||
From eb8939538fddced05b906c34ba9f545bf6717ad2 Mon Sep 17 00:00:00 2001
|
||||
From: Zhiguang He <hezhiguang3@huawei.com>
|
||||
Date: Sun, 2 Aug 2020 20:27:27 +0800
|
||||
Subject: net/bonding: fix dead loop on RSS RETA update
|
||||
|
||||
When parameter reta_size < RTE_RETA_GROUP_SIZE, reta_count will be 0.
|
||||
Then this function will be deadloop.
|
||||
|
||||
Fixes: 734ce47f71e0 ("bonding: support RSS dynamic configuration")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Zhiguang He <hezhiguang3@huawei.com>
|
||||
Acked-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
|
||||
---
|
||||
drivers/net/bonding/rte_eth_bond_pmd.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
(limited to 'drivers/net/bonding')
|
||||
|
||||
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
|
||||
index 116e2f29de..cdbd8151ed 100644
|
||||
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
|
||||
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
|
||||
@@ -2935,7 +2935,8 @@ bond_ethdev_rss_reta_update(struct rte_eth_dev *dev,
|
||||
return -EINVAL;
|
||||
|
||||
/* Copy RETA table */
|
||||
- reta_count = reta_size / RTE_RETA_GROUP_SIZE;
|
||||
+ reta_count = (reta_size + RTE_RETA_GROUP_SIZE - 1) /
|
||||
+ RTE_RETA_GROUP_SIZE;
|
||||
|
||||
for (i = 0; i < reta_count; i++) {
|
||||
internals->reta_conf[i].mask = reta_conf[i].mask;
|
||||
--
|
||||
cgit v1.2.1
|
||||
|
||||
|
||||
133
backport-fix-promiscuous-and-allmulticast-state.patch
Normal file
133
backport-fix-promiscuous-and-allmulticast-state.patch
Normal file
@ -0,0 +1,133 @@
|
||||
From ac5341f5f9bab7b87b1a71761c40d204a7e6ab86 Mon Sep 17 00:00:00 2001
|
||||
From: "Min Hu (Connor)" <humin29@huawei.com>
|
||||
Date: Fri, 28 Jan 2022 10:25:32 +0800
|
||||
Subject: net/bonding: fix promiscuous and allmulticast state
|
||||
|
||||
Currently, promiscuous or allmulticast state of bonding port will not be
|
||||
passed to the new primary slave when active/standby switch-over. It
|
||||
causes bugs in some scenario.
|
||||
|
||||
For example, promiscuous state of bonding port is off now, primary slave
|
||||
(called A) is off but secondary slave(called B) is on.
|
||||
Then active/standby switch-over, promiscuous state of the bonding port
|
||||
is off, but the new primary slave turns to be B and its promiscuous
|
||||
state is still on.
|
||||
It is not consistent with bonding port. And this patch will fix it.
|
||||
|
||||
Fixes: 2efb58cbab6e ("bond: new link bonding library")
|
||||
Fixes: 68218b87c184 ("net/bonding: prefer allmulti to promiscuous for LACP")
|
||||
Cc: stable@dpdk.org
|
||||
|
||||
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
|
||||
---
|
||||
drivers/net/bonding/rte_eth_bond_pmd.c | 70 ++++++++++++++++++++++++++++++++++
|
||||
1 file changed, 70 insertions(+)
|
||||
|
||||
(limited to 'drivers/net/bonding')
|
||||
|
||||
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
|
||||
index e5abe90e07..d2fcfad676 100644
|
||||
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
|
||||
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
|
||||
@@ -2691,6 +2691,39 @@ bond_ethdev_promiscuous_disable(struct rte_eth_dev *dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static int
|
||||
+bond_ethdev_promiscuous_update(struct rte_eth_dev *dev)
|
||||
+{
|
||||
+ struct bond_dev_private *internals = dev->data->dev_private;
|
||||
+ uint16_t port_id = internals->current_primary_port;
|
||||
+
|
||||
+ switch (internals->mode) {
|
||||
+ case BONDING_MODE_ROUND_ROBIN:
|
||||
+ case BONDING_MODE_BALANCE:
|
||||
+ case BONDING_MODE_BROADCAST:
|
||||
+ case BONDING_MODE_8023AD:
|
||||
+ /* As promiscuous mode is propagated to all slaves for these
|
||||
+ * mode, no need to update for bonding device.
|
||||
+ */
|
||||
+ break;
|
||||
+ case BONDING_MODE_ACTIVE_BACKUP:
|
||||
+ case BONDING_MODE_TLB:
|
||||
+ case BONDING_MODE_ALB:
|
||||
+ default:
|
||||
+ /* As promiscuous mode is propagated only to primary slave
|
||||
+ * for these mode. When active/standby switchover, promiscuous
|
||||
+ * mode should be set to new primary slave according to bonding
|
||||
+ * device.
|
||||
+ */
|
||||
+ if (rte_eth_promiscuous_get(internals->port_id) == 1)
|
||||
+ rte_eth_promiscuous_enable(port_id);
|
||||
+ else
|
||||
+ rte_eth_promiscuous_disable(port_id);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int
|
||||
bond_ethdev_allmulticast_enable(struct rte_eth_dev *eth_dev)
|
||||
{
|
||||
@@ -2804,6 +2837,39 @@ bond_ethdev_allmulticast_disable(struct rte_eth_dev *eth_dev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static int
|
||||
+bond_ethdev_allmulticast_update(struct rte_eth_dev *dev)
|
||||
+{
|
||||
+ struct bond_dev_private *internals = dev->data->dev_private;
|
||||
+ uint16_t port_id = internals->current_primary_port;
|
||||
+
|
||||
+ switch (internals->mode) {
|
||||
+ case BONDING_MODE_ROUND_ROBIN:
|
||||
+ case BONDING_MODE_BALANCE:
|
||||
+ case BONDING_MODE_BROADCAST:
|
||||
+ case BONDING_MODE_8023AD:
|
||||
+ /* As allmulticast mode is propagated to all slaves for these
|
||||
+ * mode, no need to update for bonding device.
|
||||
+ */
|
||||
+ break;
|
||||
+ case BONDING_MODE_ACTIVE_BACKUP:
|
||||
+ case BONDING_MODE_TLB:
|
||||
+ case BONDING_MODE_ALB:
|
||||
+ default:
|
||||
+ /* As allmulticast mode is propagated only to primary slave
|
||||
+ * for these mode. When active/standby switchover, allmulticast
|
||||
+ * mode should be set to new primary slave according to bonding
|
||||
+ * device.
|
||||
+ */
|
||||
+ if (rte_eth_allmulticast_get(internals->port_id) == 1)
|
||||
+ rte_eth_allmulticast_enable(port_id);
|
||||
+ else
|
||||
+ rte_eth_allmulticast_disable(port_id);
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void
|
||||
bond_ethdev_delayed_lsc_propagation(void *arg)
|
||||
{
|
||||
@@ -2893,6 +2959,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
|
||||
lsc_flag = 1;
|
||||
|
||||
mac_address_slaves_update(bonded_eth_dev);
|
||||
+ bond_ethdev_promiscuous_update(bonded_eth_dev);
|
||||
+ bond_ethdev_allmulticast_update(bonded_eth_dev);
|
||||
}
|
||||
|
||||
activate_slave(bonded_eth_dev, port_id);
|
||||
@@ -2922,6 +2990,8 @@ bond_ethdev_lsc_event_callback(uint16_t port_id, enum rte_eth_event_type type,
|
||||
else
|
||||
internals->current_primary_port = internals->primary_port;
|
||||
mac_address_slaves_update(bonded_eth_dev);
|
||||
+ bond_ethdev_promiscuous_update(bonded_eth_dev);
|
||||
+ bond_ethdev_allmulticast_update(bonded_eth_dev);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
cgit v1.2.1
|
||||
|
||||
|
||||
14
dpdk.spec
14
dpdk.spec
@ -1,6 +1,6 @@
|
||||
Name: dpdk
|
||||
Version: 19.11
|
||||
Release: 31
|
||||
Release: 32
|
||||
Packager: packaging@6wind.com
|
||||
URL: http://dpdk.org
|
||||
%global source_version 19.11
|
||||
@ -67,6 +67,15 @@ Patch6014: backport-fix-dedicated-queue-mode-in-vector-burst.patch
|
||||
Patch9001: 0001-pdump-fix-pcap_dump-coredump-caused-by-incorrect-pkt_len.patch
|
||||
Patch9002: 0002-gro-fix-gro-with-tcp-push-flag.patch
|
||||
|
||||
Patch6015: backport-fix-LACP-negotiation.patch
|
||||
Patch6016: backport-fix-MAC-address-when-switching-active-port.patch
|
||||
Patch6017: backport-fix-MAC-address-when-one-port-resets.patch
|
||||
Patch6018: backport-change-state-machine-to-defaulted.patch
|
||||
Patch6019: backport-fix-dead-loop-on-RSS-RETA-update.patch
|
||||
Patch6020: backport-fix-LACP-system-address-check.patch
|
||||
Patch6021: backport-fix-promiscuous-and-allmulticast-state.patch
|
||||
|
||||
|
||||
Summary: Data Plane Development Kit core
|
||||
Group: System Environment/Libraries
|
||||
License: BSD and LGPLv2 and GPLv2
|
||||
@ -231,6 +240,9 @@ strip -g $RPM_BUILD_ROOT/lib/modules/${namer}/extra/dpdk/rte_kni.ko
|
||||
/usr/sbin/depmod
|
||||
|
||||
%changelog
|
||||
* Mon Sep 25 2023 zhujunhao <zhujunhao11@huawei.com> - 19.11-32
|
||||
- backport bond patch
|
||||
|
||||
* Fri Jun 30 2023 jiangheng <jiangheng14@huawei.com> - 19.11-31
|
||||
- remove gazelle-proc-info, it function the same as gazellectl -x
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user