]> www.infradead.org Git - users/jedix/linux-maple.git/log
users/jedix/linux-maple.git
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>
10 years agoFRV: Fix the section attribute on UP DECLARE_PER_CPU()
David Howells [Tue, 21 Apr 2009 22:00:24 +0000 (23:00 +0100)]
FRV: Fix the section attribute on UP DECLARE_PER_CPU()

In non-SMP mode, the variable section attribute specified by DECLARE_PER_CPU()
does not agree with that specified by DEFINE_PER_CPU().  This means that
architectures that have a small data section references relative to a base
register may throw up linkage errors due to too great a displacement between
where the base register points and the per-CPU variable.

On FRV, the .h declaration says that the variable is in the .sdata section, but
the .c definition says it's actually in the .data section.  The linker throws
up the following errors:

kernel/built-in.o: In function `release_task':
kernel/exit.c:78: relocation truncated to fit: R_FRV_GPREL12 against symbol `per_cpu__process_counts' defined in .data section in kernel/built-in.o
kernel/exit.c:78: relocation truncated to fit: R_FRV_GPREL12 against symbol `per_cpu__process_counts' defined in .data section in kernel/built-in.o

To fix this, DECLARE_PER_CPU() should simply apply the same section attribute
as does DEFINE_PER_CPU().  However, this is made slightly more complex by
virtue of the fact that there are several variants on DEFINE, so these need to
be matched by variants on DECLARE.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
10 years agords: revert RDS code to 8cbd960 commit to rebase UEK commits
Mukesh Kacker [Tue, 7 Jul 2015 23:17:18 +0000 (16:17 -0700)]
rds: revert RDS code to 8cbd960 commit to rebase UEK commits

reverting net/rds code to following commit:
8cbd960 2009-04-01 RDS: Use spinlock to protect 64b value update on 32b
archs [Andy Grover]

This is common ancestor point for RDS code in Linux kernel repository
and Mellanox OFED-1.5.5 R2 repository.

From this point, we fetch RDS code from Mellanox OFED-1.5.5 repository.

Signed-off-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
--------------
Revert details:
--------------
Revert "net/rds: RDS-TCP: only initiate reconnect attempt on outgoing TCP socket."
This reverts commit c82ac7e69efe6dbe370d6ba84e2666d7692ef1c2.

Revert "net/rds: RDS-TCP: Always create a new rds_sock for an incoming connection."
This reverts commit f711a6ae062caeee46067b2f2f12ffda319ae73c.

Revert "net/rds: Fix new sparse warning"
This reverts commit e2783717a71e9babfdd7c36c7e35b790d2c01022.

Revert "net/rds: fix unaligned memory access"
This reverts commit c0adf54a10903b59037a4c5fcb933dfeeb7b2624.

Revert "net: Remove iocb argument from sendmsg and recvmsg" for net/rds
This reverts commit 1b784140474e4fc94281a49e96c67d29df0efbde for net/rds.

Revert "RDS: make sure not to loop forever inside rds_send_xmit"
This reverts commit 443be0e5affe3acb6dd81e7402951677e0a0eb35.

Revert "RDS: only use passive connections when addresses match"
This reverts commit 1789b2c077f6d6c82b04cfe49a0fec020dc42488.

Revert "rds: avoid potential stack overflow"
This reverts commit f862e07cf95d5b62a5fc5e981dd7d0dbaf33a501.

Revert "rds: rds_cong_queue_updates needs to defer the congestion update transmission"
This reverts commit 80ad0d4a7a75158f2824d541e4802c88aba4f063.

Revert "rds: Make rds_message_copy_from_user() return 0 on success."
This reverts commit d0a47d32724bf0765b8768086ef1a7a6d074a7a0.

Revert "net: rds: Remove repeated function names from debug output"
This reverts commit 11ac11999bae3c353f86b6e7dd0e43d4a0eada12.

Revert "net: rds: use correct size for max unacked packets and bytes"
This reverts commit db27ebb111e9f69efece08e4cb6a34ff980f8896.

Revert "rds: Fix min() warning in rds_message_inc_copy_to_user()"
This reverts commit 6ff4a8ad4b6eae5171754fb60418bc81834aa09b.

Revert "net: introduce helper macro for_each_cmsghdr" for net/rds
This reverts commit f95b414edb18de59940dcebbefb49cf25c6d505c for net/rds

Revert "put iov_iter into msghdr" for net/rds
This reverts commit c0371da6047abd261bc483c744dbc7d81a116172 for net/rds

Revert "rds: switch rds_message_copy_from_user() to iov_iter"
This reverts commit 083735f4b01b703184c0e11c2e384b2c60a8aea4.

Revert "rds: switch ->inc_copy_to_user() to passing iov_iter"
This reverts commit c310e72c89926e06138e4881f21e4c8da3e7ef18.

Revert "rds: avoid calling sock_kfree_s() on allocation failure"
This reverts commit dee49f203a7feef5d00c416b7dc7e34a7caba8e1.

Revert "net/rds: fix possible double free on sock tear down"
This reverts commit 593cbb3ec6a3f2424966832727f394b1696d0d72.

Revert "net/rds: do proper house keeping if connection fails in rds_tcp_conn_connect"
This reverts commit eb74cc97b830c1e438dc1d6b049f17bdb2b9aae5.

Revert "net/rds: call rds_conn_drop instead of open code it at rds_connect_complete"
This reverts commit 310886dd5fa3606d9325b10caf7c8ba5e9f9ab03.

Revert "treewide: fix synchronize_rcu() in comments" for net/rds
This reverts commit d7cdb968081727746c8d2fb31b12ea6d1694888e for net/rds.

Revert "net: Replace get_cpu_var through this_cpu_ptr" for net/rds
This reverts commit 903ceff7ca7b4d80c083a80ee5163b74e9fa359f for net/rds.

Revert "rds/tcp_listen: Replace comma with semicolon"
This reverts commit 01728371dc261c876d07e9228a55a096b6d9a1f9.

Revert "RDS/RDMA: Replace comma with semicolon"
This reverts commit cc2afe9fe25d99cbe19eac57c0f8f098b2710b7c.

Revert "net: rds: Use time_after() for time comparison"
This reverts commit 71fd762f2eef6acc848e262ac934fc694b49204e.

Revert "rds: remove the unneed NULL checking"
This reverts commit be7faf7168e831f17b85a96f2f797f504b66cfd7.

Revert "arch: Mass conversion of smp_mb__*()" for net/rds
This reverts commit 4e857c58efeb99393cba5a5d0d8ec7117183137c for net/rds.

Revert "net: Fix use after free by removing length arg from sk_data_ready callbacks." for net/rds
This reverts commit 676d23690fb62b5d51ba5d659935e9f7d9da9f8e for net/rds.

Revert "rds: prevent dereference of a NULL device in rds_iw_laddr_check"
This reverts commit bf39b4247b8799935ea91d90db250ab608a58e50.

Revert "net: add build-time checks for msg->msg_name size" for net/rds
This reverts commit 342dfc306fb32155314dad277f3c3686b83fb9f1 for net/rds.

Revert "net: rds: fix per-cpu helper usage"
This reverts commit c196403b79aa241c3fefb3ee5bb328aa7c5cc860.

Revert "net: replace macros net_random and net_srandom with direct calls to prandom" for net/rds
This reverts commit 63862b5bef7349dd1137e4c70702c67d77565785 for net/rds.

Revert "rds: prevent dereference of a NULL device"
This reverts commit c2349758acf1874e4c2b93fe41d072336f1a31d0.

Revert "rds: prevent BUG_ON triggered on congestion update to loopback"
This reverts commit 18fc25c94eadc52a42c025125af24657a93638c0.

Revert "net: rework recvmsg handler msg_name and msg_namelen logic" for net/rds
This reverts commit f3d3342602f8bcbf37d7c46641cb9bca7618eb1c for net/rds.

Revert "inet: convert inet_ehash_secret and ipv6_hash_secret to net_get_random_once" for net/rds
This reverts commit 1bbdceef1e535add893bf71d7b7ab102e4eb69eb for net/rds.

Revert "ipv4: split inet_ehashfn to hash functions per compilation unit" for net/rds
This reverts commit 65cd8033ff375b68037df61603ee68070dc48578 for net/rds.

Revert "net: misc: Remove extern from function prototypes" for net/rds
This reverts commit c1b1203d65955c179fec617ff17a21273f33a414 for net/rds.

Revert "net: Convert uses of typedef ctl_table to struct ctl_table" for net/rds
This reverts commit fe2c6338fd2c6f383c4d4164262f35c8f3708e1f for net/rds.

Revert "net/rds: zero last byte for strncpy"
This reverts commit 2e85d67690cf3ea3f074a6e872f675226883fe7f.

Revert "rds: simplify a warning message"
This reverts commit 7dac1b514a00817ddb43704068c14ffd8b8fba19.

Revert "rds: limit the size allocated by rds_message_alloc()"
This reverts commit ece6b0a2b25652d684a7ced4ae680a863af041e0.

Revert "hlist: drop the node parameter from iterators" for net/rds
This reverts commit b67bfe0d42cac56c512dd5da4b1b347a23f4b70a for net/rds.

Revert "net/rds: remove depends on CONFIG_EXPERIMENTAL"
This reverts commit e34430eeca6f3bd2308d4b4917cfb3a4367c2073.

Revert "IB/rds: suppress incompatible protocol when version is known"
This reverts commit a49675988c127b5b5876c252e5db2ee0410a10c2.

Revert "IB/rds: Correct ib_api use with gs_dma_address/sg_dma_len"
This reverts commit f2e9bd70327d788011cf787a51ceba5925bbc63a.

Revert "net: rds: use this_cpu_* per-cpu helper"
This reverts commit ae4b46e9d7128d2d76e6857fe0b9fc240e8ac695.

Revert "UAPI: (Scripted) Disintegrate include/linux" for
       include/linux/rds.h and include/uapi/linux/rds.h
This reverts commit 607ca46e97a1b6594b29647d98a32d545c24bdff for
       include/linux/rds.h and include/uapi/linux/rds.h

Revert "RDS: fix rds-ping spinlock recursion"
This reverts commit 5175a5e76bbdf20a614fb47ce7a38f0f39e70226.

Revert "rds: Don't disable BH on BH context"
This reverts commit bfdc587c5af4ff155cf702b972e8fcd66d77d5f2.

Revert "rds: set correct msg_namelen"
This reverts commit 06b6a1cf6e776426766298d055bb3991957d90a7.

Revert "net: Fix (nearly-)kernel-doc comments for various functions" for net/rds
This reverts commit 2c53040f018b6c36a46eec75b9b937aaa5f78e6d for net/rds.

Revert "rds_rdma: don't assume infiniband device is PCI"
This reverts commit a0c6ffbcfe600606b2d913dded4dc6b37b3bbbfd.

Revert "sock: Introduce named constants for sk_reuse" for net/rds
This reverts commit 4a17fd5229c1b6066aa478f6b690f8293ce811a1 for net/rds.

Revert "net: Convert all sysctl registrations to register_net_sysctl" for net/rds
This reverts commit ec8f23ce0f4005b74013d4d122e0d540397a93c9 for net/rds.

Revert "net: Move all of the network sysctls without a namespace into init_net." for net/rds
This reverts commit 5dd3df105b9f6cb7dd2472b59e028d0d1c878ecb for net/rds.

Revert "RDS: use gfp flags from caller in conn_alloc()"
This reverts commit f0229eaaf3f82522e2b16b41b0f45bb84a88d1b0.

Revert "Remove printk from rds_sendmsg"
This reverts commit a6506e1486181975d318344143aca722b2b91621.

Revert "rds: remove the second argument of k[un]map_atomic()"
This reverts commit 6114eab535ab49239e0a6ce08eb9243664aef993.

Revert "rds: Fix typo in iw_recv.c and ib_recv.c"
This reverts commit 5fd5c44d3f27c93685d4a036565245f3cdb8c033.

Revert "rds: Make rds_sock_lock BH rather than IRQ safe."
This reverts commit efc3dbc37412c027e363736b4f4c74ee5e8ecffc.

Revert "RDS: Remove some unused iWARP code"
This reverts commit 5b7bf42e3d47fb16aaf53776ae3eaaf1be247a35.

Revert "rds: drop "select LLIST""
This reverts commit 77c1c7c4bd4751dbf47cdacd0e73e67f0a1ed316.

Revert "treewide: use __printf not __attribute__((format(printf,...)))" for net/rds
This reverts commit b9075fa968a0a4347aef35e235e2995c0e57dddd for net/rds.

Revert "net: Add export.h for EXPORT_SYMBOL/THIS_MODULE to non-modules" for net/rds
This reverts commit bc3b2d7fb9b014d75ebb79ba371a763dbab5e8cf for net/rds.

Revert "net: add moduleparam.h for users of module_param/MODULE_PARM_DESC" for net/rds
This reverts commit d9b9384215e17c68d7b6bd05d6fa409e5d4140d7 for net/rds.

Revert "net: Fix files explicitly needing to include module.h" for net/rds
This reverts commit 3a9a231d977222eea36eae091df2c358e03ac839 for net/rds.

Revert "RDSRDMA: Fix cleanup of rds_iw_mr_pool"
This reverts commit 85a64889492b45f931ddac87ec09d84aa7347ee1.

Revert "net, rds, Replace xlist in net/rds/xlist.h with llist"
This reverts commit 1bc144b62524970c8580f6d97a6df0e71c6ee388.

Revert "net: Convert vmalloc/memset to vzalloc" for net/rds
This reverts commit 3dbd4439837f2cfd2ff302897353f4b1b6263b2a for net/rds.

Revert "notifiers: cpu: move cpu notifiers into cpu.h" for net/rds
This reverts commit 80f1ff97d0a9d92f44d2b2dd9425afa950e58f2b for net/rds.

Revert "net: rds: fix const array syntax"
This reverts commit 3e878b8d54e0fc12df363ee8e4a638c8147aac98.

Revert "net/rds: use prink_ratelimited() instead of printk_ratelimit()"
This reverts commit cb0a60564943db21ed3af975ac3d578cdc80b329.

Revert "net: remove interrupt.h inclusion from netdevice.h" for net/rds
This reverts commit a6b7a407865aab9f849dd99a71072b7cd1175116 for net/rds.

Revert "RDMA/cma: Pass QP type into rdma_create_id()" for net/rds
This reverts commit b26f9b9949013fec31b23c426fc463164ae08891 for net/rds.

Revert "Fix common misspellings" for net/rds
This reverts commit 25985edcedea6396277003854657b5f3cb31a628 for net/rds.

Revert "rds: use little-endian bitops"
This reverts commit e1dc1c81b9d1c823f2a529b9b9cf8bf5dacbce6a.

Revert "rds: stop including asm-generic/bitops/le.h directly"
This reverts commit 12ce22423abacca70bf1dfbcb8543b3e2b74aad4.

Revert "rds: prevent BUG_ON triggering on congestion map updates"
This reverts commit 6094628bfd94323fc1cea05ec2c6affd98c18f7f.

Revert "rds/ib: use system_wq instead of rds_ib_fmr_wq"
This reverts commit c534a107e8fe446202b0fab102abc015c56c0317.

Revert "net: cleanup unused macros in net directory" for net/rds
This reverts commit 441c793a56502638d45d5da2195056d686147370 for net/rds.

Revert "Net: rds: Makefile: Remove deprecated items"
This reverts commit 094f2faaa2c4973e50979158f655a1d31a97ba98.

Revert "rds: Integer overflow in RDS cmsg handling"
This reverts commit 218854af84038d828a32f061858b1902ed2beec6.

Revert "rds: Fix rds message leak in rds_message_map_pages"
This reverts commit aa58163a76a3aef33c7220931543d45d0fe43753.

Revert "rds: Remove kfreed tcp conn from list"
This reverts commit 8200a59f24aeca379660f80658a8c0c343ca5c31.

Revert "rds: Lost locking in loop connection freeing"
This reverts commit 58c490babd4b425310363cbd1f406d7e508f77a5.

Revert "RDS: Let rds_message_alloc_sgs() return NULL"
This reverts commit d139ff0907dac9ef72fb2cf301e345bac3aec42f.

Revert "RDS: Copy rds_iovecs into kernel memory instead of rereading from userspace"
This reverts commit fc8162e3c034af743d8def435fda6396603d321f.

Revert "RDS: Clean up error handling in rds_cmsg_rdma_args"
This reverts commit f4a3fc03c1d73753879fb655b8cd628b29f6706b.

Revert "RDS: Return -EINVAL if rds_rdma_pages returns an error"
This reverts commit a09f69c49b84b161ebd4dd09d3cce1b68297f1d3.

Revert "net: fix rds_iovec page count overflow"
This reverts commit 1b1f693d7ad6d193862dcb1118540a030c5e761f.

Revert "rds: make local functions/variables static"
This reverts commit ff51bf841587c75b58d25ed77263158619784dd3.

Revert "De-pessimize rds_page_copy_user"
This reverts commit 799c10559d60f159ab2232203f222f18fa3c4a5f.

Revert "net: fix a lockdep splat" for net/rds
This reverts commit f064af1e500a2bf4607706f0f458163bdb2a6ea5 for net/rds.

Revert "rds: spin_lock_irq() is not nestable"
This reverts commit aef3ea33e85035f7c827c1db9155f97f4b7ee725.

Revert "rds: double unlock in rds_ib_cm_handle_connect()"
This reverts commit f4fa7f3807d41b78056c6648b04bfadd737df21e.

Revert "rds: signedness bug"
This reverts commit 9b9d2e00bfa592aceda7b43da76c670df61faa97.

Revert "RDS: Remove dead struct from rds.h"
This reverts commit 905d64c89e2a9d71d0606904b7c3908633db6072.

Revert "RDS: rds.h: Replace u_int[size]_t with uint[size]_t"
This reverts commit a46f561b774d90d8616473d56696e7d44fa1c9f1.

Revert "RDS: Add rds.h to exported headers list" for include/linux/rds.h
This reverts commit fd128dfa50cfc4f2959dc4aa5d7468d33b988332 for include/linux/rds.h.

Revert "RDS: Implement masked atomic operations"
This reverts commit 20c72bd5f5f902e5a8745d51573699605bf8d21c.

Revert "RDS/IB: print string constants in more places"
This reverts commit 59f740a6aeb2cde2f79fe0df38262d4c1ef35cd8.

Revert "RDS: cancel connection work structs as we shut down"
This reverts commit 4518071ac1bcb76c64a55a3fddb39fb3d39add41.

Revert "RDS: don't call rds_conn_shutdown() from rds_conn_destroy()"
This reverts commit ffcec0e110c198717eb0f6ac000c1e5397db9451.

Revert "RDS: have sockets get transport module references"
This reverts commit 5adb5bc65f93e52341c3fc9d03d4030dd375e256.

Revert "RDS: remove old rs_transport comment"
This reverts commit 77510481c0c3980c8979ed236d63e59221fb8ce5.

Revert "RDS: lock rds_conn_count decrement in rds_conn_destroy()"
This reverts commit fe8ff6b58f040dd52d2db45972db8e0301847f1c.

Revert "RDS/IB: protect the list of IB devices"
This reverts commit ea819867b788728aca60717e4fdacb3df771f670.

Revert "RDS/IB: print IB event strings as well as their number"
This reverts commit 1bde04a63d532c2540d6fdee0a661530a62b1686.

Revert "RDS: flush fmrs before allocating new ones"
This reverts commit 8576f374ac9537674e3cccb0a9d43fa2b7ebbf5b.

Revert "RDS: properly use sg_init_table"
This reverts commit b4e1da3c9a0ac9b01f45a8578b7347e3a31f9fb8.

Revert "RDS/IB: track signaled sends"
This reverts commit f046011cd73c372267befd10242988eb744649fe.

Revert "RDS: remove __init and __exit annotation"
This reverts commit ef87b7ea39a91906218a262686bcb8bad8b6b46e.

Revert "RDS/IB: Use SLAB_HWCACHE_ALIGN flag for kmem_cache_create()"
This reverts commit c20f5b9633bb0953bd2422f0f1430a2028cdbd0a.

Revert "RDS/IB: always process recv completions"
This reverts commit d455ab64096b9a86849c7315c53e595330842db6.

Revert "RDS: return to a single-threaded krdsd"
This reverts commit 80c51be56ffa257d3177f0d750d90be65d30c22f.

Revert "RDS/IB: create a work queue for FMR flushing"
This reverts commit 515e079dab19cf774d1eec6e5f4ed65509e31ef1.

Revert "RDS/IB: destroy connections on rmmod"
This reverts commit 8aeb1ba6630ffd44001ae9833842794df0107676.

Revert "RDS/IB: wait for IB dev freeing work to finish during rmmod"
This reverts commit 24fa163a4bae74b3378d30e1bc776568cfca8121.

Revert "RDS/IB: Make ib_recv_refill return void"
This reverts commit b6fb0df12db6c8b6bbcc7b5c9459b3bbf5f0cee6.

Revert "RDS: Remove unused XLIST_PTR_TAIL and xlist_protect()"
This reverts commit fbf4d7e3d03587a983ee4e536251ea6c1c848ec2.

Revert "RDS: whitespace"
This reverts commit c9455d9996ba84af1f534c7e3944ea6f35d2fc54.

Revert "RDS: use delayed work for the FMR flushes"
This reverts commit 7a0ff5dbdd0b4cb7ea8764da9d78f4bb2eebaf31.

Revert "rds: more FMRs are faster"
This reverts commit eabb732279f1a41ac9d066aeb56973ae505c4cbc.

Revert "rds: recycle FMRs through lockless lists"
This reverts commit 6fa70da6081bbcf948801fd5ee0be4d222298a43.

Revert "rds: fix rds_send_xmit() serialization"
This reverts commit 0f4b1c7e89e699f588807a914ec6e6396c851a72.

Revert "rds: block ints when acquiring c_lock in rds_conn_message_info()"
This reverts commit 501dcccdb7a2335cde07d4acb56e636182d62944.

Revert "rds: remove unused rds_send_acked_before()"
This reverts commit 671202f3491cccdb267f88ad59ba0635aeb2a22e.

Revert "RDS: use friendly gfp masks for prefill"
This reverts commit 037f18a3074753991656189a091a5fa371999107.

Revert "RDS/IB: Add caching of frags and incs"
This reverts commit 33244125871734ebc0d8d147680a0d7e99385e0b.

Revert "RDS/IB: Remove ib_recv_unmap_page()"
This reverts commit fc24f78085e8771670af42f2b8929b16a0c98a22.

Revert "RDS: Assume recv->r_frag is always NULL in refill_one()"
This reverts commit 3427e854e1a0e76be8b3d75fc0fa878f59b43693.

Revert "RDS: Use page_remainder_alloc() for recv bufs"
This reverts commit 0b088e003ccf316a76c51be5dec2d70b93be3be8.

Revert "RDS/IB: disconnect when IB devices are removed"
This reverts commit fc19de38be924728fea76026c0d1a6c4b6156084.

Revert "RDS: introduce rds_conn_connect_if_down()"
This reverts commit f3c6808d3d8513db2b0543538fc35c25a60fe7a7.

Revert "RDS/IB: add refcount tracking to struct rds_ib_device"
This reverts commit 3e0249f9c05cb77b66f7f09644ca9ca208d991a9.

Revert "RDS/IB: get the xmit max_sge from the RDS IB device on the connection"
This reverts commit 89bf9d4158b5a1b6bd00960eb2e47601ec8cc138.

Revert "RDS/IB: rds_ib_cm_handle_connect() forgot to unlock c_cm_lock"
This reverts commit a46ca94e7fb2c93a59e08b42fd77d8c478fda5fc.

Revert "rds: Fix reference counting on the for xmit_atomic and xmit_rdma"
This reverts commit 1cc2228c599f173d77000a250bf0541294e1a7be.

Revert "rds: use RCU to protect the connection hash"
This reverts commit bcf50ef2ce3c5d8f2fe995259da16677898cb300.

Revert "RDS: use locking on the connection hash list"
This reverts commit abf454398c2ebafc629ebb8b149f5a752c79e919.

Revert "rds: Fix RDMA message reference counting"
This reverts commit c9e65383a20d9a656db70efbf67e57f8115ad776.

Revert "rds: don't let RDS shutdown a connection while senders are present"
This reverts commit 7e3f2952eeb1a0fe2aa9882fd1705a88f9d89b35.

Revert "rds: Use RCU for the bind lookup searches"
This reverts commit 38a4e5e61344490f18241333d7b1b368a3a38748.

Revert "RDS/IB: add _to_node() macros for numa and use {k,v}malloc_node()"
This reverts commit e4c52c98e04937ea87b0979a81354d0040d284f9.

Revert "RDS/IB: Remove unused variable in ib_remove_addr()"
This reverts commit 4a81802b5e5e0b059627d7173c917711cf35e668.

Revert "rds: rcu-ize rds_ib_get_device()"
This reverts commit 764f2dd92f5cd308d1c4372b33fea2b265c093f5.

Revert "rds: per-rm flush_wait waitq"
This reverts commit c83188dcd76b1f0c17c31b4bbd8de57c634b19f8.

Revert "rds: switch to rwlock on bind_lock"
This reverts commit 976673ee1b92d939168c8c1fbad3e16c45caa545.

Revert "RDS: Update comments in rds_send_xmit()"
This reverts commit ce47f52f42e69d48d1b63fa618fce9cd7ffa9417.

Revert "RDS: Use a generation counter to avoid rds_send_xmit loop"
This reverts commit 9e29db0e3645cafa980e68a9c717a761448389e1.

Revert "RDS: Get pong working again"
This reverts commit acfcd4d4ec4ed8cb504f96d4fabb7a94029b362b.

Revert "RDS: Do wait_event_interruptible instead of wait_event"
This reverts commit a40aa9233aa22d69212d02f92e5b607bd4d658f4.

Revert "RDS: Remove send_quota from send_xmit()"
This reverts commit fcc5450c6386526034edc437e4cb2c67a6fdd7e9.

Revert "RDS: Move atomic stats from general to ib-specific area"
This reverts commit 51e2cba8b5936c13b40f0fa11aa4e84683dbc751.

Revert "RDS: rds_message_unmapped() doesn't need to check if queue active"
This reverts commit ab1a6926f589c51e7a57ce7544d85272c4acc854.

Revert "RDS: Fix locking in send on m_rs_lock"
This reverts commit cf4b7389ee812817deeb11da1422004e01b50646.

Revert "RDS: Use NOWAIT in message_map_pages()"
This reverts commit f2ec76f288118fb18449402d75383212cbcb6762.

Revert "RDS: Bypass workqueue when queueing cong updates"
This reverts commit 2fa57129df61bf3fb7d90c5486fe15df94091f61.

Revert "RDS: Call rds_send_xmit() directly from sendmsg()"
This reverts commit a7d3a281483684f77e350b045af7f80a149fc4c7.

Revert "RDS: rds_send_xmit() locking/irq fixes"
This reverts commit 2ad8099b58f274dc23bc866ca259d7e5db87fa1a.

Revert "RDS: Change send lock from a mutex to a spinlock"
This reverts commit 049ee3f500954176a87f22e6ee3e98aecb1b8958.

Revert "RDS: Refill recv ring directly from tasklet"
This reverts commit f17a1a55fb672d7f64be7f2e940ef5669e5efa0a.

Revert "RDS: Stop supporting old cong map sending method"
This reverts commit 77dd550e5547846604ff6f90c4dc6bba4414e485.

Revert "RDS/IB: Do not wait for send ring to be empty on conn shutdown"
This reverts commit e32b4a70495aac6a612e13f4c21db09dd756ff2c.

Revert "RDS: Perform unmapping ops in stages"
This reverts commit ff3d7d36134ef7138803734fdbf91cc986ea7976.

Revert "RDS: Make sure cmsgs aren't used in improper ways"
This reverts commit aa0a4ef4ac3a3c5ffa35e32520bfbc0922ef3630.

Revert "RDS: Add flag for silent ops. Do atomic op before RDMA"
This reverts commit 2c3a5f9abb1dc5efdab8ba9a568b1661c65fd1e3.

Revert "RDS: Move some variables around for consistency"
This reverts commit 7e3bd65ebfd5d6cd76b8b979920c632d6e6b4b2a.

Revert "RDS: queue failure notifications for dropped atomic ops"
This reverts commit 940786eb0a0faf3f30898a1cc7c1540d54c1aff6.

Revert "RDS: Add a warning if trying to allocate 0 sgs"
This reverts commit ee4c7b47e46a9dea789aadb8279c8505f755b3ee.

Revert "RDS: Do not set op_active in r_m_copy_from_user()."
This reverts commit 372cd7dedfd1ea93a9ae8d9c282e910dc1b76773.

Revert "RDS: Rewrite rds_send_xmit"
This reverts commit 5b2366bd2835919e2e6a836e837eab4a9274bd46.

Revert "RDS: Rename data op members prefix from m_ to op_"
This reverts commit 6c7cc6e4694dc464ae884332f2a322973497e3cf.

Revert "RDS: Remove struct rds_rdma_op"
This reverts commit f8b3aaf2ba8ca9e27b47f8bfdff07c8b968f2c05.

Revert "RDS: purge atomic resources too in rds_message_purge()"
This reverts commit d0ab25a83c4a08cd98b73a37d3f4c069f7b4f50b.

Revert "RDS: Inline rdma_prepare into cmsg_rdma_args"
This reverts commit 4324879df06ba4db01a0b455af2d003f117e6aa3.

Revert "RDS: Implement silent atomics"
This reverts commit 241eef3e2f51fe4ad50abacd7f79c4e2d468197e.

Revert "RDS: Move loop-only function to loop.c"
This reverts commit d37c9359056f4f07b37e59810f0ece1031e280b2.

Revert "RDS/IB: Make all flow control code conditional on i_flowctl"
This reverts commit c8de3f1005e8359ea07083e37f3f993646e1adba.

Revert "RDS: Remove unsignaled_bytes sysctl"
This reverts commit 1d34f175712b59ad292ecbbaa8fc05402a1fd8ed.

Revert "RDS: rewrite rds_ib_xmit"
This reverts commit da5a06cef5724737af4315715632f0a07dd5e116.

Revert "RDS/IB: Remove ib_[header/data]_sge() functions"
This reverts commit 919ced4ce7d6ac62dd5be62d8993fe22a527d53a.

Revert "RDS/IB: Remove dead code"
This reverts commit 6f3d05db0da0b874afd2dd229bed715133532f8d.

Revert "RDS/IB: Disallow connections less than RDS 3.1"
This reverts commit f147dd9ecabf23fd63d2562ffe64252a0453ecde.

Revert "RDS/IB: eliminate duplicate code"
This reverts commit 9c030391e8741695ff6114703e4edccccb634479.

Revert "RDS: inc_purge() transport function unused - remove it"
This reverts commit 809fa148a29467954280fe8b7f97c92403f6293c.

Revert "RDS: Whitespace"
This reverts commit 6200ed7799d9225f363f157ab61f1566cfd80e19.

Revert "RDS: Do not mask address when pinning pages"
This reverts commit d22faec22c2ab2364fd8fc3c8159b0b5b28b0fd1.

Revert "RDS: Base init_depth and responder_resources on hw values"
This reverts commit 40589e74f7ba855f3a887c9d4abe9d100c5b039c.

Revert "RDS: Implement atomic operations"
This reverts commit 15133f6e67d8d646d0744336b4daa3135452cb0d.

Revert "RDS: Clear up some confusing code in send_remove_from_sock"
This reverts commit a63273d4992603979ddb181b6a8f07082839b39f.

Revert "RDS: make sure all sgs alloced are initialized"
This reverts commit f4dd96f7b27743e568cec519eff0f951c56833c6.

Revert "RDS: make m_rdma_op a member of rds_message"
This reverts commit ff87e97a9d70c9ae133d3d3d7792b26ab85f4297.

Revert "RDS: fold rdma.h into rds.h"
This reverts commit 21f79afa5fda2820671a8f64c3d0e43bb118053b.

Revert "RDS: Explicitly allocate rm in sendmsg()"
This reverts commit fc445084f185cdd877bec323bfe724a361e2292a.

Revert "RDS: cleanup/fix rds_rdma_unuse"
This reverts commit 3ef13f3c22aaea28aff383cb0883481d24885456.

Revert "RDS: break out rdma and data ops into nested structs in rds_message"
This reverts commit e779137aa76d38d5c33a98ed887092ae4e4f016f.

Revert "RDS: cleanup: remove "== NULL"s and "!= NULL"s in ptr comparisons"
This reverts commit 8690bfa17aea4c42da1bcf90a7af93d161eca624.

Revert "RDS: move rds_shutdown_worker impl. to rds_conn_shutdown"
This reverts commit 2dc393573430f853e56e25bf4b41c34ba2aa8fd6.

Revert "RDS: Fix locking in send on m_rs_lock"
This reverts commit 9de0864cf55927a7383b5ba6e48834ff3ef053de.

Revert "RDS: Rewrite rds_send_drop_to() for clarity"
This reverts commit 7c82eaf00ec7d460932be9314b29997006b799b6.

Revert "RDS: Fix corrupted rds_mrs"
This reverts commit 35b52c70534cb7193b218ec12efe6bc595312097.

Revert "RDS: Fix BUG_ONs to not fire when in a tasklet"
This reverts commit 9e2effba2c16fc3bd47da605116485afe01e0be0.

Revert "net: rds: remove duplication type definitions"
This reverts commit fcb12fd2236f49aa8fdc1568ed4ebdfe4fddc6b5.

Revert "rds: fix a leak of kernel memory"
This reverts commit f037590fff3005ce8a1513858d7d44f50053cc8f.

Revert "net: use __packed annotation" for include/linux/rds.h
This reverts commit bc10502dba37d3b210efd9f3867212298f13b78e for include/linux/rds.h.

Revert "net/rds: Add missing mutex_unlock"
This reverts commit 5daf47bb4e708fde32c1856a0d049e3c3d03c36c.

Revert "net: Remove unnecessary semicolons after switch statements" for net/rds
This reverts commit ccbd6a5a4f76e821ed36f69fdaf59817c3a7f18e for net/rds.

Revert "rdma: potential ERR_PTR dereference"
This reverts commit 24acc6895616b373475e92e49925efc3ef591563.

Revert "net: sk_sleep() helper" for net/rds
This reverts commit aa395145165cb06a0d0885221bbe0ce4a564391d for net/rds.

Revert "include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h" for net/rds
This reverts commit 5a0e3ad6af8660be21ca98a971cd00f331318c05 for net/rds.

Revert "rds: cleanup: remove unneeded variable"
This reverts commit 18062ca94714a66e75da8a22e010d0e8e61ab4cd.

Revert "RDS: Enable per-cpu workqueue threads"
This reverts commit 768bbedf9ca4cc4784eae2003f37abe0818fe0b0.

Revert "RDS: Do not call set_page_dirty() with irqs off"
This reverts commit 561c7df63e259203515509a7ad075382a42bff0c.

Revert "RDS: Properly unmap when getting a remote access error"
This reverts commit 450d06c0208ad195ccd74a7edd11321e316791ad.

Revert "RDS: only put sockets that have seen congestion on the poll_waitq"
This reverts commit b98ba52f96e7cdb4dbe2b06bced83d95d94c9d02.

Revert "RDS: Fix locking in rds_send_drop_to()"
This reverts commit 550a8002e4340eaf3bc333e33b59427e9c20272d.

Revert "RDS: Turn down alarming reconnect messages"
This reverts commit 97069788d6784ac92d050557a02f6e7bf4d1f53d.

Revert "RDS: Workaround for in-use MRs on close causing crash"
This reverts commit 571c02fa81e43ebb4b793f626d6c7bf0fa18902b.

Revert "RDS: Fix send locking issue"
This reverts commit 048c15e641289d902f7ef9f1241068d8045e210c.

Revert "RDS: Fix congestion issues for loopback"
This reverts commit 2e7b3b994529d4760231a45a6b88950187bda877.

Revert "RDS/TCP: Wait to wake thread when write space available"
This reverts commit 8e82376e5f72bb576504c8c6117685e56c1b97db.

Revert "RDS: update copy_to_user state in tcp transport"
This reverts commit b075cfdb666d6fa90c55c8619186398a3c4fd865.

Revert "RDS: sendmsg() should check sndtimeo, not rcvtimeo"
This reverts commit 1123fd734df6ad82373a5a27f0f2ed3115555b9d.

Revert "RDS: Do not BUG() on error returned from ib_post_send"
This reverts commit 735f61e62611161588123930823af6e6a9fd5c2c.

Revert "net/rds: remove uses of NIPQUAD, use %pI4"
This reverts commit 6884b348ed759184032306c9435a727741a72298.

Revert "net: Move && and || to end of previous line" for net/rds
This reverts commit f64f9e719261a87818dd192a3a2352e5b20fbd0f for net/rds.

Revert "RDMA/cm: fix loopback address support" for net/rds
This reverts commit 6f8372b69c3198e06cecb1df2cb9682d0c55e657 for net/rds.

Revert "sysctl: Drop & in front of every proc_handler." for net/rds
This reverts commit 6d4561110a3e9fa742aeec6717248a491dfb1878 for net/rds.

Revert "sysctl net: Remove unused binary sysctl code" for net/rds
This reverts commit f8572d8f2a2ba75408b97dc24ef47c83671795d7 for net/rds.

Revert "net: pass kern to net_proto_family create function" for net/rds
This reverts commit 3f378b684453f2a028eda463ce383370545d9cc9 for net/rds.

Revert "RDS/IB+IW: Move recv processing to a tasklet"
This reverts commit d521b63b27e3a397e0ef7ca86b6e813861083c83.

Revert "RDS: Do not send congestion updates to loopback connections"
This reverts commit 0514f8a9c0cbd26afa70dc56406cc0ee1e134dcf.

Revert "RDS: Fix panic on unload"
This reverts commit 433d308dd85e506bb6529177cc0f997627d87ed6.

Revert "RDS: Fix potential race around rds_i[bw]_allocation"
This reverts commit 86357b19bcabd9355937f3fb84f90ba9fe76a5d3.

Revert "RDS: Add GET_MR_FOR_DEST sockopt"
This reverts commit 244546f0d3101c5441f5b14cfe8a79d62679eaea.

Revert "inet: rename some inet_sock fields" for net/rds
This reverts commit c720c7e8383aff1cb219bddf474ed89d850336e3 for net/rds.

Revert "net: mark net_proto_ops as const" for net/rds
This reverts commit ec1b4cf74c81bfd0fbe5bf62bafc86c45917e72f for net/rds.

Revert "net: Make setsockopt() optlen be unsigned." for net/rds
This reverts commit b7058842c940ad2c08dd829b21e5c92ebe3b8758 for net/rds.

Revert "net: constify remaining proto_ops" for net/rds
This reverts commit 5708e868dc512f055f0ea4a14d01f8252c3ca8a1 for net/rds.

Revert "RDS: Add a debug message suggesting to load transport modules"
This reverts commit f2c449320d547bd5c281649eb1d99afb20765144.

Revert "RDS: Track transports via an array, not a list"
This reverts commit 335776bd696a6bf95134baf8ad95847371e4d5f6.

Revert "RDS: Modularize RDMA and TCP transports"
This reverts commit 40d866095df3bb70ded1813f4852cab445ef678b.

Revert "RDS: Export symbols from core RDS"
This reverts commit 616b757ae18fb8ec2dfe7ff9d3f589f82cb0eb9d.

Revert "RDS: Add TCP transport to RDS"
This reverts commit 70041088e3b976627ba9a183b812f39ef8a9ba0e.

Revert "net/rds: Use AF_INET for sin_family field"
This reverts commit 3d7ddd540b4c2d24c6a3e7a52c083a0c31e6151c.

Revert "net: mark read-only arrays as const" for net/rds
This reverts commit 36cbd3dcc10384f813ec0814255f576c84f2bcd4 for net/rds.

Revert "RDS: Refactor end of __conn_create for readability"
This reverts commit cb24405e67e56cbef51b5e4d0bb0a0fde167261f.

Revert "RDS/IW: Remove dead code"
This reverts commit ed9e352a350ec85eb354046e0db6a86019620f53.

Revert "RDS/IW: Remove page_shift variable from iwarp transport"
This reverts commit 404bb72a56e553febe1055f98347a7a3e3145759.

Revert "RDS/IB: Always use PAGE_SIZE for FMR page size"
This reverts commit a870d62726721785c34fa73d852bd35e5d1b295b.

Revert "RDS: Fix completion notifications on blocking sockets"
This reverts commit edacaeae52ade6cbb3a0704db32a9fb4a219dee3.

Revert "RDS/IB: Drop connection when a fatal QP event is received"
This reverts commit fdf6e6b4afd8a56fa58f70a3950bd7ea7fbaef5f.

Revert "RDS/IB: Disable flow control in sysctl and explain why"
This reverts commit 68cb01c1ba312add7c7cc7da1bbe98b3071904d1.

Revert "RDS/IB: Move tx/rx ring init and refill to later"
This reverts commit e11d912a7dd4dfe388f38ba3080a6d067a57b23d.

Revert "RDS: Don't set c_version in __rds_conn_create()"
This reverts commit 9099707ded4b3aeda7b1a6c1c87076bd18578d24.

Revert "RDS/IB: Rename byte_len to data_len to enhance readability"
This reverts commit 597ddd50e1c07ac55ac7742442690efcf16a37f5.

Revert "RDS/RDMA: Fix cut-n-paste errors in printks in rdma_transport.c"
This reverts commit 92c330b9e93ce70a8c45a6b8b0a551321d783feb.

Revert "RDS/IB: Fix printk to indicate remote IP, not local"
This reverts commit 8dacd57e7ebc307d4d7c27c5d1caada4c4e63ebd.

Revert "RDS/IB: Handle connections using RDS 3.0 wire protocol"
This reverts commit 02a6a2592e41d27644d647f3bce23598649961bc.

Revert "RDS/IB: Improve RDS protocol version checking"
This reverts commit 9ddbcfa098bae757d3760dd1dbf2847a0bd5a525.

Revert "RDS: Set retry_count to 2 and make modifiable via modparam"
This reverts commit 3ba23ade464cca7c4a7ba5628c613339d3f2e161.

Revert "percpu: use DEFINE_PER_CPU_SHARED_ALIGNED()" for net/rds
This reverts commit b9bf3121af348d9255f1c917830fe8c2df52efcb for net/rds.

Revert "FRV: Fix the section attribute on UP DECLARE_PER_CPU()" for net/rds
This reverts commit 9b8de7479d0dbab1ed98b5b015d44232c9d3d08e for net/rds.

Revert "ERR_PTR() dereference in net/rds/ib.c"
This reverts commit 94713bab649736177a1c33a39b7bb33cbd5af3a5.

Revert "ERR_PTR() dereference in net/rds/iw.c"
This reverts commit 5d57eeb52ae71a03c8e083a9b0a818a9b63ca440.

Revert "rds: use kmem_cache_zalloc instead of kmem_cache_alloc/memset"
This reverts commit 05a178ecdc7396b78dfbb5d8bda65108b37b8672.

Revert "RDS: remove unused #include <version.h>"
This reverts commit 9c56a84478b708e5d8d34d28cc3a8e71842d5b05.

Revert "RDS: use get_user_pages_fast()"
This reverts commit 830eb7d56c18ff4c29acd8b0bb48db404660321f.

Revert "RDS: Establish connection before parsing CMSGs"
This reverts commit 49f696914100780f6bf8e652d3468de0015d6172.

Revert "RDS: Fix ordering in a conditional"
This reverts commit 7acd4a794c1530af063e51f3f7171e75556458f3.

Revert "RDS/IW+IB: Allow max credit advertise window."
This reverts commit 7b70d0336da777c00395cc7a503497c2cdabd1a8.

Revert "RDS/IW+IB: Set the RDS_LL_SEND_FULL bit when we're throttled."
This reverts commit d39e0602bb987133321d358d9b837d67c27b223d.

Revert "RDS: Correct some iw references in rdma_transport.c"
This reverts commit 11bc9421da3040c71fc96da1a31e95217e8cf2af.

Revert "RDS/IW+IB: Set recv ring low water mark to 1/2 full."
This reverts commit 5cd2fe6d54c91aa76893b3034f5f3473063c0202.

-------

Signed-off-by: Ajaykumar Hotchandani <ajaykumar.hotchandani@oracle.com>
(Added revert details)
Signed-off-by: Mukesh Kacker <mukesh.kacker@oracle.com>