Netdev List
 help / color / mirror / Atom feed
From: Heiner Kallweit <hkallweit1@gmail.com>
To: Corinna Vinschen <vinschen@redhat.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: Regression introduced by "r8169: simplify rtl_set_mac_address"
Date: Mon, 2 Jul 2018 22:35:18 +0200	[thread overview]
Message-ID: <c969c5f7-b613-7a1b-774d-22a7dce4a51d@gmail.com> (raw)
In-Reply-To: <20180702194812.GG3111@calimero.vinschen.de>

On 02.07.2018 21:48, Corinna Vinschen wrote:
> Hi,
> 
> the patch 1f7aa2bc268e, "r8169: simplify rtl_set_mac_address",
> introduced a regression found by trying to team a r8169 NIC.
> 
Thanks for reporting!

> Try the following (assuming the r8169 NIC is eth0):
> 
> $ nmcli con add type team con-name team0 ifname nm-team config \
>   '{"runner": {"name": "lacp"}, "link_watch": {"name": "ethtool"}}' \
>   ipv4.method disable ipv6.method ignore
> $ nmcli con add type ethernet ifname eth0 con-name team0.0 master nm-team
> $ nmcli con up team0.0
> $ teamdctl nm-team port present eth0
> command call failed (No such device)
> 
> Bisecting turned up commit 1f7aa2bc268e, "r8169: simplify
> rtl_set_mac_address" as the culprit.  Reverting this patch fixes
> the issue and the teamdctl call succeeds.
> 
> The reason is apparently the usage of eth_mac_addr here.  eth_mac_addr
> calls eth_prepare_mac_addr_change which checks for IFF_LIVE_ADDR_CHANGE.
> Debugging shows this flag not being set on r8169, thus
> eth_prepare_mac_addr_change returns -EBUSY (no idea why userspace claims
> "No such device", rather than "Device or resource busy", but that's not
> the point here).
> 
> Note that other devices like igb, don't call eth_mac_addr either, but
> rather call memcpy by themselves to copy the new MAC, just as the
> original r8169 code did, too.  Consequentially this problem is not
> present on igb.
> 
Doing the memcpy directly in the driver (like it was before) would be
a solution, however I'd consider this more a workaround because purpose
of the core functions is to encapsulate such details.

> I suggest to revert this change in the first place, but I wonder if
> we're not just missing to set IFF_LIVE_ADDR_CHANGE in a lot of drivers.
> 
I'd prefer to keep the code and set flag IFF_LIVE_ADDR_CHANGE in the
driver. Setting this flag via ethtool --set-priv-flags in theory would
also be an option, however the r8169 driver doesn't implement the
ethtool_ops set_priv_flags callback.

> 
> Thanks,
> Corinna
> 
Rgds, Heiner

      reply	other threads:[~2018-07-02 20:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-02 19:48 Regression introduced by "r8169: simplify rtl_set_mac_address" Corinna Vinschen
2018-07-02 20:35 ` Heiner Kallweit [this message]

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=c969c5f7-b613-7a1b-774d-22a7dce4a51d@gmail.com \
    --to=hkallweit1@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vinschen@redhat.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