All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	markb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH rdma-next] IB/IPoIB: Allow setting the device address
Date: Wed, 4 May 2016 12:41:05 -0600	[thread overview]
Message-ID: <20160504184105.GB20554@obsidianresearch.com> (raw)
In-Reply-To: <1462340207-16174-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

On Wed, May 04, 2016 at 08:36:47AM +0300, Leon Romanovsky wrote:
> +static int ipoib_set_mac(struct net_device *dev, void *addr)
> +{
> +	struct ipoib_dev_priv *priv = netdev_priv(dev);
> +	struct sockaddr_storage *ss = addr;
> +
> +	set_base_guid(priv, (union ib_gid *)(ss->__data + 4), 0);

Hurm, this should also check that the QPN and reserved in the provided
20 byte LLADDR match the current state of the device's LLADDR since
those cannot be changed.

It is should also be illegal to try and change the GID prefix, so it
must also match the current value.

Did these checks from eth_prepare_mac_addr_change get included?

         if (!(dev->priv_flags & IFF_LIVE_ADDR_CHANGE) && netif_running(dev))
                 return -EBUSY;

As well as basic sanity checks on the formation of GUID - can't be 0,
and must be unicast.

> +	if (test_bit(IPOIB_FLAG_DEV_ADDR_SET, &priv->flags)) {
> +		priv->local_gid.global.subnet_prefix =
> +			cpu_to_be64(port_attr.subnet_prefix);
> +		memcpy(dev->dev_addr + 4, priv->local_gid.raw,
> +		       sizeof(union ib_gid));

Seems strange - why is the subnet prefix being treated differently in
this one case?

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2016-05-04 18:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-04  5:36 [PATCH rdma-next] IB/IPoIB: Allow setting the device address Leon Romanovsky
     [not found] ` <1462340207-16174-1-git-send-email-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2016-05-04 18:41   ` Jason Gunthorpe [this message]
     [not found]     ` <20160504184105.GB20554-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-05-10 15:26       ` Mark Bloch
     [not found]         ` <VI1PR05MB1391263ABAC5F4892DBD69E9D2710-79XLn2atqDP8GeyK7vyn2tqRiQSDpxhJvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2016-05-13 16:45           ` Jason Gunthorpe
     [not found]             ` <20160513164548.GA27209-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2016-05-15 12:24               ` Mark Bloch

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=20160504184105.GB20554@obsidianresearch.com \
    --to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=markb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=matanb-VPRAkNaXOzVWk0Htik3J/w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.