Author: hselasky
Date: Tue Jul 17 09:36:04 2018
New Revision: 336388
URL: https://svnweb.freebsd.org/changeset/base/336388

Log:
  Add support for RoCEv2 multicast in ibcore.
  
  When creating address handle from multicast GID, set MAC according to
  the appropriate formula instead of searching for it in the GID table:
  - For IPv4 multicast GID use ip_eth_mc_map().
  - For IPv6 multicast GID use ipv6_eth_mc_map().
  
  Linux commit:
  9636a56fa864464896bf7d1272c701f2b9a57737
  
  MFC after:            1 week
  Sponsored by:         Mellanox Technologies

Modified:
  head/sys/ofed/drivers/infiniband/core/ib_verbs.c

Modified: head/sys/ofed/drivers/infiniband/core/ib_verbs.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/core/ib_verbs.c    Tue Jul 17 09:34:29 
2018        (r336387)
+++ head/sys/ofed/drivers/infiniband/core/ib_verbs.c    Tue Jul 17 09:36:04 
2018        (r336388)
@@ -1172,6 +1172,19 @@ int ib_resolve_eth_dmac(struct ib_device *device,
        if (!rdma_cap_eth_ah(device, ah_attr->port_num))
                return 0;
 
+       if (rdma_is_multicast_addr((struct in6_addr *)ah_attr->grh.dgid.raw)) {
+               if (ipv6_addr_v4mapped((struct in6_addr 
*)ah_attr->grh.dgid.raw)) {
+                       __be32 addr = 0;
+
+                       memcpy(&addr, ah_attr->grh.dgid.raw + 12, 4);
+                       ip_eth_mc_map(addr, (char *)ah_attr->dmac);
+               } else {
+                       ipv6_eth_mc_map((struct in6_addr 
*)ah_attr->grh.dgid.raw,
+                                       (char *)ah_attr->dmac);
+               }
+               return 0;
+       }
+
        ret = ib_query_gid(device,
                           ah_attr->port_num,
                           ah_attr->grh.sgid_index,
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to