DPDK patches and discussions
 help / color / mirror / Atom feed
From: Chas Williams <3chas3@gmail.com>
To: Radu Nicolau <radu.nicolau@intel.com>
Cc: dev@dpdk.org, Declan Doherty <declan.doherty@intel.com>,
	 Ferruh Yigit <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] [PATCH v3] net/bonding: fix slave add for mode 4
Date: Thu, 31 May 2018 20:05:17 -0400	[thread overview]
Message-ID: <CAG2-Gkn-Qtsbb_zPQr4jUT+p53yU8a=UVpGNiz9DO8sE+TSOBQ@mail.gmail.com> (raw)
In-Reply-To: <1527783047-18201-1-git-send-email-radu.nicolau@intel.com>

It's not clear to me that the issue here is the bonding slave add.
You can only add started PMDs.  When a PMD dev start is complete,
the PMD should have a valid link state and the link properties should be
valid.  A few of the PMDs are very good about this, particularly the
ones with LSC interrupts.  Those drivers often wait for the first
link interrupt before setting their link status.  So there is a
race where the link state isn't well defined.

And lastly, why do we care what the link state is when adding a
slave?  If the link state changes to down, do we remove the slave?
If the link speed of the slave changes, do we remove the slave?
So this test doesn't make much sense.  For mode 4, you should be
able to add a slave, but if the link state doesn't match what
has been negotiated, then the slave should fail to activate.

On Thu, May 31, 2018 at 12:10 PM, Radu Nicolau <radu.nicolau@intel.com>
wrote:
>
> Add a call to rte_eth_link_get_nowait on every slave to update
> the internal link status struct. Otherwise slave add will fail
> for mode 4 if the ports are all stopped but only one of them checked.
>
> Fixes: b77d21cc2364 ("ethdev: add link status get/set helper functions")
> Bugzilla ID: 52
>
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---
> v3: updated commit msg
> v2: add fix and Bugzilla references
>
>  drivers/net/bonding/rte_eth_bond_api.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/bonding/rte_eth_bond_api.c
b/drivers/net/bonding/rte_eth_bond_api.c
> index d558df8..cad08b9 100644
> --- a/drivers/net/bonding/rte_eth_bond_api.c
> +++ b/drivers/net/bonding/rte_eth_bond_api.c
> @@ -296,6 +296,8 @@ __eth_bond_slave_add_lock_free(uint16_t
bonded_port_id, uint16_t slave_port_id)
>                 return -1;
>         }
>
> +       rte_eth_link_get_nowait(slave_port_id, &link_props);
> +
>         slave_add(internals, slave_eth_dev);
>
>         /* We need to store slaves reta_size to be able to synchronize
RETA for all
> --
> 2.7.5
>

  reply	other threads:[~2018-06-01  0:05 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-09 12:06 [dpdk-dev] [PATCH] net/bonding: update link status on slave add Radu Nicolau
2018-05-31 14:07 ` Ferruh Yigit
2018-05-31 16:10 ` [dpdk-dev] [PATCH v3] net/bonding: fix slave add for mode 4 Radu Nicolau
2018-06-01  0:05   ` Chas Williams [this message]
2018-06-01  9:59     ` Radu Nicolau
2018-06-01 10:05 ` [dpdk-dev] [PATCH v4] " Radu Nicolau
2018-06-02 21:23   ` Chas Williams
2018-07-18 13:21 ` [dpdk-dev] [PATCH v5] " Radu Nicolau
2018-08-02 13:42   ` Doherty, Declan
2018-08-05  0:15     ` Thomas Monjalon

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='CAG2-Gkn-Qtsbb_zPQr4jUT+p53yU8a=UVpGNiz9DO8sE+TSOBQ@mail.gmail.com' \
    --to=3chas3@gmail.com \
    --cc=declan.doherty@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=radu.nicolau@intel.com \
    /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).