]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
10 years agoRDS Async send support revised
Bang Nguyen [Sat, 14 Apr 2012 00:16:31 +0000 (17:16 -0700)]
RDS Async send support revised

Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS Asynchronous Send support
Bang Nguyen [Sun, 19 Feb 2012 20:19:57 +0000 (12:19 -0800)]
RDS Asynchronous Send support

1. Same behavior as RDMA send, i.e., generate notification on IB completion.
2. On error handling, connection is closed for traffic, i.e., new sends are
   rejected and client retries
3. To guarantee ordering, all pending async (RDMA/bcopy) sends after the
   failed send will also be aborted, and in the order that they were submitted.
4. Re-open connection for traffic after all the failed notifications have
   been reaped by the client.

Signed-off-by: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
10 years agords: fix compilation warnings
Dotan Barak [Wed, 15 Feb 2012 16:00:50 +0000 (18:00 +0200)]
rds: fix compilation warnings

net/rds/ib_recv.c: In function 'rds_ib_srq_event':
net/rds/ib_recv.c:1490: warning: too many arguments for format
net/rds/ib_recv.c:1484: warning: unused variable 'srq_attr'
net/rds/ib_recv.c: In function 'rds_ib_srq_init':
net/rds/ib_recv.c:1524: warning: passing argument 1 of 'ERR_PTR' makes
integer from pointer without a cast
include/linux/err.h:20: note: expected 'long int' but argument is of
type 'struct ib_srq *'
net/rds/ib_recv.c:1524: warning: format '%d' expects type 'int', but
argument 2 has type 'void *'

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
10 years agoRDS: cleanup checkpatch errors
Bang Nguyen [Wed, 8 Feb 2012 21:31:22 +0000 (13:31 -0800)]
RDS: cleanup checkpatch errors

Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS Quality Of Service
Bang Nguyen [Fri, 3 Feb 2012 16:10:06 +0000 (11:10 -0500)]
RDS Quality Of Service

RDS QoS is an extension of IB QoS to provide clients the ability to
segregate traffic flows and define policy to regulate them.
Internally, each traffic flow is represented by a connection with all of its
independent resources like that of a normal connection, and is
differentiated by service type. In other words, there can be multiple
connections between an IP pair and each supports a unique service type.
Service type (TOS) is user-defined and can be configured to satisfy certain
traffic requirements. For example, one service type may be configured for
high-priority low-latency traffic, another for low-priority high-bandwidth
traffic, and so on.

TOS is socket based. Client can set TOS on a socket via an IOCTL and must
do so before initiating any traffic. Once set, the TOS can not be changed.

        ioctl(fd, RDS_IOC_SET_TOS=1, (uint8_t *)<TOS ptr>)

All out-going traffic from the socket will be associated with its TOS.

Signed-off-by: Venkat Venkatsubra <venkat.x.venkatsubra@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: Use IB_CQ_NEXT_COMP instead of IB_CQ_SOLICITED for TX CQ
Bang Nguyen [Fri, 3 Feb 2012 16:09:49 +0000 (11:09 -0500)]
RDS: Use IB_CQ_NEXT_COMP instead of IB_CQ_SOLICITED for TX CQ

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: make sure rds_send_xmit doesn't loop forever
Chris Mason [Fri, 3 Feb 2012 16:09:49 +0000 (11:09 -0500)]
RDS: make sure rds_send_xmit doesn't loop forever

rds_send_xmit can get stuck doing work on behalf of other senders.  This
breaks out if we've been working too long.  The work queue will get kicked
to finish off any other requests if our current process gives up.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: issue warning if re-connect stalling for more than 1 min.
Bang Nguyen [Fri, 3 Feb 2012 16:09:49 +0000 (11:09 -0500)]
RDS: issue warning if re-connect stalling for more than 1 min.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: don't test ring_empty or ring_low without locks held
Chris Mason [Fri, 3 Feb 2012 16:09:36 +0000 (11:09 -0500)]
RDS: don't test ring_empty or ring_low without locks held

The math in the ring functions can't be trusted unless you're either the only
person adding to the ring or the only person freeing from it.  If there are no
locks held at all you can end up hitting bogus assertions around the ring counters.

This chnages the rds_ib_recv_refill code and the recv tasklet code to make sure
proper locks are held before we use rds_ib_ring_empty or rds_ib_ring_low

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: don't use RCU for the bind hash table
Chris Mason [Fri, 3 Feb 2012 16:09:23 +0000 (11:09 -0500)]
RDS: don't use RCU for the bind hash table

RCU delays are making socket shutdown too slow.  Switch to a reader/writer lock so
that we don't risk ooming as we wait for sockets to free

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: avoid double destory of cm_id when rdms_resolve_route fails
Venkat Venkatsubra [Fri, 3 Feb 2012 16:09:07 +0000 (11:09 -0500)]
RDS: avoid double destory of cm_id when rdms_resolve_route fails

It crashes in rds_ib_conn_shutdown because it was using a freed cm_id.  The
cm_id had got freed quite a while back actually (more than 15 secs back) during
an earlier connect attempt.

This was the sequence of the earlier connect attempt: rds_ib_conn_connect calls
rdma_resolve_addr.  The synchronous part of rdma_resolve_addr succeeds. But the
asynchronous part fails at some point.  RDMA Connection Manager returns the
event RDMA_CM_EVENT_ADDR_RESOLVED. This part succeeds.  Next, RDS calls
rdma_resolve_route from the rds_rdma_cm_event_handler. This fails.  We return
this error back to the RDMA CM addr_handler which destroys the cm_id as
follows: addr_handler (cma.c):

static void addr_handler(int status, struct sockaddr *src_addr,
                         struct rdma_dev_addr *dev_addr, void *context)
{
     .....
        if (id_priv->id.event_handler(&id_priv->id, &event)) {
                cma_exch(id_priv, CMA_DESTROYING);
                mutex_unlock(&id_priv->handler_mutex);
                cma_deref_id(id_priv);
                rdma_destroy_id(&id_priv->id);    <----  here
                return;
        }

RDS continues to point to this freed cm_id.

Later when a new connect req comes in from the remote side, we shutdown this cm_id
and try to reconnect:
  /*
   * after 15 seconds, give up on existing connection
   * attempts and make them try again.  At this point
   * it's no longer a race but something has gone
   * horribly wrong
   */
   if (now > conn->c_connection_start &&
           now - conn->c_connection_start > 5) {
              printk(KERN_CRIT "rds connection racing for 15s, forcing reset "
                        "connection %u.%u.%u.%u->%u.%u.%u.%u\n",
                        NIPQUAD(conn->c_laddr), NIPQUAD(conn->c_faddr));
       rds_conn_drop(conn);
          ....
We crash during the shutdown.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: make sure rds_send_drop_to properly takes the m_rs_lock
Chris Mason [Fri, 3 Feb 2012 16:09:07 +0000 (11:09 -0500)]
RDS: make sure rds_send_drop_to properly takes the m_rs_lock

rds_send_drop_to is used during socket tear down to find all the
messages on the socket and clean them up.  It can race with the
acking code unless it takes the m_rs_lock on each and every message.

This plugs a hole where we didn't take m_rs_lock on any message that
didn't have the RDS_MSG_ON_CONN set.  Taking m_rs_lock avoids
double frees and other memory corruptions as the ack code trusts
the message m_rs pointer on a socket that had actually been freed.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: kick krdsd to send congestion map updates
Chris Mason [Fri, 3 Feb 2012 16:09:07 +0000 (11:09 -0500)]
RDS: kick krdsd to send congestion map updates

We can get into a deadlock on the recv spinlock because
congestion map updates can be sent in the recev path.  This
pushes the work off to krdsd instead.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: add debuging code around sock_hold and sock_put.
Chris Mason [Fri, 3 Feb 2012 16:09:07 +0000 (11:09 -0500)]
RDS: add debuging code around sock_hold and sock_put.

RDS had a recent series of memory corruptions because of
a use-after-free and double-free of rds sockets.  This adds
some debugging code around sock_put and sock_hold to
catch any similar bugs and spit out useful debugging info.

This is a temporary commit while customers try out our fix.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: Don't destroy the rdma id until after we're dong using it
Chris Mason [Fri, 3 Feb 2012 16:09:07 +0000 (11:09 -0500)]
RDS: Don't destroy the rdma id until after we're dong using it

During connection resets, we are destroying the rdma id too soon.
This moves it to after we clear the rings

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: adjust BUG()s for irqs disabled.
Chris Mason [Fri, 3 Feb 2012 16:09:07 +0000 (11:09 -0500)]
RDS: adjust BUG()s for irqs disabled.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agords: make sure we don't deref a null cm_id->device during address checks
Chris Mason [Fri, 3 Feb 2012 16:09:07 +0000 (11:09 -0500)]
rds: make sure we don't deref a null cm_id->device during address checks

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: don't use GFP_ATOMIC for sk_alloc in rds_create
Chris Mason [Fri, 3 Feb 2012 16:08:51 +0000 (11:08 -0500)]
RDS: don't use GFP_ATOMIC for sk_alloc in rds_create

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: Make sure we do a signaled send at least once per large send
Chris Mason [Fri, 3 Feb 2012 16:08:50 +0000 (11:08 -0500)]
RDS: Make sure we do a signaled send at least once per large send

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: Fix an rcu race with rds_bin_lookup
Tina Yang [Fri, 3 Feb 2012 16:08:50 +0000 (11:08 -0500)]
RDS: Fix an rcu race with rds_bin_lookup

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: Fix RDS_MSG_MAPPED usage.
Chris Mason [Fri, 3 Feb 2012 16:08:50 +0000 (11:08 -0500)]
RDS: Fix RDS_MSG_MAPPED usage.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: add a sock_destruct callback with debugging
Chris Mason [Fri, 3 Feb 2012 16:08:50 +0000 (11:08 -0500)]
RDS: add a sock_destruct callback with debugging

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: add a sock_destruct callback with debugging
Tina Yang [Fri, 3 Feb 2012 16:07:54 +0000 (11:07 -0500)]
RDS: add a sock_destruct callback with debugging

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: limit the number of times we loop in rds_send_xmit
Chris Mason [Fri, 3 Feb 2012 16:07:54 +0000 (11:07 -0500)]
RDS: limit the number of times we loop in rds_send_xmit

This will kick the RDS worker thread if we have been looping
too long.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS Make sure we check for congestion updates during rds_send_xmit
Chris Mason [Fri, 3 Feb 2012 16:07:54 +0000 (11:07 -0500)]
RDS Make sure we check for congestion updates during rds_send_xmit

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoMake sure to kick rds_send_xmit for both LL_SEND_FULL and for the congestion map...
Chris Mason [Fri, 3 Feb 2012 16:07:54 +0000 (11:07 -0500)]
Make sure to kick rds_send_xmit for both LL_SEND_FULL and for the congestion map updates.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: make sure we post recv buffers
Chris Mason [Fri, 3 Feb 2012 16:07:54 +0000 (11:07 -0500)]
RDS: make sure we post recv buffers

If we get an ENOMEM during rds_ib_recv_refill, we might never come
back and refill again later.

This makes sure to kick krdsd into helping out.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: don't trust the LL_SEND_FULL bit
Chris Mason [Fri, 3 Feb 2012 16:07:54 +0000 (11:07 -0500)]
RDS: don't trust the LL_SEND_FULL bit

We are seeing connections stuck with the LL_SEND_FULL bit getting
set and never cleared.  This changes RDS to stop trusting the
LL_SEND_FULL bit and kick krdsd after any time we
see -ENOMEM from the ring allocation code.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: give up on half formed connections after 15s
Chris Mason [Fri, 3 Feb 2012 16:07:54 +0000 (11:07 -0500)]
RDS: give up on half formed connections after 15s

RDS relies on events to transition connections through a few
different states, but sometimes we get stuck and end up with
a half formed connection that is never able to finish

The other end has either wandered off or there are bugs in
other layers, and we end up with any future attempts from
the other end rejected because we're already working on a
connection attempt.

This patch changes things to give up on half formed connections
after 15 seconds.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agords_send_xmit is called uner a spinlock, lets not do a cond_resched()
Chris Mason [Fri, 3 Feb 2012 16:07:41 +0000 (11:07 -0500)]
rds_send_xmit is called uner a spinlock, lets not do a cond_resched()

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: make sure not to loop forever inside rds_send_xmit
Chris Mason [Fri, 3 Feb 2012 16:07:41 +0000 (11:07 -0500)]
RDS: make sure not to loop forever inside rds_send_xmit

If a determined set of concurrent senders keep the send queue full,
we can loop forever insdie rds_send_xmit.  This fix has two parts.

First we are dropping out of the while(1) loop after we've processed a
large batch of messages.

Second we add a generation number that gets bumped each time the
xmit bit lock is acquired.  If someone else has jumped in and
made progress in the queue, we skip our goto restart.

Signed-off-by: Chris Mason <chris.mason@oracle.c.om>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agords: check for excessive looping in rds_send_xmit
Andy Grover [Thu, 13 Jan 2011 19:40:31 +0000 (11:40 -0800)]
rds: check for excessive looping in rds_send_xmit

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agords: don't update ipaddress tables if the address hasn't changed
Chris Mason [Fri, 3 Feb 2012 16:07:41 +0000 (11:07 -0500)]
rds: don't update ipaddress tables if the address hasn't changed

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agochange ib default retry to 1
Andy Grover [Fri, 24 Sep 2010 17:16:37 +0000 (10:16 -0700)]
change ib default retry to 1

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoThis patch adds the modparam to rds.ko.
Andy Grover [Fri, 3 Feb 2012 16:07:40 +0000 (11:07 -0500)]
This patch adds the modparam to rds.ko.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: only use passive connections when addresses match
Zach Brown [Fri, 3 Feb 2012 16:07:40 +0000 (11:07 -0500)]
RDS: only use passive connections when addresses match

Passive connections were added for the case where one loopback IB
connection between identical addresses needs another connection to store
the second QP.  Unfortunately, they were also created in the case where
the addesses differ and we already have both QPs.

This lead to a message reordering bug.

- two different IB interfaces and addresses on a machine: A B
- traffic is sent from A to B
- connection from A-B is created, connect request sent
- listening accepts connect request, B-A is created
- traffic flows, next_rx is incremented
- unacked messages exist on the retrans list
- connection A-B is shut down, new connect request sent
- listen sees existing loopback B-A, creates new passive B-A
- retrans messages are sent and delivered because of 0 next_rx

The problem is that the second connection request saw the previously
existing parent connection.  Instead of using it, and using the existing
next_rx_seq state for the traffic between those IPs, it mistakenly
thought that it had to create a passive connection.

We fix this by only using passive connections in the special case where
laddr and faddr match.  In this case we'll only ever have one parent
sending connection requests and one passive connection created as the
listening path sees the existing parent connection which initiated the
request.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: destroy the ib state that generates call back earlier during shutdown
Chris Mason [Fri, 3 Feb 2012 16:07:40 +0000 (11:07 -0500)]
RDS: destroy the ib state that generates call back earlier during shutdown

Otherwise we can get callbacks after the QP isn't really able to handle them.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: check access on pages before doing copy_to_user
Chris Mason [Fri, 3 Feb 2012 16:07:40 +0000 (11:07 -0500)]
RDS: check access on pages before doing copy_to_user

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS/IB: always free recv frag as we free its ring entry
Zach Brown [Fri, 3 Feb 2012 16:07:40 +0000 (11:07 -0500)]
RDS/IB: always free recv frag as we free its ring entry

We were still seeing rare occurances of the WARN_ON() that indicates
that the recv refill path was finding allocated frags in ring entries
that were marked free.  These were usually followed by oom crashes.
They only seem to be occuring in the presence of interesting completion
errors and connection resets.

There are error paths in rds_ib_recv_cqe_handler() that could leave a
recv frag sitting in the ring.  This patch ensures that we free the frag
as we mark the ring entry free.  This should stop the refill path from
finding allocated frags in ring entries that were marked free.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS/IB: Quiet warnings when leaking frags
Andy Grover [Tue, 7 Sep 2010 17:59:44 +0000 (10:59 -0700)]
RDS/IB: Quiet warnings when leaking frags

We have a race where sometimes we leak frags, and it hits
the WARN_ON. Unfortunately, the stream of WARN_ONs make
the machine unusable. This patch changes to WARN_ON_ONCE
so we do not hose the box, and we can still get notifications
the bug has occurred.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoFix loopback connection reference counts
Zach Brown [Tue, 3 Aug 2010 13:20:09 +0000 (09:20 -0400)]
Fix loopback connection reference counts

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: cancel connection work structs as we shut down
Zach Brown [Fri, 23 Jul 2010 17:37:33 +0000 (10:37 -0700)]
RDS: cancel connection work structs as we shut down

Nothing was canceling the send and receive work that might have been
queued as a conn was being destroyed.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: don't call rds_conn_shutdown() from rds_conn_destroy()
Zach Brown [Fri, 23 Jul 2010 17:36:58 +0000 (10:36 -0700)]
RDS: don't call rds_conn_shutdown() from rds_conn_destroy()

rds_conn_shutdown() can return before the connection is shut down when
it encounters an existing state that it doesn't understand.  This lets
rds_conn_destroy() then start tearing down the conn from under paths
that are still using it.

It's more reliable the shutdown work and wait for krdsd to complete the
shutdown callback.  This stopped some hangs I was seeing where krdsd was
trying to shut down a freed conn.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: have sockets get transport module references
Zach Brown [Fri, 23 Jul 2010 17:32:31 +0000 (10:32 -0700)]
RDS: have sockets get transport module references

Right now there's nothing to stop the various paths that use
rs->rs_transport from racing with rmmod and executing freed transport
code.  The simple fix is to have binding to a transport also hold a
reference to the transport's module, removing this class of races.

We already had an unused t_owner field which was set for the modular
transports and which wasn't set for the built-in loop transport.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: remove old rs_transport comment
Zach Brown [Wed, 21 Jul 2010 22:13:25 +0000 (15:13 -0700)]
RDS: remove old rs_transport comment

rs_transport is now also used by the rdma paths once the socket is
bound.  We don't need this stale comment to tell us what cscope can.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: lock rds_conn_count decrement in rds_conn_destroy()
Zach Brown [Fri, 23 Jul 2010 17:30:45 +0000 (10:30 -0700)]
RDS: lock rds_conn_count decrement in rds_conn_destroy()

rds_conn_destroy() can race with all other modifications of the
rds_conn_count but it was modifying the count without locking.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoUse CQ_NEXT_COMP for recv completions
Andy Grover [Tue, 20 Jul 2010 00:15:57 +0000 (17:15 -0700)]
Use CQ_NEXT_COMP for recv completions

We want to get interrupts for incoming data with no delay.
Splitting the CQs lets us have different policies here and
for send, where we don't want an event for each send completion.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS/IB: protect the list of IB devices
Zach Brown [Thu, 15 Jul 2010 19:34:33 +0000 (12:34 -0700)]
RDS/IB: protect the list of IB devices

The RDS IB device list wasn't protected by any locking.  Traversal in
both the get_mr and FMR flushing paths could race with additon and
removal.

List manipulation is done with RCU primatives and is protected by the
write side of a rwsem.  The list traversal in the get_mr fast path is
protected by a rcu read critical section.  The FMR list traversal is
more problematic because it can block while traversing the list.  We
protect this with the read side of the rwsem.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS/IB: print IB event strings as well as their number
Zach Brown [Wed, 14 Jul 2010 21:01:21 +0000 (14:01 -0700)]
RDS/IB: print IB event strings as well as their number

It's nice to not have to go digging in the code to see which event
occurred.  It's easy to throw together a quick array that maps the ib
event enums to their strings.  I didn't see anything in the stack that
does this translation for us, but I also didn't look very hard.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: flush the FMR pool less often.
Chris Mason [Fri, 3 Feb 2012 16:07:39 +0000 (11:07 -0500)]
RDS: flush the FMR pool less often.

This lets more FMR work build up for more efficient flushing.

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: make sure the ring is really full before we return with ENOMEM
Chris Mason [Fri, 3 Feb 2012 16:07:39 +0000 (11:07 -0500)]
RDS: make sure the ring is really full before we return with ENOMEM

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: use different cq handlers for send and recv
Andy Grover [Fri, 3 Feb 2012 16:07:39 +0000 (11:07 -0500)]
RDS: use different cq handlers for send and recv

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS/IB: track signaled sends
Zach Brown [Wed, 14 Jul 2010 02:23:32 +0000 (19:23 -0700)]
RDS/IB: track signaled sends

RDS/IB: track signaled sends

We're seeing bugs today where IB connection shutdown clears the send
ring while the tasklet is processing completed sends.  Implementation
details cause this to dereference a null pointer.  Shutdown needs to
wait for send completion to stop before tearing down the connection.  We
can't simply wait for the ring to empty because it may contain
unsignaled sends that will never be processed.

This patch tracks the number of signaled sends that we've posted and
waits for them to complete.  It also makes sure that the tasklet has
finished executing.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: remove __init and __exit annotation
Zach Brown [Sat, 10 Jul 2010 02:26:20 +0000 (19:26 -0700)]
RDS: remove __init and __exit annotation

RDS: remove __init and __exit annotation

The trivial amount of memory saved isn't worth the cost of dealing with section
mismatches.

Signed-off-by: Zach Brown <zach.brown@oracle.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: fix races and other problems with rmmod and device removal
Zach Brown [Fri, 3 Feb 2012 16:07:18 +0000 (11:07 -0500)]
RDS: fix races and other problems with rmmod and device removal

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: properly init the sg table in our frags
Chris Mason [Fri, 3 Feb 2012 16:07:18 +0000 (11:07 -0500)]
RDS: properly init the sg table in our frags

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agoRDS: add support for atomic messages over the wire
Andy Grover [Fri, 3 Feb 2012 16:07:18 +0000 (11:07 -0500)]
RDS: add support for atomic messages over the wire

Signed-off-by: Chris Mason <chris.mason@oracle.com>
Signed-off-by: Bang Nguyen <bang.nguyen@oracle.com>
10 years agords: fix compilation warnings
Dotan Barak [Sun, 11 Dec 2011 13:17:24 +0000 (15:17 +0200)]
rds: fix compilation warnings

Fix the following compilation warnings:
ofed_kernel/net/rds/iw_cm.c: In function rds_iw_qp_event_handler:
ofed_kernel/net/rds/iw_cm.c:162: warning: too many arguments for format
ofed_kernel/net/rds/af_rds.c:384: warning: initialization from incompatible pointer type

Signed-off-by: Dotan Barak <dotanb@dev.mellanox.co.il>
Reviewed-by: Erez Shitrit <erezsh@mellanox.co.il>
10 years agoFix backports for rds
Eli Cohen [Mon, 4 Apr 2011 07:58:01 +0000 (10:58 +0300)]
Fix backports for rds

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
10 years agoRDS: Fix BUG_ONs to not fire when in a tasklet
Andy Grover [Sat, 13 Mar 2010 00:22:32 +0000 (16:22 -0800)]
RDS: Fix BUG_ONs to not fire when in a tasklet

in_interrupt() is true in softirqs. The BUG_ONs are supposed
to check for if irqs are disabled, so we should use
BUG_ON(irqs_disabled()) instead, duh.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Enable per-cpu workqueue threads
Tina Yang [Thu, 11 Mar 2010 21:18:42 +0000 (13:18 -0800)]
RDS: Enable per-cpu workqueue threads

Create per-cpu workqueue threads instead of a single
krdsd thread. This is a step towards better scalability.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Do not call set_page_dirty() with irqs off
Andy Grover [Thu, 11 Mar 2010 20:37:05 +0000 (12:37 -0800)]
RDS: Do not call set_page_dirty() with irqs off

set_page_dirty() unconditionally re-enables interrupts, so
if we call it with irqs off, they will be on after the call,
and that's bad. This patch moves the call after we've re-enabled
interrupts in send_drop_to(), so it's safe.

Also, add BUG_ONs to let us know if we ever do call set_page_dirty
with interrupts off.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Properly unmap when getting a remote access error
Sherman Pun [Tue, 9 Mar 2010 20:36:19 +0000 (12:36 -0800)]
RDS: Properly unmap when getting a remote access error

If the RDMA op has aborted with a remote access error,
in addition to what we already do (tell userspace it has
completed with an error) also unmap it and put() the rm.

Otherwise, hangs may occur on arches that track maps and
will not exit without proper cleanup.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: only put sockets that have seen congestion on the poll_waitq
Andy Grover [Wed, 24 Feb 2010 01:37:50 +0000 (17:37 -0800)]
RDS: only put sockets that have seen congestion on the poll_waitq

rds_poll_waitq's listeners will be awoken if we receive a congestion
notification. Bad performance may result because *all* polled sockets
contend for this single lock. However, it should not be necessary to
wake pollers when a congestion update arrives if they have never
experienced congestion, and not putting these on the waitq will
hopefully greatly reduce contention.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Fix locking in rds_send_drop_to()
Tina Yang [Sat, 20 Feb 2010 00:53:00 +0000 (16:53 -0800)]
RDS: Fix locking in rds_send_drop_to()

Signed-off-by: Tina Yang <tina.yang@oracle.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Turn down alarming reconnect messages
Andy Grover [Tue, 16 Feb 2010 23:41:15 +0000 (15:41 -0800)]
RDS: Turn down alarming reconnect messages

RDS's error messages when a connection goes down are a little
extreme. A connection may go down, and it will be re-established,
and everything is fine. This patch links these messages through
rdsdebug(), instead of to printk directly.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Workaround for in-use MRs on close causing crash
Andy Grover [Tue, 16 Feb 2010 21:54:12 +0000 (13:54 -0800)]
RDS: Workaround for in-use MRs on close causing crash

if a machine is shut down without closing sockets properly, and
freeing all MRs, then a BUG_ON will bring it down. This patch
changes these to WARN_ONs -- leaking MRs is not fatal (although
not ideal, and there is more work to do here for a proper fix.)

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Fix send locking issue
Tina Yang [Fri, 29 Jan 2010 00:19:41 +0000 (16:19 -0800)]
RDS: Fix send locking issue

Fix a deadlock between rds_rdma_send_complete() and
rds_send_remove_from_sock() when rds socket lock and
rds message lock are acquired out-of-order.

Signed-off-by: Tina Yang <Tina.Yang@oracle.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Fix congestion issues for loopback
Andy Grover [Wed, 20 Jan 2010 23:01:05 +0000 (15:01 -0800)]
RDS: Fix congestion issues for loopback

We have two kinds of loopback: software (via loop transport)
and hardware (via IB). sw is used for 127.0.0.1, and doesn't
support rdma ops. hw is used for sends to local device IPs,
and supports rdma. Both are used in different cases.

For both of these, when there is a congestion map update, we
want to call rds_cong_map_updated() but not actually send
anything -- since loopback local and foreign congestion maps
point to the same spot, they're already in sync.

The old code never called sw loop's xmit_cong_map(),so
rds_cong_map_updated() wasn't being called for it. sw loop
ports would not work right with the congestion monitor.

Fixing that meant that hw loopback now would send congestion maps
to itself. This is also undesirable (racy), so we check for this
case in the ib-specific xmit code.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS/TCP: Wait to wake thread when write space available
Andy Grover [Tue, 5 Jan 2010 05:25:53 +0000 (21:25 -0800)]
RDS/TCP: Wait to wake thread when write space available

Instead of waking the send thread whenever any send space is available,
wait until it is at least half empty. This is modeled on how
sock_def_write_space() does it, and may help to minimize context
switches.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: use IB_CQ_VECTOR_LEAST_ATTACHED for cq's
Andy Grover [Tue, 5 Jan 2010 05:11:40 +0000 (21:11 -0800)]
RDS: use IB_CQ_VECTOR_LEAST_ATTACHED for cq's

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: update copy_to_user state in tcp transport
Andy Grover [Thu, 17 Dec 2009 19:02:27 +0000 (11:02 -0800)]
RDS: update copy_to_user state in tcp transport

Other transports use rds_page_copy_user, which updates our
s_copy_to_user counter. TCP doesn't, so it needs to explicity
call rds_stats_add().

Reported-by: Richard Frank <richard.frank@oracle.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: sendmsg() should check sndtimeo, not rcvtimeo
Andy Grover [Mon, 14 Dec 2009 22:38:56 +0000 (14:38 -0800)]
RDS: sendmsg() should check sndtimeo, not rcvtimeo

Most likely cut n paste error - sendmsg() was checking sock_rcvtimeo.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Do not BUG() on error returned from ib_post_send
Andy Grover [Tue, 8 Dec 2009 00:06:53 +0000 (16:06 -0800)]
RDS: Do not BUG() on error returned from ib_post_send

BUGging on a runtime error code should be avoided. This
patch also eliminates all other BUG()s that have no real
reason to exist.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Re-add pf/sol access via sysctl
Andy Grover [Tue, 24 Nov 2009 23:35:51 +0000 (15:35 -0800)]
RDS: Re-add pf/sol access via sysctl

Although RDS has an official PF_RDS value now, existing software
expects to look for rds sysctls to determine it. We need to maintain
these for now, for backwards compatibility.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS/IB+IW: Move recv processing to a tasklet
Andy Grover [Wed, 23 Sep 2009 22:52:10 +0000 (15:52 -0700)]
RDS/IB+IW: Move recv processing to a tasklet

Move receive processing from event handler to a tasklet.
This should help prevent hangcheck timer from going off
when RDS is under heavy load.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Do not send congestion updates to loopback connections
Andy Grover [Thu, 20 Aug 2009 21:43:05 +0000 (14:43 -0700)]
RDS: Do not send congestion updates to loopback connections

This issue was discovered by HP's Pradeep and fixed in OFED
1.3, but not fixed in later versions, since the fix's implementation
was not immediately applyable to the later code. This patch should
do the trick for 1.4+ codebases.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Fix panic on unload
Andy Grover [Fri, 14 Aug 2009 23:34:48 +0000 (16:34 -0700)]
RDS: Fix panic on unload

Remove explicit destruction of passive connection when destroying
active end of the connection. The passive end is also on the
device's connection list, and will thus be cleaned up properly.
Panic was caused by trying to clean it up twice.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Fix potential race around rds_i[bw]_allocation
Andy Grover [Thu, 13 Aug 2009 20:30:36 +0000 (13:30 -0700)]
RDS: Fix potential race around rds_i[bw]_allocation

From Shin Hong:

"At rds_ib_recv_refill_one(), it first executes atomic_read(&rds_ib_allocation)
for if-condition checking,

and then executes atomic_inc(&rds_ib_allocation) if the condition was
not satisfied.

However, if any other code which updates rds_ib_allocation executes
between these two atomic operation executions,
it seems that it may result race condition. (especially when
rds_ib_allocation + 1 == rds_ib_sysctl_max_recv_allocation)"

This patch fixes this by using atomic_inc_unless to eliminate the
possibility of allocating more than rds_ib_sysctl_max_recv_allocation
and then decrementing the count if the allocation fails. It also
makes an identical change to the iwarp transport.

Reported-by: Shin Hong <hongshin@gmail.com>
Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Add GET_MR_FOR_DEST sockopt
Andy Grover [Tue, 6 Oct 2009 03:24:31 +0000 (20:24 -0700)]
RDS: Add GET_MR_FOR_DEST sockopt

RDS currently supports a GET_MR sockopt to establish a
memory region (MR) for a chunk of memory. However, the fastreg
method ties a MR to a particular destination. The GET_MR_FOR_DEST
sockopt allows the remote machine to be specified, and thus
support for fastreg (aka FRWRs).

Note that this patch does *not* do all of this - it simply
implements the new sockopt in terms of the old one, so applications
can begin to use the new sockopt in preparation for cutover to
FRWRs.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Add a debug message suggesting to load transport modules
Andy Grover [Wed, 12 Aug 2009 22:43:08 +0000 (15:43 -0700)]
RDS: Add a debug message suggesting to load transport modules

Now that RDS transports are no longer compiled-in to RDS core,
there is now the possibility that they will not be loaded. This
adds a helpful suggestion when rds_bind() fails to find a transport.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Track transports via an array, not a list
Andy Grover [Wed, 12 Aug 2009 19:42:09 +0000 (12:42 -0700)]
RDS: Track transports via an array, not a list

Now that transports can be loaded in arbitrary order,
it is important for rds_trans_get_preferred() to look
for them in a particular order, instead of walking the list
until it finds a transport that works for a given address.
Now, each transport registers for a specific transport slot,
and these are ordered so that preferred transports come first,
and then if they are not loaded, other transports are queried.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Modularize RDMA and TCP transports
Andy Grover [Wed, 12 Aug 2009 19:37:50 +0000 (12:37 -0700)]
RDS: Modularize RDMA and TCP transports

Enable the building of transports as modules.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Export symbols from core RDS
Andy Grover [Wed, 12 Aug 2009 19:34:17 +0000 (12:34 -0700)]
RDS: Export symbols from core RDS

Now that rdma and tcp transports will be modularized,
we need to export a number of functions so they can call them.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Re-add TCP transport to RDS
Andy Grover [Wed, 12 Aug 2009 19:25:20 +0000 (12:25 -0700)]
RDS: Re-add TCP transport to RDS

This code allows RDS to be tunneled over a TCP connection.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS/IB: Drop connection when a fatal QP event is received
Andy Grover [Wed, 13 May 2009 04:48:41 +0000 (21:48 -0700)]
RDS/IB: Drop connection when a fatal QP event is received

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS/IB: Disable flow control in sysctl and explain why
Andy Grover [Wed, 13 May 2009 03:02:44 +0000 (20:02 -0700)]
RDS/IB: Disable flow control in sysctl and explain why

Backwards compatibility with rds 3.0 causes protocol-
based flow control to be disabled as a side-effect.

I don't want to pull out FC support from the IB transport
but I do want to document and keep the sysctl consistent
if possible.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS/IB: Move tx/rx ring init and refill to later
Andy Grover [Wed, 13 May 2009 03:24:23 +0000 (20:24 -0700)]
RDS/IB: Move tx/rx ring init and refill to later

Since RDS 3.0 and 3.1 have different packet formats,
we need to wait until after protocol negotiation
is complete to layout the rx buffers.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Don't set c_version in __rds_conn_create()
Andy Grover [Wed, 13 May 2009 03:21:31 +0000 (20:21 -0700)]
RDS: Don't set c_version in __rds_conn_create()

Protocol negotiation is logically a property of the
transports, so rds core need not set it.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS/IB: Rename byte_len to data_len to enhance readability
Andy Grover [Mon, 11 May 2009 23:05:50 +0000 (16:05 -0700)]
RDS/IB: Rename byte_len to data_len to enhance readability

Of course len is in bytes. Calling it data_len hopefully indicates
a little better what the variable is actually for.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS/RDMA: Fix cut-n-paste errors in printks in rdma_transport.c
Andy Grover [Thu, 7 May 2009 20:33:45 +0000 (13:33 -0700)]
RDS/RDMA: Fix cut-n-paste errors in printks in rdma_transport.c

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS/IB: Fix printk to indicate remote IP, not local
Andy Grover [Thu, 7 May 2009 21:01:12 +0000 (14:01 -0700)]
RDS/IB: Fix printk to indicate remote IP, not local

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS/IB: Handle connections using RDS 3.0 wire protocol
Andy Grover [Thu, 7 May 2009 20:48:35 +0000 (13:48 -0700)]
RDS/IB: Handle connections using RDS 3.0 wire protocol

The big differences between RDS 3.0 and 3.1 are protocol-level
flow control, and with 3.1 the header is in front of the data. The header
always ends up in the header buffer, and the data goes in the data page.

In 3.0 our "header" is a trailer, and will end up either in the data
page, the header buffer, or split across the two. Since 3.1 is backwards-
compatible with 3.0, we need to continue to support these cases. This
patch does that -- if using RDS 3.0 wire protocol, it will copy the header
from wherever it ended up into the header buffer.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS/IB: Improve RDS protocol version checking
Andy Grover [Thu, 7 May 2009 20:17:12 +0000 (13:17 -0700)]
RDS/IB: Improve RDS protocol version checking

RDS on IB uses privdata to do protocol version negotiation. Apparently
the IB stack will return a larger privdata buffer than the struct we were
expecting. Just to be extra-sure, this patch adds some checks in this area.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Set retry_count to 2 and make modifiable via modparam
Andy Grover [Wed, 14 Jan 2009 02:51:28 +0000 (18:51 -0800)]
RDS: Set retry_count to 2 and make modifiable via modparam

This will be default cause IB connections to failover faster,
but allow a longer retry count to be used if desired.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Refactor end of __conn_create for readability
Andy Grover [Wed, 15 Jul 2009 01:25:53 +0000 (18:25 -0700)]
RDS: Refactor end of __conn_create for readability

Add a comment for what's going on. Remove negative logic.
I find this much easier to understand quickly, although
there are a few lines duplicated.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS/IW: Remove dead code
Andy Grover [Tue, 16 Jun 2009 01:00:15 +0000 (18:00 -0700)]
RDS/IW: Remove dead code

In iWARP code, node_type will always be RNIC

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS/IW: Remove page_shift variable from iwarp transport
Andy Grover [Mon, 15 Jun 2009 22:29:00 +0000 (15:29 -0700)]
RDS/IW: Remove page_shift variable from iwarp transport

The existing code treated page_shift as a variable, when in fact we
always want to have the fastreg page size be the same as the arch's
page size -- and it is, so this doesn't need to be a variable.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS/IB: Always use PAGE_SIZE for FMR page size
Andy Grover [Mon, 15 Jun 2009 21:58:16 +0000 (14:58 -0700)]
RDS/IB: Always use PAGE_SIZE for FMR page size

While FMRs allow significant flexibility in what size of pages they can use,
we really just want FMR pages to match CPU page size. Roland says we can
count on this always being supported, so this simplifies things.

Signed-off-by: Andy Grover <andy.grover@oracle.com>
10 years agoRDS: Fix completion notifications on blocking sockets
Andy Grover [Tue, 9 Jun 2009 23:13:21 +0000 (16:13 -0700)]
RDS: Fix completion notifications on blocking sockets

Completion or congestion notifications were not being checked
if the socket went to sleep. This patch fixes that.

Signed-off-by: Andy Grover <andy.grover@oracle.com>