36 #include <linux/slab.h>
38 #include <linux/string.h>
49 memcpy(&in6, ah_attr->
grh.dgid.raw,
sizeof in6);
50 if (rdma_link_local_addr(&in6))
51 rdma_get_ll_mac(&in6, mac);
52 else if (rdma_is_multicast_addr(&in6)) {
53 rdma_get_mcast_mac(&in6, mac);
69 ah->
av.
ib.g_slid |= 0x80;
70 ah->
av.
ib.gid_index = ah_attr->
grh.sgid_index;
71 ah->
av.
ib.hop_limit = ah_attr->
grh.hop_limit;
72 ah->
av.
ib.sl_tclass_flowlabel |=
74 ah_attr->
grh.flow_label);
82 !(1 << ah->
av.
ib.stat_rate & dev->
caps.stat_rate_support))
83 --ah->
av.
ib.stat_rate;
109 vlan_tag = rdma_get_vlan_id(&sgid);
110 if (vlan_tag < 0x1000)
111 vlan_tag |= (ah_attr->
sl & 7) << 13;
113 ah->
av.
eth.gid_index = ah_attr->
grh.sgid_index;
118 !(1 << ah->
av.
eth.stat_rate & dev->
caps.stat_rate_support))
119 --ah->
av.
eth.stat_rate;
155 ret = create_iboe_ah(pd, ah_attr, ah);
163 return create_ib_ah(pd, ah_attr, ah);
171 memset(ah_attr, 0,
sizeof *ah_attr);
176 if (ah->
av.
ib.stat_rate)
180 if (mlx4_ib_ah_grh_present(ah)) {
183 ah_attr->
grh.traffic_class =
185 ah_attr->
grh.flow_label =
187 ah_attr->
grh.hop_limit = ah->
av.
ib.hop_limit;
188 ah_attr->
grh.sgid_index = ah->
av.
ib.gid_index;