]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/infiniband/hw/ehca/ehca_av.c
IB/ehca: HW level, HW caps and MTU autodetection
[linux-2.6-omap-h63xx.git] / drivers / infiniband / hw / ehca / ehca_av.c
index 3bac197f90141d488f806f07100874afa5d7f491..3cd6bf3402d10c8a0d9d097b72d8fdf9b1bb5a11 100644 (file)
@@ -57,7 +57,7 @@ struct ib_ah *ehca_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr)
        struct ehca_shca *shca = container_of(pd->device, struct ehca_shca,
                                              ib_device);
 
-       av = kmem_cache_alloc(av_cache, SLAB_KERNEL);
+       av = kmem_cache_alloc(av_cache, GFP_KERNEL);
        if (!av) {
                ehca_err(pd->device, "Out of memory pd=%p ah_attr=%p",
                         pd, ah_attr);
@@ -118,8 +118,7 @@ struct ib_ah *ehca_create_ah(struct ib_pd *pd, struct ib_ah_attr *ah_attr)
                }
                memcpy(&av->av.grh.word_1, &gid, sizeof(gid));
        }
-       /* for the time being we use a hard coded PMTU of 2048 Bytes */
-       av->av.pmtu = 4;
+       av->av.pmtu = shca->max_mtu;
 
        /* dgid comes in grh.word_3 */
        memcpy(&av->av.grh.word_3, &ah_attr->grh.dgid,
@@ -138,6 +137,8 @@ int ehca_modify_ah(struct ib_ah *ah, struct ib_ah_attr *ah_attr)
        struct ehca_av *av;
        struct ehca_ud_av new_ehca_av;
        struct ehca_pd *my_pd = container_of(ah->pd, struct ehca_pd, ib_pd);
+       struct ehca_shca *shca = container_of(ah->pd->device, struct ehca_shca,
+                                             ib_device);
        u32 cur_pid = current->tgid;
 
        if (my_pd->ib_pd.uobject && my_pd->ib_pd.uobject->context &&
@@ -193,7 +194,7 @@ int ehca_modify_ah(struct ib_ah *ah, struct ib_ah_attr *ah_attr)
                memcpy(&new_ehca_av.grh.word_1, &gid, sizeof(gid));
        }
 
-       new_ehca_av.pmtu = 4; /* see also comment in create_ah() */
+       new_ehca_av.pmtu = shca->max_mtu;
 
        memcpy(&new_ehca_av.grh.word_3, &ah_attr->grh.dgid,
               sizeof(ah_attr->grh.dgid));