]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/rds/ib.c
RDS/IB: add _to_node() macros for numa and use {k,v}malloc_node()
[net-next-2.6.git] / net / rds / ib.c
index 8f2d6dd7700a8a0e20192b521c30dc7bc2df553b..7d289d7985fed171f14fd36265febafaf71035d0 100644 (file)
@@ -77,7 +77,7 @@ void rds_ib_add_one(struct ib_device *device)
                goto free_attr;
        }
 
-       rds_ibdev = kmalloc(sizeof *rds_ibdev, GFP_KERNEL);
+       rds_ibdev = kmalloc_node(sizeof *rds_ibdev, GFP_KERNEL, ibdev_to_node(device));
        if (!rds_ibdev)
                goto free_attr;
 
@@ -91,6 +91,9 @@ void rds_ib_add_one(struct ib_device *device)
                        min_t(unsigned int, dev_attr->max_fmr, fmr_pool_size) :
                        fmr_pool_size;
 
+       rds_ibdev->max_initiator_depth = dev_attr->max_qp_init_rd_atom;
+       rds_ibdev->max_responder_resources = dev_attr->max_qp_rd_atom;
+
        rds_ibdev->dev = device;
        rds_ibdev->pd = ib_alloc_pd(device);
        if (IS_ERR(rds_ibdev->pd))
@@ -134,6 +137,7 @@ void rds_ib_remove_one(struct ib_device *device)
        if (!rds_ibdev)
                return;
 
+       synchronize_rcu();
        list_for_each_entry_safe(i_ipaddr, i_next, &rds_ibdev->ipaddr_list, list) {
                list_del(&i_ipaddr->list);
                kfree(i_ipaddr);
@@ -262,15 +266,14 @@ struct rds_transport rds_ib_transport = {
        .laddr_check            = rds_ib_laddr_check,
        .xmit_complete          = rds_ib_xmit_complete,
        .xmit                   = rds_ib_xmit,
-       .xmit_cong_map          = NULL,
        .xmit_rdma              = rds_ib_xmit_rdma,
+       .xmit_atomic            = rds_ib_xmit_atomic,
        .recv                   = rds_ib_recv,
        .conn_alloc             = rds_ib_conn_alloc,
        .conn_free              = rds_ib_conn_free,
        .conn_connect           = rds_ib_conn_connect,
        .conn_shutdown          = rds_ib_conn_shutdown,
        .inc_copy_to_user       = rds_ib_inc_copy_to_user,
-       .inc_purge              = rds_ib_inc_purge,
        .inc_free               = rds_ib_inc_free,
        .cm_initiate_connect    = rds_ib_cm_initiate_connect,
        .cm_handle_connect      = rds_ib_cm_handle_connect,