34 #include <linux/string.h>
35 #include <linux/slab.h>
69 static enum ib_rate memfree_rate_to_ib(
u8 mthca_rate,
u8 port_rate)
84 static enum ib_rate tavor_rate_to_ib(
u8 mthca_rate,
u8 port_rate)
96 if (mthca_is_memfree(dev)) {
98 if (dev->
limits.stat_rate_support == 0x3 && mthca_rate)
101 return memfree_rate_to_ib(mthca_rate, dev->
rate[port - 1]);
103 return tavor_rate_to_ib(mthca_rate, dev->
rate[port - 1]);
106 static u8 ib_rate_to_memfree(
u8 req_rate,
u8 cur_rate)
108 if (cur_rate <= req_rate)
115 switch ((cur_rate - 1) / req_rate) {
126 switch (static_rate) {
141 if (mthca_is_memfree(dev))
143 dev->
rate[port - 1]);
145 rate = ib_rate_to_tavor(static_rate);
147 if (!(dev->
limits.stat_rate_support & (1 << rate)))
163 if (mthca_is_memfree(dev)) {
210 ah_attr->
grh.sgid_index;
214 ah_attr->
grh.flow_label);
224 mthca_dbg(dev,
"Created UDAV at %p/%08lx:\n",
225 av, (
unsigned long) ah->
avdma);
226 for (j = 0; j < 8; ++
j)
263 return !!(ah->
av->g_slid & 0x80);
273 header->
lrh.destination_lid = ah->
av->dlid;
276 header->
grh.traffic_class =
278 header->
grh.flow_label =
280 header->
grh.hop_limit = ah->
av->hop_limit;
283 ah->
av->gid_index % dev->
limits.gid_table_len,
284 &header->
grh.source_gid);
301 memset(attr, 0,
sizeof *attr);
311 attr->
grh.traffic_class =
313 attr->
grh.flow_label =
315 attr->
grh.hop_limit = ah->
av->hop_limit;
316 attr->
grh.sgid_index = ah->
av->gid_index &
317 (dev->
limits.gid_table_len - 1);
328 if (mthca_is_memfree(dev))
338 dev->
av_table.pool = pci_pool_create(
"mthca_av", dev->
pdev,
358 pci_pool_destroy(dev->
av_table.pool);
367 if (mthca_is_memfree(dev))
372 pci_pool_destroy(dev->
av_table.pool);