From b4155c4ab541693f35f2efe76d6dc75dd4cb7825 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 7 Jul 2009 14:03:11 +0100 Subject: [infiniband] Make qkey and rate optional parameters to ib_post_send() The queue key is stored as a property of the queue pair, and so can optionally be added by the Infiniband core at the time of calling ib_post_send(), rather than always having to be specified by the caller. This allows IPoIB to avoid explicitly keeping track of the data queue key. --- src/net/infiniband.c | 6 ++++++ src/net/infiniband/ib_gma.c | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/net') diff --git a/src/net/infiniband.c b/src/net/infiniband.c index 497c20f6a..369d490a3 100644 --- a/src/net/infiniband.c +++ b/src/net/infiniband.c @@ -360,6 +360,12 @@ int ib_post_send ( struct ib_device *ibdev, struct ib_queue_pair *qp, return -ENOBUFS; } + /* Fill in optional parameters in address vector */ + if ( ! av->qkey ) + av->qkey = qp->qkey; + if ( ! av->rate ) + av->rate = IB_RATE_2_5; + /* Post to hardware */ if ( ( rc = ibdev->op->post_send ( ibdev, qp, av, iobuf ) ) != 0 ) { DBGC ( ibdev, "IBDEV %p QPN %#lx could not post send WQE: " diff --git a/src/net/infiniband/ib_gma.c b/src/net/infiniband/ib_gma.c index 2baae25c6..d599ea32b 100644 --- a/src/net/infiniband/ib_gma.c +++ b/src/net/infiniband/ib_gma.c @@ -197,10 +197,6 @@ static void ib_gma_complete_recv ( struct ib_device *ibdev, } } - /* Construct return address */ - av->qkey = ( ( av->qpn == IB_QPN_SMA ) ? IB_QKEY_SMA : IB_QKEY_GMA ); - av->rate = IB_RATE_2_5; - /* Send MAD response, if applicable */ if ( ( rc = ib_post_send ( ibdev, qp, av, iob_disown ( iobuf ) ) ) != 0 ) { -- cgit v1.2.3-55-g7522