From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
jgg-uk2M96/98Pc@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH for-next 6/6] RDMA/hns: Set the guid for hip08 RoCE device
Date: Tue, 9 Jan 2018 16:45:24 +0200 [thread overview]
Message-ID: <20180109144524.GJ6823@mtr-leonro.local> (raw)
In-Reply-To: <1515039563-73084-7-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 1907 bytes --]
On Thu, Jan 04, 2018 at 12:19:23PM +0800, Lijun Ou wrote:
> This patch assgin a guid(Global Unique identifer)
> value to the hip08 device.
>
> Signed-off-by: Lijun Ou <oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Yixian Liu <liuyixian-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Wei Hu (Xavier) <xavier.huwei-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
> ---
> drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> index 6b4474d..6a6f355 100644
> --- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.c
> @@ -4658,6 +4658,22 @@ static void hns_roce_v2_cleanup_eq_table(struct hns_roce_dev *hr_dev)
> {0, }
> };
>
> +static void hns_roce_get_guid(u8 *dev_addr, u8 *guid)
> +{
> + u8 mac[ETH_ALEN];
> +
> + /* MAC-48 to EUI-64 mapping */
> + memcpy(mac, dev_addr, ETH_ALEN);
> + guid[0] = mac[0] ^ 2;
> + guid[1] = mac[1];
> + guid[2] = mac[2];
> + guid[3] = 0xff;
> + guid[4] = 0xfe;
> + guid[5] = mac[3];
> + guid[6] = mac[4];
> + guid[7] = mac[5];
> +}
Please take a look on the commit: 4d6f28591fe4
("{net,IB}/{rxe,usnic}: Utilize generic mac to eui32 function").
It presents the correct way to update guid.
Thanks
> +
> static int hns_roce_hw_v2_get_cfg(struct hns_roce_dev *hr_dev,
> struct hnae3_handle *handle)
> {
> @@ -4680,6 +4696,9 @@ static int hns_roce_hw_v2_get_cfg(struct hns_roce_dev *hr_dev,
> hr_dev->iboe.netdevs[0] = handle->rinfo.netdev;
> hr_dev->iboe.phy_port[0] = 0;
>
> + hns_roce_get_guid(hr_dev->iboe.netdevs[0]->dev_addr,
> + (u8 *)&hr_dev->ib_dev.node_guid);
> +
> for (i = 0; i < HNS_ROCE_V2_MAX_IRQ_NUM; i++)
> hr_dev->irq[i] = pci_irq_vector(handle->pdev,
> i + handle->rinfo.base_vector);
> --
> 1.9.1
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2018-01-09 14:45 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-04 4:19 [PATCH for-next 0/6] Add CM support to hip08 Lijun Ou
[not found] ` <1515039563-73084-1-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-01-04 4:19 ` [PATCH for-next 1/6] RDMA/hns: Create gsi qp in hip08 Lijun Ou
2018-01-04 4:19 ` [PATCH for-next 2/6] RDMA/hns: Add gsi qp support for modifying " Lijun Ou
[not found] ` <1515039563-73084-3-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-01-08 21:20 ` Doug Ledford
[not found] ` <1515446459.3403.94.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-01-09 1:04 ` oulijun
[not found] ` <66c69e6b-8f74-be2e-1404-3e0c8c4a4024-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-01-09 15:12 ` Doug Ledford
[not found] ` <1515510778.3403.140.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-01-10 1:59 ` oulijun
2018-01-04 4:19 ` [PATCH for-next 3/6] RDMA/hns: Fill sq wqe context of ud type " Lijun Ou
[not found] ` <1515039563-73084-4-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-01-09 14:33 ` Leon Romanovsky
2018-01-04 4:19 ` [PATCH for-next 4/6] RDMA/hns: Assign zero for pkey_index of wc " Lijun Ou
2018-01-04 4:19 ` [PATCH for-next 5/6] RDMA/hns: Update the verbs of polling for completion Lijun Ou
2018-01-04 4:19 ` [PATCH for-next 6/6] RDMA/hns: Set the guid for hip08 RoCE device Lijun Ou
[not found] ` <1515039563-73084-7-git-send-email-oulijun-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-01-09 14:45 ` Leon Romanovsky [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=20180109144524.GJ6823@mtr-leonro.local \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=jgg-uk2M96/98Pc@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=oulijun-hv44wF8Li93QT0dZR+AlfA@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