[PATCH dev-5.6 3/3] net/ncsi: Add NC-SI 1.2 Get MC MAC Address command

Ivan Mikhaylov fr0st61te at gmail.com
Fri Dec 8 18:25:26 AEDT 2023


On Thu, 2023-12-07 at 06:16 -0600, Patrick Williams wrote:
> On Thu, Dec 07, 2023 at 10:44:05AM +0300, Ivan Mikhaylov wrote:
> > On Wed, 2023-12-06 at 22:17 -0600, Patrick Williams wrote:
> > > On Thu, Dec 07, 2023 at 12:23:38AM +0300, Ivan Mikhaylov wrote:
> > > > 
> > > > 
> > > > Patrick, I've the fix about ndo_set_mac_address not so long in
> > > > the
> > > > past
> > > > https://lore.kernel.org/all/20230828101151.684010399@linuxfoundation.org/
> > > > 
> > > > ndo_set_mac_address do not notify network layer about mac
> > > > change.
> > > 
> > > Hello Ivan,
> > > 
> > > I think you're suggesting there is a bug in the code that was
> > > applied
> > > to
> > > net-next here?  If so, we'll need to get a fix into net-next. 
> > > These
> > > commits are just a backport request to the OpenBMC tree of the
> > > code
> > > that
> > > was already applied to net-next.
> > > 
> > 
> > Patrick, yes, there is a bug, I'll write to the thread
> > today/tomorrow
> > with that commit about that problem. Need to think how to make a
> > fix
> > for this problem, reverting and make it right until it in net-next
> > or
> > fix above that commit.
> 
> Is this the fix?
> 
> diff --git a/net/ncsi/ncsi-rsp.c b/net/ncsi/ncsi-rsp.c
> index bee290d0f48b..b02e663e56dc 100644
> --- a/net/ncsi/ncsi-rsp.c
> +++ b/net/ncsi/ncsi-rsp.c
> @@ -1115,7 +1115,9 @@ static int ncsi_rsp_handler_gmcma(struct
> ncsi_request *nr)
>  
>         for (i = 0; i < rsp->address_count; i++) {
>                 memcpy(saddr.sa_data, &rsp->addresses[i], ETH_ALEN);
> -               ret = ndev->netdev_ops->ndo_set_mac_address(ndev,
> &saddr);
> +               rtnl_lock();
> +               ret = dev_set_mac_address(ndev, &saddr, NULL);
> +               rtnl_unlock();
>                 if (ret < 0) {
>                         netdev_warn(ndev, "NCSI: Unable to assign %pM
> to device\n",
>                                     saddr.sa_data);
> 

Patrick, yes, this is the fix. Difference in calling of
call_netdevice_notifiers from dev_set_mac_address to make sure that
everybody aware about mac change which using this interface.

Thanks.


More information about the openbmc mailing list