* [PATCH rdma-core] vmw_pvrdma: Add L2 MAC resolution for UD QPs
@ 2017-08-10 6:04 Adit Ranadive
[not found] ` <1502345099-6534-1-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Adit Ranadive @ 2017-08-10 6:04 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
pv-drivers-pghWNbHTmq7QT0dZR+AlfA
Cc: Bryan Tan, jhansen-pghWNbHTmq7QT0dZR+AlfA,
asarwade-pghWNbHTmq7QT0dZR+AlfA, Adit Ranadive
From: Bryan Tan <bryantan-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
From: Bryan Tan <bryantan-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
Use a libibverbs function to resolve the destination MAC address
for a non-default GID in UD QPs.
Signed-off-by: Bryan Tan <bryantan-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
Signed-off-by: Adit Ranadive <aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
---
providers/vmw_pvrdma/verbs.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/providers/vmw_pvrdma/verbs.c b/providers/vmw_pvrdma/verbs.c
index 1bb1634..852aced 100644
--- a/providers/vmw_pvrdma/verbs.c
+++ b/providers/vmw_pvrdma/verbs.c
@@ -186,6 +186,7 @@ struct ibv_ah *pvrdma_create_ah(struct ibv_pd *pd,
struct pvrdma_ah *ah;
struct pvrdma_av *av;
struct ibv_port_attr port_attr;
+ uint16_t vlan_id;
if (!attr->is_global)
return NULL;
@@ -216,7 +217,14 @@ struct ibv_ah *pvrdma_create_ah(struct ibv_pd *pd,
av->sl_tclass_flowlabel = (attr->grh.traffic_class << 20) |
attr->grh.flow_label;
memcpy(av->dgid, attr->grh.dgid.raw, 16);
- set_mac_from_gid(&attr->grh.dgid, av->dmac);
+
+ if (ibv_resolve_eth_l2_from_gid(pd->context, attr,
+ av->dmac, &vlan_id)) {
+ free(ah);
+ return NULL;
+ } else {
+ set_mac_from_gid(&attr->grh.dgid, av->dmac);
+ }
return &ah->ibv_ah;
}
--
2.7.4
--
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH rdma-core] vmw_pvrdma: Add L2 MAC resolution for UD QPs
[not found] ` <1502345099-6534-1-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
@ 2017-08-10 6:18 ` Leon Romanovsky
2017-08-10 11:26 ` Yuval Shaia
1 sibling, 0 replies; 3+ messages in thread
From: Leon Romanovsky @ 2017-08-10 6:18 UTC (permalink / raw)
To: Adit Ranadive
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
pv-drivers-pghWNbHTmq7QT0dZR+AlfA, Bryan Tan,
jhansen-pghWNbHTmq7QT0dZR+AlfA, asarwade-pghWNbHTmq7QT0dZR+AlfA
[-- Attachment #1: Type: text/plain, Size: 590 bytes --]
On Wed, Aug 09, 2017 at 11:04:59PM -0700, Adit Ranadive wrote:
> From: Bryan Tan <bryantan-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
>
> From: Bryan Tan <bryantan-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
>
> Use a libibverbs function to resolve the destination MAC address
> for a non-default GID in UD QPs.
>
> Signed-off-by: Bryan Tan <bryantan-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Adit Ranadive <aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
> ---
> providers/vmw_pvrdma/verbs.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
Thanks, applied.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH rdma-core] vmw_pvrdma: Add L2 MAC resolution for UD QPs
[not found] ` <1502345099-6534-1-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2017-08-10 6:18 ` Leon Romanovsky
@ 2017-08-10 11:26 ` Yuval Shaia
1 sibling, 0 replies; 3+ messages in thread
From: Yuval Shaia @ 2017-08-10 11:26 UTC (permalink / raw)
To: Adit Ranadive
Cc: dledford-H+wXaHxf7aLQT0dZR+AlfA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA,
pv-drivers-pghWNbHTmq7QT0dZR+AlfA, Bryan Tan,
jhansen-pghWNbHTmq7QT0dZR+AlfA, asarwade-pghWNbHTmq7QT0dZR+AlfA
On Wed, Aug 09, 2017 at 11:04:59PM -0700, Adit Ranadive wrote:
> From: Bryan Tan <bryantan-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
>
> From: Bryan Tan <bryantan-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
>
> Use a libibverbs function to resolve the destination MAC address
s/libibverbs/ibverbs
> for a non-default GID in UD QPs.
>
> Signed-off-by: Bryan Tan <bryantan-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
> Signed-off-by: Adit Ranadive <aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
> ---
> providers/vmw_pvrdma/verbs.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/providers/vmw_pvrdma/verbs.c b/providers/vmw_pvrdma/verbs.c
> index 1bb1634..852aced 100644
> --- a/providers/vmw_pvrdma/verbs.c
> +++ b/providers/vmw_pvrdma/verbs.c
> @@ -186,6 +186,7 @@ struct ibv_ah *pvrdma_create_ah(struct ibv_pd *pd,
> struct pvrdma_ah *ah;
> struct pvrdma_av *av;
> struct ibv_port_attr port_attr;
> + uint16_t vlan_id;
>
> if (!attr->is_global)
> return NULL;
> @@ -216,7 +217,14 @@ struct ibv_ah *pvrdma_create_ah(struct ibv_pd *pd,
> av->sl_tclass_flowlabel = (attr->grh.traffic_class << 20) |
> attr->grh.flow_label;
> memcpy(av->dgid, attr->grh.dgid.raw, 16);
> - set_mac_from_gid(&attr->grh.dgid, av->dmac);
> +
> + if (ibv_resolve_eth_l2_from_gid(pd->context, attr,
> + av->dmac, &vlan_id)) {
> + free(ah);
> + return NULL;
> + } else {
> + set_mac_from_gid(&attr->grh.dgid, av->dmac);
> + }
>
> return &ah->ibv_ah;
> }
> --
> 2.7.4
>
> --
> 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
--
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-10 11:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-10 6:04 [PATCH rdma-core] vmw_pvrdma: Add L2 MAC resolution for UD QPs Adit Ranadive
[not found] ` <1502345099-6534-1-git-send-email-aditr-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>
2017-08-10 6:18 ` Leon Romanovsky
2017-08-10 11:26 ` Yuval Shaia
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox