DPDK patches and discussions
 help / color / mirror / Atom feed
From: bugzilla@dpdk.org
To: dev@dpdk.org
Subject: [dpdk-dev] [Bug 256] Transmit or receive packets use the bond MAC is failed when switch backup port to active
Date: Thu, 18 Apr 2019 02:13:05 +0000	[thread overview]
Message-ID: <bug-256-3@http.bugs.dpdk.org/> (raw)
Message-ID: <20190418021305.Mt6coTapePZemNuNJfpZQput_j8kyJXXcDwbgmqrDko@z> (raw)

https://bugs.dpdk.org/show_bug.cgi?id=256

            Bug ID: 256
           Summary: Transmit or receive packets use the bond MAC is failed
                    when switch backup port to active
           Product: DPDK
           Version: 18.11
          Hardware: All
                OS: All
            Status: CONFIRMED
          Severity: major
          Priority: Normal
         Component: ethdev
          Assignee: dev@dpdk.org
          Reporter: fengchunsong@huawei.com
  Target Milestone: ---

1.Problem Description

Create a active-backup bond device, when primary port link down,slave port
changes to primary,but new primary mac is not change to the bonding MAC.

Transmit or receive packets use the bond MAC is failed.



2.analyze

The bonding pmd call mac_address_slaves_update to modify the MAC of all
slaves:the primary use bond mac addrs, and other slaves to use the slave's MAC.

The code is incorrect using primary_port instead of current_primary_port.

diff --git a/dpdk-18.11.0/drivers/net/bonding/rte_eth_bond_pmd.c
b/dpdk-18.11.0/drivers/net/bonding/rte_eth_bond_pmd.c

index 44deaf1..1c5bc2d 100644

--- a/dpdk-18.11.0/drivers/net/bonding/rte_eth_bond_pmd.c

+++ b/dpdk-18.11.0/drivers/net/bonding/rte_eth_bond_pmd.c

@@ -1627,7 +1627,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);





Bonding pmd sets slave's mac according to current_primary_port. The
current_primary_port changes in the following scenario:

1. add slave to bond, the first slave will set the current_primary_port, change
the order of adding the slave, current_primary_port will be different.

2. The user specifies primary_port via rte_eth_bond_primary_set

3. delete the primary slave

4

-- 
You are receiving this mail because:
You are the assignee for the bug.

             reply	other threads:[~2019-04-18  2:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18  2:13 bugzilla [this message]
2019-04-18  2:13 ` bugzilla

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=bug-256-3@http.bugs.dpdk.org/ \
    --to=bugzilla@dpdk.org \
    --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).