From: Jason Gunthorpe <jgunthorpe-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
To: Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Cc: Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Tal Alon <talal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Amir Vadai <amirv-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
Jack Morgenstein
<jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Subject: Re: [PATCH for-next 3/9] net/mlx4_core: Set initial admin GUIDs for VFs
Date: Mon, 30 Mar 2015 11:16:31 -0600 [thread overview]
Message-ID: <20150330171631.GA1152@obsidianresearch.com> (raw)
In-Reply-To: <1427637093-6711-4-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
On Sun, Mar 29, 2015 at 04:51:27PM +0300, Or Gerlitz wrote:
> +void mlx4_set_random_admin_guid(struct mlx4_dev *dev, int entry, int port)
> +{
> + struct mlx4_priv *priv = mlx4_priv(dev);
> + u8 random_mac[6];
> + char *raw_gid;
> +
> + /* hw GUID */
> + if (entry == 0)
> + return;
> +
> + eth_random_addr(random_mac);
> + raw_gid = (char *)&priv->mfunc.master.vf_admin[entry].vport[port].guid;
raw_gid is actually a guid
> + raw_gid[0] = random_mac[0] ^ 2;
eth_random_addr already guarentees the ULA bit is set to one (local),
so this is wrong. IBA uses the EUI-64 system, not the IPv6
modification.
> + raw_gid[1] = random_mac[1];
> + raw_gid[2] = random_mac[2];
> + raw_gid[3] = 0xff;
> + raw_gid[4] = 0xfe;
This should be 0xff for mapping a MAC to a EUI-64
But, it doesn't really make sense to use eth_random_addr (which
doesn't have a special OUI) and not randomize every bit.
get_random_bytes(&guid, sizeof(guid));
guid &= ~(1ULL << 56);
guid |= 1ULL << 57;
I also don't think the kernel should be generating random GUIDs. Either
the SA should be consulted to do this, or the management stack should
generate a cloud wide unique number.
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
next prev parent reply other threads:[~2015-03-30 17:16 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-29 13:51 [PATCH for-next 0/9] mlx4 changes in virtual GID management Or Gerlitz
[not found] ` <1427637093-6711-1-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-03-29 13:51 ` [PATCH for-next 1/9] IB/mlx4: Alias GUID adding persistency support Or Gerlitz
2015-03-29 13:51 ` [PATCH for-next 2/9] net/mlx4_core: Manage alias GUID per VF Or Gerlitz
2015-03-29 13:51 ` [PATCH for-next 3/9] net/mlx4_core: Set initial admin GUIDs for VFs Or Gerlitz
[not found] ` <1427637093-6711-4-git-send-email-ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2015-03-30 17:16 ` Jason Gunthorpe [this message]
[not found] ` <20150330171631.GA1152-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-03-31 9:54 ` Or Gerlitz
2015-03-29 13:51 ` [PATCH for-next 4/9] IB/mlx4: Manage admin alias GUID upon admin request Or Gerlitz
2015-03-29 13:51 ` [PATCH for-next 5/9] IB/mlx4: Change init flow to request alias GUIDs for active VFs Or Gerlitz
2015-03-29 13:51 ` [PATCH for-next 6/9] IB/mlx4: Request alias GUID on demand Or Gerlitz
2015-03-29 13:51 ` [PATCH for-next 7/9] net/mlx4_core: Raise slave shutdown event upon FLR Or Gerlitz
2015-03-29 13:51 ` [PATCH for-next 8/9] net/mlx4_core: Return the admin alias GUID upon host view request Or Gerlitz
2015-03-29 13:51 ` [PATCH for-next 9/9] IB/mlx4: Change alias guids default to be host assigned Or Gerlitz
2015-03-30 16:17 ` [PATCH for-next 0/9] mlx4 changes in virtual GID management Or Gerlitz
[not found] ` <CAJ3xEMj0T8QXBQdVHmfEFMXwjAFVD-O6ywAwyyVY+M3oRLzAVA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-31 3:36 ` David Miller
[not found] ` <20150330.233602.155832546277570456.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2015-03-31 3:47 ` Roland Dreier
[not found] ` <CAL1RGDUmDGCGdTBeTTBiHygO5UgEbRm_Qgxtx-+bxo1vg1v-8g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-31 9:13 ` Sagi Grimberg
[not found] ` <551A6556.9030708-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-03-31 18:46 ` Jason Gunthorpe
2015-03-31 11:22 ` Or Gerlitz
[not found] ` <CAJ3xEMjfbxt2Ouh4bhuf3_LMc7qY807h6FryvdCr0rr_gdiZAw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-03-31 12:49 ` Christoph Lameter
[not found] ` <alpine.DEB.2.11.1503310735380.13128-gkYfJU5Cukgdnm+yROfE0A@public.gmane.org>
2015-03-31 12:57 ` Hal Rosenstock
[not found] ` <551A99D4.7060703-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-03-31 15:49 ` Christoph Lameter
2015-03-31 15:50 ` David Miller
[not found] ` <20150331.115052.1321302787804579694.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2015-03-31 16:29 ` Christoph Lameter
2015-03-31 15:48 ` David Miller
[not found] ` <20150331.114824.651005354305268415.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2015-03-31 17:27 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A82373A8FBB790-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-03-31 20:28 ` Or Gerlitz
2015-03-31 21:33 ` Hefty, Sean
[not found] ` <1828884A29C6694DAF28B7E6B8A82373A8FBBCE3-P5GAC/sN6hkd3b2yrw5b5LfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-04-02 14:32 ` Or Gerlitz
[not found] ` <CAJ3xEMgptECgnWXfW7wN8sjqRfUvzF3tCN=Lj8MZtdOG8yg3jQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-02 22:31 ` ira.weiny
[not found] ` <20150402223135.GA12588-W4f6Xiosr+yv7QzWx2u06xL4W9x8LtSr@public.gmane.org>
2015-04-05 5:15 ` Or Gerlitz
[not found] ` <CAJ3xEMgsHAFJomuCN+EzMcYaxTOTQqHuDdr9zztuO9pH9QicXw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-05 14:51 ` Roland Dreier
[not found] ` <CAG4TOxOv98YjNOi9MbKHiHg6aLw75XRfasMaScdRccRitiE3-g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-05 20:46 ` David Miller
[not found] ` <20150405.164626.1878934248335902055.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2015-04-07 17:12 ` Jason Gunthorpe
2015-04-08 13:03 ` Or Gerlitz
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=20150330171631.GA1152@obsidianresearch.com \
--to=jgunthorpe-epgobjl8dl3ta4ec/59zmfatqe2ktcn/@public.gmane.org \
--cc=amirv-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=jackm-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=talal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=yishaih-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox