Skip to contentSkip to conversation

fix lacp check system address

PATCH In review Vadim 3 participants 13 messages Nov 26, 2019 – Mar 5, 2021 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Vadim

author
#1 lore raw

PATCH v2 1/1 fix lacp check system address

fix lacp check system address

---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_8023ad.c +16 -1
index b77a37ddb..d4dda790a 100644
@@ -792,18 +792,33 @@ 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_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 not equal "
+						"self system: %s\n",
+				preferred_system_name, self_system_name);
 		}
 		rte_pktmbuf_free(lacp_pkt);
 	} else
Signature · 1 line
2.24.0
#2 lore raw

Hi Vadim,

Quoted 1 line · Vadim

Can you please provide full "Name Surname <email@adress>" signature?

This is bonding patch, please cc bonding maintainers (Chas, instead of John W. Linville).

Quoted 2 lines

fix lacp check system address

Can you please give more details, what is failing what is the impact etc.

Quoted 45 lines
---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_8023ad.c +16 -1
index b77a37ddb..d4dda790a 100644
@@ -792,18 +792,33 @@ 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_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 not equal "
+						"self system: %s\n",
+				preferred_system_name, self_system_name);
 		}
 		rte_pktmbuf_free(lacp_pkt);
 	} else
#3 lore raw

Hi Ferruh

Quoted 2 lines

This is bonding patch, please cc bonding maintainers (Chas, instead of John W. Linville).

Sorry about that. I have 2 patches ( one for af packet, one for bonding).

I am a little confused.

Quoted 1 line

Can you please give more details, what is failing what is the impact etc.

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.

26.11.2019 16:27, Ferruh Yigit пишет:

Quoted 57 lines

Hi Vadim,

Quoted 1 line · Vadim

Can you please provide full "Name Surname <email@adress>" signature?

This is bonding patch, please cc bonding maintainers (Chas, instead of John W. Linville).

Quoted 1 line

fix lacp check system address

Can you please give more details, what is failing what is the impact etc.

Quoted 44 lines
---
  drivers/net/bonding/rte_eth_bond_8023ad.c | 17 ++++++++++++++++-
  1 file changed, 16 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_8023ad.c +16 -1
index b77a37ddb..d4dda790a 100644
@@ -792,18 +792,33 @@ 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_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 not equal "
+						"self system: %s\n",
+				preferred_system_name, self_system_name);
  		}
  		rte_pktmbuf_free(lacp_pkt);
  	} else
#4 lore raw
Quoted 26 lines · podovinnikov

Hi Ferruh

Quoted 2 lines

This is bonding patch, please cc bonding maintainers (Chas, instead of John W. Linville).

Sorry about that. I have 2 patches ( one for af packet, one for bonding).

I am a little confused.

Quoted 1 line

Can you please give more details, what is failing what is the impact etc.

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

Quoted 7 lines

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.

Hi Vadim,

Thanks for the info and sorry for late response, it is sitting in backlog for a long time now.

@Chas, do you have any objection on the fix, if not I am planning to merge it soon.

Thanks,
ferruh

Quoted 60 lines

26.11.2019 16:27, Ferruh Yigit пишет:

Quoted 57 lines

Hi Vadim,

Quoted 1 line · Vadim

Can you please provide full "Name Surname <email@adress>" signature?

This is bonding patch, please cc bonding maintainers (Chas, instead of John W. Linville).

Quoted 1 line

fix lacp check system address

Can you please give more details, what is failing what is the impact etc.

Quoted 44 lines
---
  drivers/net/bonding/rte_eth_bond_8023ad.c | 17 ++++++++++++++++-
  1 file changed, 16 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_8023ad.c +16 -1
index b77a37ddb..d4dda790a 100644
@@ -792,18 +792,33 @@ 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_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 not equal "
+						"self system: %s\n",
+				preferred_system_name, self_system_name);
  		}
  		rte_pktmbuf_free(lacp_pkt);
  	} else
#5 lore raw
Quoted 37 lines · Ferruh Yigit
Quoted 26 lines · podovinnikov

Hi Ferruh

Quoted 2 lines

This is bonding patch, please cc bonding maintainers (Chas, instead of John W. Linville).

Sorry about that. I have 2 patches ( one for af packet, one for bonding).

I am a little confused.

Quoted 1 line

Can you please give more details, what is failing what is the impact etc.

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

Quoted 7 lines

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.

Hi Vadim,

Quoted 7 lines

Thanks for the info and sorry for late response, it is sitting in backlog for a long time now.

@Chas, do you have any objection on the fix, if not I am planning to merge it soon.

Thanks,
ferruh

cc'ed Xavier, he also has a bonding patch in the backlog waiting for review [1].

Vadim, Xavier,

Since you both send bonding patches, I assume you both know about bonding at some level, at least more than me, so would you mind reviewing eachother's patch? So both can go it.

Thanks,
ferruh

[1]
https://patchwork.dpdk.org/user/todo/dpdk/?series=8679

Quoted 62 lines
Quoted 61 lines

26.11.2019 16:27, Ferruh Yigit пишет:

Quoted 57 lines

Hi Vadim,

Quoted 1 line · Vadim

Can you please provide full "Name Surname <email@adress>" signature?

This is bonding patch, please cc bonding maintainers (Chas, instead of John W. Linville).

Quoted 1 line

fix lacp check system address

Can you please give more details, what is failing what is the impact etc.

Quoted 44 lines
---
  drivers/net/bonding/rte_eth_bond_8023ad.c | 17 ++++++++++++++++-
  1 file changed, 16 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_8023ad.c +16 -1
index b77a37ddb..d4dda790a 100644
@@ -792,18 +792,33 @@ 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_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 not equal "
+						"self system: %s\n",
+				preferred_system_name, self_system_name);
  		}
  		rte_pktmbuf_free(lacp_pkt);
  	} else
#6 lore raw
Quoted 46 lines · Ferruh Yigit
Quoted 37 lines · Ferruh Yigit
Quoted 26 lines · podovinnikov

Hi Ferruh

Quoted 2 lines

This is bonding patch, please cc bonding maintainers (Chas, instead of John W. Linville).

Sorry about that. I have 2 patches ( one for af packet, one for bonding).

I am a little confused.

Quoted 1 line

Can you please give more details, what is failing what is the impact etc.

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

Quoted 7 lines

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.

Hi Vadim,

Quoted 7 lines

Thanks for the info and sorry for late response, it is sitting in backlog for a long time now.

@Chas, do you have any objection on the fix, if not I am planning to merge it soon.

Thanks,
ferruh

Quoted 8 lines

cc'ed Xavier, he also has a bonding patch in the backlog waiting for review [1].

Vadim, Xavier,

Since you both send bonding patches, I assume you both know about bonding at some level, at least more than me, so would you mind reviewing eachother's patch? So both can go it.

+ other email address of the Xavier.

Quoted 71 lines

Thanks,
ferruh

[1]
https://patchwork.dpdk.org/user/todo/dpdk/?series=8679

Quoted 62 lines
Quoted 61 lines

26.11.2019 16:27, Ferruh Yigit пишет:

Quoted 57 lines

Hi Vadim,

Quoted 1 line · Vadim

Can you please provide full "Name Surname <email@adress>" signature?

This is bonding patch, please cc bonding maintainers (Chas, instead of John W. Linville).

Quoted 1 line

fix lacp check system address

Can you please give more details, what is failing what is the impact etc.

Quoted 44 lines
---
  drivers/net/bonding/rte_eth_bond_8023ad.c | 17 ++++++++++++++++-
  1 file changed, 16 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_8023ad.c +16 -1
index b77a37ddb..d4dda790a 100644
@@ -792,18 +792,33 @@ 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_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 not equal "
+						"self system: %s\n",
+				preferred_system_name, self_system_name);
  		}
  		rte_pktmbuf_free(lacp_pkt);
  	} else
#7 lore raw

Hi Ferruh!

Unfortunately I didn't see any patch from this link

https://patchwork.dpdk.org/user/todo/dpdk/?series=8679

10.04.2020 13:24, Ferruh Yigit пишет:

Quoted 120 lines · Ferruh Yigit
Quoted 43 lines · Ferruh Yigit
Quoted 35 lines · podovinnikov
Quoted 25 lines

Hi Ferruh

Quoted 2 lines

This is bonding patch, please cc bonding maintainers (Chas, instead of John W. Linville).

Sorry about that. I have 2 patches ( one for af packet, one for bonding).

I am a little confused.

Quoted 1 line

Can you please give more details, what is failing what is the impact etc.

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

Quoted 7 lines

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.

Hi Vadim,

Quoted 7 lines

Thanks for the info and sorry for late response, it is sitting in backlog for a long time now.

@Chas, do you have any objection on the fix, if not I am planning to merge it soon.

Thanks,
ferruh

Quoted 8 lines

cc'ed Xavier, he also has a bonding patch in the backlog waiting for review [1].

Vadim, Xavier,

Since you both send bonding patches, I assume you both know about bonding at some level, at least more than me, so would you mind reviewing eachother's patch? So both can go it.

+ other email address of the Xavier.

Quoted 66 lines

Thanks,
ferruh

[1]
https://patchwork.dpdk.org/user/todo/dpdk/?series=8679

Quoted 59 lines
Quoted 59 lines

26.11.2019 16:27, Ferruh Yigit пишет:

Quoted 57 lines

Hi Vadim,

Quoted 1 line · Vadim

Can you please provide full "Name Surname <email@adress>" signature?

This is bonding patch, please cc bonding maintainers (Chas, instead of John W. Linville).

Quoted 1 line

fix lacp check system address

Can you please give more details, what is failing what is the impact etc.

Quoted 44 lines
---
   drivers/net/bonding/rte_eth_bond_8023ad.c | 17 ++++++++++++++++-
   1 file changed, 16 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_8023ad.c +16 -1
index b77a37ddb..d4dda790a 100644
@@ -792,18 +792,33 @@ 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_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 not equal "
+						"self system: %s\n",
+				preferred_system_name, self_system_name);
   		}
   		rte_pktmbuf_free(lacp_pkt);
   	} else
#8 lore raw
Quoted 5 lines · podovinnikov

Hi Ferruh!

Unfortunately I didn't see any patch from this link

https://patchwork.dpdk.org/user/todo/dpdk/?series=8679

It is archived, there is a new version of that patchset, can you please check it:
https://patches.dpdk.org/project/dpdk/list/?series=9456

Thanks,
ferruh

Quoted 122 lines

10.04.2020 13:24, Ferruh Yigit пишет:

Quoted 120 lines · Ferruh Yigit
Quoted 43 lines · Ferruh Yigit
Quoted 35 lines · podovinnikov
Quoted 25 lines

Hi Ferruh

Quoted 2 lines

This is bonding patch, please cc bonding maintainers (Chas, instead of John W. Linville).

Sorry about that. I have 2 patches ( one for af packet, one for bonding).

I am a little confused.

Quoted 1 line

Can you please give more details, what is failing what is the impact etc.

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

Quoted 7 lines

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.

Hi Vadim,

Quoted 7 lines

Thanks for the info and sorry for late response, it is sitting in backlog for a long time now.

@Chas, do you have any objection on the fix, if not I am planning to merge it soon.

Thanks,
ferruh

Quoted 8 lines

cc'ed Xavier, he also has a bonding patch in the backlog waiting for review [1].

Vadim, Xavier,

Since you both send bonding patches, I assume you both know about bonding at some level, at least more than me, so would you mind reviewing eachother's patch? So both can go it.

+ other email address of the Xavier.

Quoted 66 lines

Thanks,
ferruh

[1]
https://patchwork.dpdk.org/user/todo/dpdk/?series=8679

Quoted 59 lines
Quoted 59 lines

26.11.2019 16:27, Ferruh Yigit пишет:

Quoted 57 lines

Hi Vadim,

Quoted 1 line · Vadim

Can you please provide full "Name Surname <email@adress>" signature?

This is bonding patch, please cc bonding maintainers (Chas, instead of John W. Linville).

Quoted 1 line

fix lacp check system address

Can you please give more details, what is failing what is the impact etc.

Quoted 44 lines
---
   drivers/net/bonding/rte_eth_bond_8023ad.c | 17 ++++++++++++++++-
   1 file changed, 16 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_8023ad.c +16 -1
index b77a37ddb..d4dda790a 100644
@@ -792,18 +792,33 @@ 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_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 not equal "
+						"self system: %s\n",
+				preferred_system_name, self_system_name);
   		}
   		rte_pktmbuf_free(lacp_pkt);
   	} else
#9 lore raw

PATCH v3 1/1 net/bonding: fix LACP system address check

In reply to Vadim

From: Vadim Podovinnikov <[email protected]>

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: [email protected]
Cc: Declan Doherty <[email protected]>

v3: Re-sent with rebase
* Patch title updated, commit log updated with info shared in email
* Sign-off updated with full name
* Debug log slightly updated
* Syntax slightly updated

---
 drivers/net/bonding/rte_eth_bond_8023ad.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_8023ad.c +16 -1
index 5fe004e551de..128754f4595a 100644
@@ -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
Signature · 1 line
2.29.2
#10 lore raw

Re: [dpdk-dev] [PATCH v3] net/bonding: fix LACP system address check

Quoted 24 lines · Ferruh Yigit

From: Vadim Podovinnikov <[email protected]>

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: [email protected]
Cc: Declan Doherty <[email protected]>

Quoted 5 lines

v3: Re-sent with rebase
* Patch title updated, commit log updated with info shared in email
* Sign-off updated with full name
* Debug log slightly updated
* Syntax slightly updated

This patch is waiting for review for a long time, if there is no objection I am planning to get it early in the release to give it a time to fix any possible issues.

#11 lore raw

Re: [dpdk-dev] [PATCH v3] net/bonding: fix LACP system address check

Quoted 25 lines · Ferruh Yigit
Quoted 24 lines · Ferruh Yigit

From: Vadim Podovinnikov <[email protected]>

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: [email protected]
Cc: Declan Doherty <[email protected]>

Quoted 7 lines
Quoted 5 lines

v3: Re-sent with rebase
* Patch title updated, commit log updated with info shared in email
* Sign-off updated with full name
* Debug log slightly updated
* Syntax slightly updated

This patch is waiting for review for a long time, if there is no objection I am planning to get it early in the release to give it a time to fix any possible issues.

Chas, Connor, any comment?

Acked-by on v3 1/1
#12 lore raw

Re: [dpdk-dev] [PATCH v3] net/bonding: fix LACP system address check

In reply to Ferruh Yigit
Quoted 74 lines · Ferruh Yigit

From: Vadim Podovinnikov <[email protected]>

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: [email protected]
Cc: Declan Doherty <[email protected]>

v3: Re-sent with rebase
* Patch title updated, commit log updated with info shared in email
* Sign-off updated with full name
* Debug log slightly updated
* Syntax slightly updated

---
  drivers/net/bonding/rte_eth_bond_8023ad.c | 17 ++++++++++++++++-
  1 file changed, 16 insertions(+), 1 deletion(-)
drivers/net/bonding/rte_eth_bond_8023ad.c +16 -1
index 5fe004e551de..128754f4595a 100644
@@ -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
Applied
#13 lore raw

Re: [dpdk-dev] [PATCH v3] net/bonding: fix LACP system address check

Quoted 17 lines · Min Hu (Connor)
Quoted 16 lines · Ferruh Yigit

From: Vadim Podovinnikov <[email protected]>

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.

Quoted 7 lines
Quoted 4 lines
Fixes 56cbc0817399 ("net/bonding: fix LACP negotiation")

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