mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1815 commits) mac80211: fix reorder buffer release iwmc3200wifi: Enable wimax core through module parameter iwmc3200wifi: Add wifi-wimax coexistence mode as a module parameter iwmc3200wifi: Coex table command does not expect a response iwmc3200wifi: Update wiwi priority table iwlwifi: driver version track kernel version iwlwifi: indicate uCode type when fail dump error/event log iwl3945: remove duplicated event logging code b43: fix two warnings ipw2100: fix rebooting hang with driver loaded cfg80211: indent regulatory messages with spaces iwmc3200wifi: fix NULL pointer dereference in pmkid update mac80211: Fix TX status reporting for injected data frames ath9k: enable 2GHz band only if the device supports it airo: Fix integer overflow warning rt2x00: Fix padding bug on L2PAD devices. WE: Fix set events not propagated b43legacy: avoid PPC fault during resume b43: avoid PPC fault during resume tcp: fix a timewait refcnt race ... Fix up conflicts due to sysctl cleanups (dead sysctl_check code and CTL_UNNUMBERED removed) in kernel/sysctl_check.c net/ipv4/sysctl_net_ipv4.c net/ipv6/addrconf.c net/sctp/sysctl.c
This commit is contained in:
commit
d7fc02c7ba
1394 changed files with 113445 additions and 70680 deletions
|
|
@ -174,8 +174,8 @@ static unsigned int rds_poll(struct file *file, struct socket *sock,
|
|||
mask |= (POLLIN | POLLRDNORM);
|
||||
spin_unlock(&rs->rs_lock);
|
||||
}
|
||||
if (!list_empty(&rs->rs_recv_queue)
|
||||
|| !list_empty(&rs->rs_notify_queue))
|
||||
if (!list_empty(&rs->rs_recv_queue) ||
|
||||
!list_empty(&rs->rs_notify_queue))
|
||||
mask |= (POLLIN | POLLRDNORM);
|
||||
if (rs->rs_snd_bytes < rds_sk_sndbuf(rs))
|
||||
mask |= (POLLOUT | POLLWRNORM);
|
||||
|
|
@ -265,6 +265,9 @@ static int rds_setsockopt(struct socket *sock, int level, int optname,
|
|||
case RDS_GET_MR:
|
||||
ret = rds_get_mr(rs, optval, optlen);
|
||||
break;
|
||||
case RDS_GET_MR_FOR_DEST:
|
||||
ret = rds_get_mr_for_dest(rs, optval, optlen);
|
||||
break;
|
||||
case RDS_FREE_MR:
|
||||
ret = rds_free_mr(rs, optval, optlen);
|
||||
break;
|
||||
|
|
@ -305,8 +308,8 @@ static int rds_getsockopt(struct socket *sock, int level, int optname,
|
|||
if (len < sizeof(int))
|
||||
ret = -EINVAL;
|
||||
else
|
||||
if (put_user(rs->rs_recverr, (int __user *) optval)
|
||||
|| put_user(sizeof(int), optlen))
|
||||
if (put_user(rs->rs_recverr, (int __user *) optval) ||
|
||||
put_user(sizeof(int), optlen))
|
||||
ret = -EFAULT;
|
||||
else
|
||||
ret = 0;
|
||||
|
|
@ -407,7 +410,8 @@ static int __rds_create(struct socket *sock, struct sock *sk, int protocol)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int rds_create(struct net *net, struct socket *sock, int protocol)
|
||||
static int rds_create(struct net *net, struct socket *sock, int protocol,
|
||||
int kern)
|
||||
{
|
||||
struct sock *sk;
|
||||
|
||||
|
|
@ -431,7 +435,7 @@ void rds_sock_put(struct rds_sock *rs)
|
|||
sock_put(rds_rs_to_sk(rs));
|
||||
}
|
||||
|
||||
static struct net_proto_family rds_family_ops = {
|
||||
static const struct net_proto_family rds_family_ops = {
|
||||
.family = AF_RDS,
|
||||
.create = rds_create,
|
||||
.owner = THIS_MODULE,
|
||||
|
|
|
|||
|
|
@ -218,6 +218,8 @@ void rds_cong_queue_updates(struct rds_cong_map *map)
|
|||
spin_lock_irqsave(&rds_cong_lock, flags);
|
||||
|
||||
list_for_each_entry(conn, &map->m_conn_list, c_map_item) {
|
||||
if (conn->c_loopback)
|
||||
continue;
|
||||
if (!test_and_set_bit(0, &conn->c_map_queued)) {
|
||||
rds_stats_inc(s_cong_update_queued);
|
||||
queue_delayed_work(rds_wq, &conn->c_send_w, 0);
|
||||
|
|
|
|||
|
|
@ -133,10 +133,8 @@ static struct rds_connection *__rds_conn_create(__be32 laddr, __be32 faddr,
|
|||
|
||||
spin_lock_irqsave(&rds_conn_lock, flags);
|
||||
conn = rds_conn_lookup(head, laddr, faddr, trans);
|
||||
if (conn
|
||||
&& conn->c_loopback
|
||||
&& conn->c_trans != &rds_loop_transport
|
||||
&& !is_outgoing) {
|
||||
if (conn && conn->c_loopback && conn->c_trans != &rds_loop_transport &&
|
||||
!is_outgoing) {
|
||||
/* This is a looped back IB connection, and we're
|
||||
* called by the code handling the incoming connect.
|
||||
* We need a second connection object into which we
|
||||
|
|
|
|||
|
|
@ -98,6 +98,7 @@ struct rds_ib_connection {
|
|||
struct rds_ib_send_work *i_sends;
|
||||
|
||||
/* rx */
|
||||
struct tasklet_struct i_recv_tasklet;
|
||||
struct mutex i_recv_mutex;
|
||||
struct rds_ib_work_ring i_recv_ring;
|
||||
struct rds_ib_incoming *i_ibinc;
|
||||
|
|
@ -303,6 +304,7 @@ void rds_ib_inc_free(struct rds_incoming *inc);
|
|||
int rds_ib_inc_copy_to_user(struct rds_incoming *inc, struct iovec *iov,
|
||||
size_t size);
|
||||
void rds_ib_recv_cq_comp_handler(struct ib_cq *cq, void *context);
|
||||
void rds_ib_recv_tasklet_fn(unsigned long data);
|
||||
void rds_ib_recv_init_ring(struct rds_ib_connection *ic);
|
||||
void rds_ib_recv_clear_ring(struct rds_ib_connection *ic);
|
||||
void rds_ib_recv_init_ack(struct rds_ib_connection *ic);
|
||||
|
|
|
|||
|
|
@ -377,8 +377,8 @@ static u32 rds_ib_protocol_compatible(struct rdma_cm_event *event)
|
|||
}
|
||||
|
||||
/* Even if len is crap *now* I still want to check it. -ASG */
|
||||
if (event->param.conn.private_data_len < sizeof (*dp)
|
||||
|| dp->dp_protocol_major == 0)
|
||||
if (event->param.conn.private_data_len < sizeof (*dp) ||
|
||||
dp->dp_protocol_major == 0)
|
||||
return RDS_PROTOCOL_3_0;
|
||||
|
||||
common = be16_to_cpu(dp->dp_protocol_minor_mask) & RDS_IB_SUPPORTED_PROTOCOLS;
|
||||
|
|
@ -694,6 +694,8 @@ int rds_ib_conn_alloc(struct rds_connection *conn, gfp_t gfp)
|
|||
return -ENOMEM;
|
||||
|
||||
INIT_LIST_HEAD(&ic->ib_node);
|
||||
tasklet_init(&ic->i_recv_tasklet, rds_ib_recv_tasklet_fn,
|
||||
(unsigned long) ic);
|
||||
mutex_init(&ic->i_recv_mutex);
|
||||
#ifndef KERNEL_HAS_ATOMIC64
|
||||
spin_lock_init(&ic->i_ack_lock);
|
||||
|
|
|
|||
|
|
@ -187,11 +187,8 @@ void __rds_ib_destroy_conns(struct list_head *list, spinlock_t *list_lock)
|
|||
INIT_LIST_HEAD(list);
|
||||
spin_unlock_irq(list_lock);
|
||||
|
||||
list_for_each_entry_safe(ic, _ic, &tmp_list, ib_node) {
|
||||
if (ic->conn->c_passive)
|
||||
rds_conn_destroy(ic->conn->c_passive);
|
||||
list_for_each_entry_safe(ic, _ic, &tmp_list, ib_node)
|
||||
rds_conn_destroy(ic->conn);
|
||||
}
|
||||
}
|
||||
|
||||
struct rds_ib_mr_pool *rds_ib_create_mr_pool(struct rds_ib_device *rds_ibdev)
|
||||
|
|
@ -573,8 +570,8 @@ void rds_ib_free_mr(void *trans_private, int invalidate)
|
|||
spin_unlock_irqrestore(&pool->list_lock, flags);
|
||||
|
||||
/* If we've pinned too many pages, request a flush */
|
||||
if (atomic_read(&pool->free_pinned) >= pool->max_free_pinned
|
||||
|| atomic_read(&pool->dirty_count) >= pool->max_items / 10)
|
||||
if (atomic_read(&pool->free_pinned) >= pool->max_free_pinned ||
|
||||
atomic_read(&pool->dirty_count) >= pool->max_items / 10)
|
||||
queue_work(rds_wq, &pool->flush_worker);
|
||||
|
||||
if (invalidate) {
|
||||
|
|
|
|||
|
|
@ -143,15 +143,16 @@ static int rds_ib_recv_refill_one(struct rds_connection *conn,
|
|||
int ret = -ENOMEM;
|
||||
|
||||
if (recv->r_ibinc == NULL) {
|
||||
if (atomic_read(&rds_ib_allocation) >= rds_ib_sysctl_max_recv_allocation) {
|
||||
if (!atomic_add_unless(&rds_ib_allocation, 1, rds_ib_sysctl_max_recv_allocation)) {
|
||||
rds_ib_stats_inc(s_ib_rx_alloc_limit);
|
||||
goto out;
|
||||
}
|
||||
recv->r_ibinc = kmem_cache_alloc(rds_ib_incoming_slab,
|
||||
kptr_gfp);
|
||||
if (recv->r_ibinc == NULL)
|
||||
if (recv->r_ibinc == NULL) {
|
||||
atomic_dec(&rds_ib_allocation);
|
||||
goto out;
|
||||
atomic_inc(&rds_ib_allocation);
|
||||
}
|
||||
INIT_LIST_HEAD(&recv->r_ibinc->ii_frags);
|
||||
rds_inc_init(&recv->r_ibinc->ii_inc, conn, conn->c_faddr);
|
||||
}
|
||||
|
|
@ -229,8 +230,8 @@ int rds_ib_recv_refill(struct rds_connection *conn, gfp_t kptr_gfp,
|
|||
int ret = 0;
|
||||
u32 pos;
|
||||
|
||||
while ((prefill || rds_conn_up(conn))
|
||||
&& rds_ib_ring_alloc(&ic->i_recv_ring, 1, &pos)) {
|
||||
while ((prefill || rds_conn_up(conn)) &&
|
||||
rds_ib_ring_alloc(&ic->i_recv_ring, 1, &pos)) {
|
||||
if (pos >= ic->i_recv_ring.w_nr) {
|
||||
printk(KERN_NOTICE "Argh - ring alloc returned pos=%u\n",
|
||||
pos);
|
||||
|
|
@ -770,10 +771,10 @@ static void rds_ib_process_recv(struct rds_connection *conn,
|
|||
hdr = &ibinc->ii_inc.i_hdr;
|
||||
/* We can't just use memcmp here; fragments of a
|
||||
* single message may carry different ACKs */
|
||||
if (hdr->h_sequence != ihdr->h_sequence
|
||||
|| hdr->h_len != ihdr->h_len
|
||||
|| hdr->h_sport != ihdr->h_sport
|
||||
|| hdr->h_dport != ihdr->h_dport) {
|
||||
if (hdr->h_sequence != ihdr->h_sequence ||
|
||||
hdr->h_len != ihdr->h_len ||
|
||||
hdr->h_sport != ihdr->h_sport ||
|
||||
hdr->h_dport != ihdr->h_dport) {
|
||||
rds_ib_conn_error(conn,
|
||||
"fragment header mismatch; forcing reconnect\n");
|
||||
return;
|
||||
|
|
@ -824,17 +825,22 @@ void rds_ib_recv_cq_comp_handler(struct ib_cq *cq, void *context)
|
|||
{
|
||||
struct rds_connection *conn = context;
|
||||
struct rds_ib_connection *ic = conn->c_transport_data;
|
||||
struct ib_wc wc;
|
||||
struct rds_ib_ack_state state = { 0, };
|
||||
struct rds_ib_recv_work *recv;
|
||||
|
||||
rdsdebug("conn %p cq %p\n", conn, cq);
|
||||
|
||||
rds_ib_stats_inc(s_ib_rx_cq_call);
|
||||
|
||||
ib_req_notify_cq(cq, IB_CQ_SOLICITED);
|
||||
tasklet_schedule(&ic->i_recv_tasklet);
|
||||
}
|
||||
|
||||
while (ib_poll_cq(cq, 1, &wc) > 0) {
|
||||
static inline void rds_poll_cq(struct rds_ib_connection *ic,
|
||||
struct rds_ib_ack_state *state)
|
||||
{
|
||||
struct rds_connection *conn = ic->conn;
|
||||
struct ib_wc wc;
|
||||
struct rds_ib_recv_work *recv;
|
||||
|
||||
while (ib_poll_cq(ic->i_recv_cq, 1, &wc) > 0) {
|
||||
rdsdebug("wc wr_id 0x%llx status %u byte_len %u imm_data %u\n",
|
||||
(unsigned long long)wc.wr_id, wc.status, wc.byte_len,
|
||||
be32_to_cpu(wc.ex.imm_data));
|
||||
|
|
@ -852,7 +858,7 @@ void rds_ib_recv_cq_comp_handler(struct ib_cq *cq, void *context)
|
|||
if (rds_conn_up(conn) || rds_conn_connecting(conn)) {
|
||||
/* We expect errors as the qp is drained during shutdown */
|
||||
if (wc.status == IB_WC_SUCCESS) {
|
||||
rds_ib_process_recv(conn, recv, wc.byte_len, &state);
|
||||
rds_ib_process_recv(conn, recv, wc.byte_len, state);
|
||||
} else {
|
||||
rds_ib_conn_error(conn, "recv completion on "
|
||||
"%pI4 had status %u, disconnecting and "
|
||||
|
|
@ -863,6 +869,17 @@ void rds_ib_recv_cq_comp_handler(struct ib_cq *cq, void *context)
|
|||
|
||||
rds_ib_ring_free(&ic->i_recv_ring, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void rds_ib_recv_tasklet_fn(unsigned long data)
|
||||
{
|
||||
struct rds_ib_connection *ic = (struct rds_ib_connection *) data;
|
||||
struct rds_connection *conn = ic->conn;
|
||||
struct rds_ib_ack_state state = { 0, };
|
||||
|
||||
rds_poll_cq(ic, &state);
|
||||
ib_req_notify_cq(ic->i_recv_cq, IB_CQ_SOLICITED);
|
||||
rds_poll_cq(ic, &state);
|
||||
|
||||
if (state.ack_next_valid)
|
||||
rds_ib_set_ack(ic, state.ack_next, state.ack_required);
|
||||
|
|
|
|||
|
|
@ -252,8 +252,8 @@ void rds_ib_send_cq_comp_handler(struct ib_cq *cq, void *context)
|
|||
|
||||
rds_ib_ring_free(&ic->i_send_ring, completed);
|
||||
|
||||
if (test_and_clear_bit(RDS_LL_SEND_FULL, &conn->c_flags)
|
||||
|| test_bit(0, &conn->c_map_queued))
|
||||
if (test_and_clear_bit(RDS_LL_SEND_FULL, &conn->c_flags) ||
|
||||
test_bit(0, &conn->c_map_queued))
|
||||
queue_delayed_work(rds_wq, &conn->c_send_w, 0);
|
||||
|
||||
/* We expect errors as the qp is drained during shutdown */
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ struct rds_iw_connection {
|
|||
struct rds_iw_send_work *i_sends;
|
||||
|
||||
/* rx */
|
||||
struct tasklet_struct i_recv_tasklet;
|
||||
struct mutex i_recv_mutex;
|
||||
struct rds_iw_work_ring i_recv_ring;
|
||||
struct rds_iw_incoming *i_iwinc;
|
||||
|
|
@ -330,6 +331,7 @@ void rds_iw_inc_free(struct rds_incoming *inc);
|
|||
int rds_iw_inc_copy_to_user(struct rds_incoming *inc, struct iovec *iov,
|
||||
size_t size);
|
||||
void rds_iw_recv_cq_comp_handler(struct ib_cq *cq, void *context);
|
||||
void rds_iw_recv_tasklet_fn(unsigned long data);
|
||||
void rds_iw_recv_init_ring(struct rds_iw_connection *ic);
|
||||
void rds_iw_recv_clear_ring(struct rds_iw_connection *ic);
|
||||
void rds_iw_recv_init_ack(struct rds_iw_connection *ic);
|
||||
|
|
|
|||
|
|
@ -696,6 +696,8 @@ int rds_iw_conn_alloc(struct rds_connection *conn, gfp_t gfp)
|
|||
return -ENOMEM;
|
||||
|
||||
INIT_LIST_HEAD(&ic->iw_node);
|
||||
tasklet_init(&ic->i_recv_tasklet, rds_iw_recv_tasklet_fn,
|
||||
(unsigned long) ic);
|
||||
mutex_init(&ic->i_recv_mutex);
|
||||
#ifndef KERNEL_HAS_ATOMIC64
|
||||
spin_lock_init(&ic->i_ack_lock);
|
||||
|
|
|
|||
|
|
@ -245,11 +245,8 @@ void __rds_iw_destroy_conns(struct list_head *list, spinlock_t *list_lock)
|
|||
INIT_LIST_HEAD(list);
|
||||
spin_unlock_irq(list_lock);
|
||||
|
||||
list_for_each_entry_safe(ic, _ic, &tmp_list, iw_node) {
|
||||
if (ic->conn->c_passive)
|
||||
rds_conn_destroy(ic->conn->c_passive);
|
||||
list_for_each_entry_safe(ic, _ic, &tmp_list, iw_node)
|
||||
rds_conn_destroy(ic->conn);
|
||||
}
|
||||
}
|
||||
|
||||
static void rds_iw_set_scatterlist(struct rds_iw_scatterlist *sg,
|
||||
|
|
@ -576,8 +573,8 @@ void rds_iw_free_mr(void *trans_private, int invalidate)
|
|||
rds_iw_free_fastreg(pool, ibmr);
|
||||
|
||||
/* If we've pinned too many pages, request a flush */
|
||||
if (atomic_read(&pool->free_pinned) >= pool->max_free_pinned
|
||||
|| atomic_read(&pool->dirty_count) >= pool->max_items / 10)
|
||||
if (atomic_read(&pool->free_pinned) >= pool->max_free_pinned ||
|
||||
atomic_read(&pool->dirty_count) >= pool->max_items / 10)
|
||||
queue_work(rds_wq, &pool->flush_worker);
|
||||
|
||||
if (invalidate) {
|
||||
|
|
|
|||
|
|
@ -143,15 +143,16 @@ static int rds_iw_recv_refill_one(struct rds_connection *conn,
|
|||
int ret = -ENOMEM;
|
||||
|
||||
if (recv->r_iwinc == NULL) {
|
||||
if (atomic_read(&rds_iw_allocation) >= rds_iw_sysctl_max_recv_allocation) {
|
||||
if (!atomic_add_unless(&rds_iw_allocation, 1, rds_iw_sysctl_max_recv_allocation)) {
|
||||
rds_iw_stats_inc(s_iw_rx_alloc_limit);
|
||||
goto out;
|
||||
}
|
||||
recv->r_iwinc = kmem_cache_alloc(rds_iw_incoming_slab,
|
||||
kptr_gfp);
|
||||
if (recv->r_iwinc == NULL)
|
||||
if (recv->r_iwinc == NULL) {
|
||||
atomic_dec(&rds_iw_allocation);
|
||||
goto out;
|
||||
atomic_inc(&rds_iw_allocation);
|
||||
}
|
||||
INIT_LIST_HEAD(&recv->r_iwinc->ii_frags);
|
||||
rds_inc_init(&recv->r_iwinc->ii_inc, conn, conn->c_faddr);
|
||||
}
|
||||
|
|
@ -229,8 +230,8 @@ int rds_iw_recv_refill(struct rds_connection *conn, gfp_t kptr_gfp,
|
|||
int ret = 0;
|
||||
u32 pos;
|
||||
|
||||
while ((prefill || rds_conn_up(conn))
|
||||
&& rds_iw_ring_alloc(&ic->i_recv_ring, 1, &pos)) {
|
||||
while ((prefill || rds_conn_up(conn)) &&
|
||||
rds_iw_ring_alloc(&ic->i_recv_ring, 1, &pos)) {
|
||||
if (pos >= ic->i_recv_ring.w_nr) {
|
||||
printk(KERN_NOTICE "Argh - ring alloc returned pos=%u\n",
|
||||
pos);
|
||||
|
|
@ -729,10 +730,10 @@ static void rds_iw_process_recv(struct rds_connection *conn,
|
|||
hdr = &iwinc->ii_inc.i_hdr;
|
||||
/* We can't just use memcmp here; fragments of a
|
||||
* single message may carry different ACKs */
|
||||
if (hdr->h_sequence != ihdr->h_sequence
|
||||
|| hdr->h_len != ihdr->h_len
|
||||
|| hdr->h_sport != ihdr->h_sport
|
||||
|| hdr->h_dport != ihdr->h_dport) {
|
||||
if (hdr->h_sequence != ihdr->h_sequence ||
|
||||
hdr->h_len != ihdr->h_len ||
|
||||
hdr->h_sport != ihdr->h_sport ||
|
||||
hdr->h_dport != ihdr->h_dport) {
|
||||
rds_iw_conn_error(conn,
|
||||
"fragment header mismatch; forcing reconnect\n");
|
||||
return;
|
||||
|
|
@ -783,17 +784,22 @@ void rds_iw_recv_cq_comp_handler(struct ib_cq *cq, void *context)
|
|||
{
|
||||
struct rds_connection *conn = context;
|
||||
struct rds_iw_connection *ic = conn->c_transport_data;
|
||||
struct ib_wc wc;
|
||||
struct rds_iw_ack_state state = { 0, };
|
||||
struct rds_iw_recv_work *recv;
|
||||
|
||||
rdsdebug("conn %p cq %p\n", conn, cq);
|
||||
|
||||
rds_iw_stats_inc(s_iw_rx_cq_call);
|
||||
|
||||
ib_req_notify_cq(cq, IB_CQ_SOLICITED);
|
||||
tasklet_schedule(&ic->i_recv_tasklet);
|
||||
}
|
||||
|
||||
while (ib_poll_cq(cq, 1, &wc) > 0) {
|
||||
static inline void rds_poll_cq(struct rds_iw_connection *ic,
|
||||
struct rds_iw_ack_state *state)
|
||||
{
|
||||
struct rds_connection *conn = ic->conn;
|
||||
struct ib_wc wc;
|
||||
struct rds_iw_recv_work *recv;
|
||||
|
||||
while (ib_poll_cq(ic->i_recv_cq, 1, &wc) > 0) {
|
||||
rdsdebug("wc wr_id 0x%llx status %u byte_len %u imm_data %u\n",
|
||||
(unsigned long long)wc.wr_id, wc.status, wc.byte_len,
|
||||
be32_to_cpu(wc.ex.imm_data));
|
||||
|
|
@ -811,7 +817,7 @@ void rds_iw_recv_cq_comp_handler(struct ib_cq *cq, void *context)
|
|||
if (rds_conn_up(conn) || rds_conn_connecting(conn)) {
|
||||
/* We expect errors as the qp is drained during shutdown */
|
||||
if (wc.status == IB_WC_SUCCESS) {
|
||||
rds_iw_process_recv(conn, recv, wc.byte_len, &state);
|
||||
rds_iw_process_recv(conn, recv, wc.byte_len, state);
|
||||
} else {
|
||||
rds_iw_conn_error(conn, "recv completion on "
|
||||
"%pI4 had status %u, disconnecting and "
|
||||
|
|
@ -822,6 +828,17 @@ void rds_iw_recv_cq_comp_handler(struct ib_cq *cq, void *context)
|
|||
|
||||
rds_iw_ring_free(&ic->i_recv_ring, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void rds_iw_recv_tasklet_fn(unsigned long data)
|
||||
{
|
||||
struct rds_iw_connection *ic = (struct rds_iw_connection *) data;
|
||||
struct rds_connection *conn = ic->conn;
|
||||
struct rds_iw_ack_state state = { 0, };
|
||||
|
||||
rds_poll_cq(ic, &state);
|
||||
ib_req_notify_cq(ic->i_recv_cq, IB_CQ_SOLICITED);
|
||||
rds_poll_cq(ic, &state);
|
||||
|
||||
if (state.ack_next_valid)
|
||||
rds_iw_set_ack(ic, state.ack_next, state.ack_required);
|
||||
|
|
|
|||
|
|
@ -288,8 +288,8 @@ void rds_iw_send_cq_comp_handler(struct ib_cq *cq, void *context)
|
|||
|
||||
rds_iw_ring_free(&ic->i_send_ring, completed);
|
||||
|
||||
if (test_and_clear_bit(RDS_LL_SEND_FULL, &conn->c_flags)
|
||||
|| test_bit(0, &conn->c_map_queued))
|
||||
if (test_and_clear_bit(RDS_LL_SEND_FULL, &conn->c_flags) ||
|
||||
test_bit(0, &conn->c_map_queued))
|
||||
queue_delayed_work(rds_wq, &conn->c_send_w, 0);
|
||||
|
||||
/* We expect errors as the qp is drained during shutdown */
|
||||
|
|
@ -519,8 +519,7 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm,
|
|||
BUG_ON(hdr_off != 0 && hdr_off != sizeof(struct rds_header));
|
||||
|
||||
/* Fastreg support */
|
||||
if (rds_rdma_cookie_key(rm->m_rdma_cookie)
|
||||
&& !ic->i_fastreg_posted) {
|
||||
if (rds_rdma_cookie_key(rm->m_rdma_cookie) && !ic->i_fastreg_posted) {
|
||||
ret = -EAGAIN;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,8 +122,7 @@ int rds_message_add_extension(struct rds_header *hdr,
|
|||
if (hdr->h_exthdr[0] != RDS_EXTHDR_NONE)
|
||||
return 0;
|
||||
|
||||
if (type >= __RDS_EXTHDR_MAX
|
||||
|| len != rds_exthdr_size[type])
|
||||
if (type >= __RDS_EXTHDR_MAX || len != rds_exthdr_size[type])
|
||||
return 0;
|
||||
|
||||
if (ext_len >= RDS_HEADER_EXT_SPACE)
|
||||
|
|
|
|||
|
|
@ -317,6 +317,30 @@ int rds_get_mr(struct rds_sock *rs, char __user *optval, int optlen)
|
|||
return __rds_rdma_map(rs, &args, NULL, NULL);
|
||||
}
|
||||
|
||||
int rds_get_mr_for_dest(struct rds_sock *rs, char __user *optval, int optlen)
|
||||
{
|
||||
struct rds_get_mr_for_dest_args args;
|
||||
struct rds_get_mr_args new_args;
|
||||
|
||||
if (optlen != sizeof(struct rds_get_mr_for_dest_args))
|
||||
return -EINVAL;
|
||||
|
||||
if (copy_from_user(&args, (struct rds_get_mr_for_dest_args __user *)optval,
|
||||
sizeof(struct rds_get_mr_for_dest_args)))
|
||||
return -EFAULT;
|
||||
|
||||
/*
|
||||
* Initially, just behave like get_mr().
|
||||
* TODO: Implement get_mr as wrapper around this
|
||||
* and deprecate it.
|
||||
*/
|
||||
new_args.vec = args.vec;
|
||||
new_args.cookie_addr = args.cookie_addr;
|
||||
new_args.flags = args.flags;
|
||||
|
||||
return __rds_rdma_map(rs, &new_args, NULL, NULL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Free the MR indicated by the given R_Key
|
||||
*/
|
||||
|
|
@ -607,8 +631,8 @@ int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
|
|||
{
|
||||
struct rds_rdma_op *op;
|
||||
|
||||
if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct rds_rdma_args))
|
||||
|| rm->m_rdma_op != NULL)
|
||||
if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct rds_rdma_args)) ||
|
||||
rm->m_rdma_op != NULL)
|
||||
return -EINVAL;
|
||||
|
||||
op = rds_rdma_prepare(rs, CMSG_DATA(cmsg));
|
||||
|
|
@ -631,8 +655,8 @@ int rds_cmsg_rdma_dest(struct rds_sock *rs, struct rds_message *rm,
|
|||
u32 r_key;
|
||||
int err = 0;
|
||||
|
||||
if (cmsg->cmsg_len < CMSG_LEN(sizeof(rds_rdma_cookie_t))
|
||||
|| rm->m_rdma_cookie != 0)
|
||||
if (cmsg->cmsg_len < CMSG_LEN(sizeof(rds_rdma_cookie_t)) ||
|
||||
rm->m_rdma_cookie != 0)
|
||||
return -EINVAL;
|
||||
|
||||
memcpy(&rm->m_rdma_cookie, CMSG_DATA(cmsg), sizeof(rm->m_rdma_cookie));
|
||||
|
|
@ -668,8 +692,8 @@ int rds_cmsg_rdma_dest(struct rds_sock *rs, struct rds_message *rm,
|
|||
int rds_cmsg_rdma_map(struct rds_sock *rs, struct rds_message *rm,
|
||||
struct cmsghdr *cmsg)
|
||||
{
|
||||
if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct rds_get_mr_args))
|
||||
|| rm->m_rdma_cookie != 0)
|
||||
if (cmsg->cmsg_len < CMSG_LEN(sizeof(struct rds_get_mr_args)) ||
|
||||
rm->m_rdma_cookie != 0)
|
||||
return -EINVAL;
|
||||
|
||||
return __rds_rdma_map(rs, CMSG_DATA(cmsg), &rm->m_rdma_cookie, &rm->m_rdma_mr);
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ static inline u32 rds_rdma_cookie_offset(rds_rdma_cookie_t cookie)
|
|||
}
|
||||
|
||||
int rds_get_mr(struct rds_sock *rs, char __user *optval, int optlen);
|
||||
int rds_get_mr_for_dest(struct rds_sock *rs, char __user *optval, int optlen);
|
||||
int rds_free_mr(struct rds_sock *rs, char __user *optval, int optlen);
|
||||
void rds_rdma_drop_keys(struct rds_sock *rs);
|
||||
int rds_cmsg_rdma_args(struct rds_sock *rs, struct rds_message *rm,
|
||||
|
|
|
|||
|
|
@ -195,8 +195,8 @@ void rds_recv_incoming(struct rds_connection *conn, __be32 saddr, __be32 daddr,
|
|||
* XXX we could spend more on the wire to get more robust failure
|
||||
* detection, arguably worth it to avoid data corruption.
|
||||
*/
|
||||
if (be64_to_cpu(inc->i_hdr.h_sequence) < conn->c_next_rx_seq
|
||||
&& (inc->i_hdr.h_flags & RDS_FLAG_RETRANSMITTED)) {
|
||||
if (be64_to_cpu(inc->i_hdr.h_sequence) < conn->c_next_rx_seq &&
|
||||
(inc->i_hdr.h_flags & RDS_FLAG_RETRANSMITTED)) {
|
||||
rds_stats_inc(s_recv_drop_old_seq);
|
||||
goto out;
|
||||
}
|
||||
|
|
@ -432,10 +432,9 @@ int rds_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
|
|||
}
|
||||
|
||||
timeo = wait_event_interruptible_timeout(*sk->sk_sleep,
|
||||
(!list_empty(&rs->rs_notify_queue)
|
||||
|| rs->rs_cong_notify
|
||||
|| rds_next_incoming(rs, &inc)),
|
||||
timeo);
|
||||
(!list_empty(&rs->rs_notify_queue) ||
|
||||
rs->rs_cong_notify ||
|
||||
rds_next_incoming(rs, &inc)), timeo);
|
||||
rdsdebug("recvmsg woke inc %p timeo %ld\n", inc,
|
||||
timeo);
|
||||
if (timeo > 0 || timeo == MAX_SCHEDULE_TIMEOUT)
|
||||
|
|
|
|||
|
|
@ -235,8 +235,8 @@ int rds_send_xmit(struct rds_connection *conn)
|
|||
* connection.
|
||||
* Therefore, we never retransmit messages with RDMA ops.
|
||||
*/
|
||||
if (rm->m_rdma_op
|
||||
&& test_bit(RDS_MSG_RETRANSMITTED, &rm->m_flags)) {
|
||||
if (rm->m_rdma_op &&
|
||||
test_bit(RDS_MSG_RETRANSMITTED, &rm->m_flags)) {
|
||||
spin_lock_irqsave(&conn->c_lock, flags);
|
||||
if (test_and_clear_bit(RDS_MSG_ON_CONN, &rm->m_flags))
|
||||
list_move(&rm->m_conn_item, &to_be_dropped);
|
||||
|
|
@ -247,8 +247,8 @@ int rds_send_xmit(struct rds_connection *conn)
|
|||
|
||||
/* Require an ACK every once in a while */
|
||||
len = ntohl(rm->m_inc.i_hdr.h_len);
|
||||
if (conn->c_unacked_packets == 0
|
||||
|| conn->c_unacked_bytes < len) {
|
||||
if (conn->c_unacked_packets == 0 ||
|
||||
conn->c_unacked_bytes < len) {
|
||||
__set_bit(RDS_MSG_ACK_REQUIRED, &rm->m_flags);
|
||||
|
||||
conn->c_unacked_packets = rds_sysctl_max_unacked_packets;
|
||||
|
|
@ -418,8 +418,8 @@ void rds_rdma_send_complete(struct rds_message *rm, int status)
|
|||
spin_lock(&rm->m_rs_lock);
|
||||
|
||||
ro = rm->m_rdma_op;
|
||||
if (test_bit(RDS_MSG_ON_SOCK, &rm->m_flags)
|
||||
&& ro && ro->r_notify && ro->r_notifier) {
|
||||
if (test_bit(RDS_MSG_ON_SOCK, &rm->m_flags) &&
|
||||
ro && ro->r_notify && ro->r_notifier) {
|
||||
notifier = ro->r_notifier;
|
||||
rs = rm->m_rs;
|
||||
sock_hold(rds_rs_to_sk(rs));
|
||||
|
|
@ -549,8 +549,7 @@ void rds_send_remove_from_sock(struct list_head *messages, int status)
|
|||
list_del_init(&rm->m_sock_item);
|
||||
rds_send_sndbuf_remove(rs, rm);
|
||||
|
||||
if (ro && ro->r_notifier
|
||||
&& (status || ro->r_notify)) {
|
||||
if (ro && ro->r_notifier && (status || ro->r_notify)) {
|
||||
notifier = ro->r_notifier;
|
||||
list_add_tail(¬ifier->n_list,
|
||||
&rs->rs_notify_queue);
|
||||
|
|
@ -877,8 +876,8 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
|
|||
if (ret)
|
||||
goto out;
|
||||
|
||||
if ((rm->m_rdma_cookie || rm->m_rdma_op)
|
||||
&& conn->c_trans->xmit_rdma == NULL) {
|
||||
if ((rm->m_rdma_cookie || rm->m_rdma_op) &&
|
||||
conn->c_trans->xmit_rdma == NULL) {
|
||||
if (printk_ratelimit())
|
||||
printk(KERN_NOTICE "rdma_op %p conn xmit_rdma %p\n",
|
||||
rm->m_rdma_op, conn->c_trans->xmit_rdma);
|
||||
|
|
@ -890,8 +889,8 @@ int rds_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
|
|||
* have scheduled a delayed reconnect however - in this case
|
||||
* we should not interfere.
|
||||
*/
|
||||
if (rds_conn_state(conn) == RDS_CONN_DOWN
|
||||
&& !test_and_set_bit(RDS_RECONNECT_PENDING, &conn->c_flags))
|
||||
if (rds_conn_state(conn) == RDS_CONN_DOWN &&
|
||||
!test_and_set_bit(RDS_RECONNECT_PENDING, &conn->c_flags))
|
||||
queue_delayed_work(rds_wq, &conn->c_conn_w, 0);
|
||||
|
||||
ret = rds_cong_wait(conn->c_fcong, dport, nonblock, rs);
|
||||
|
|
@ -973,8 +972,8 @@ rds_send_pong(struct rds_connection *conn, __be16 dport)
|
|||
* have scheduled a delayed reconnect however - in this case
|
||||
* we should not interfere.
|
||||
*/
|
||||
if (rds_conn_state(conn) == RDS_CONN_DOWN
|
||||
&& !test_and_set_bit(RDS_RECONNECT_PENDING, &conn->c_flags))
|
||||
if (rds_conn_state(conn) == RDS_CONN_DOWN &&
|
||||
!test_and_set_bit(RDS_RECONNECT_PENDING, &conn->c_flags))
|
||||
queue_delayed_work(rds_wq, &conn->c_conn_w, 0);
|
||||
|
||||
ret = rds_cong_wait(conn->c_fcong, dport, 1, NULL);
|
||||
|
|
|
|||
|
|
@ -67,11 +67,11 @@ static int rds_tcp_accept_one(struct socket *sock)
|
|||
inet = inet_sk(new_sock->sk);
|
||||
|
||||
rdsdebug("accepted tcp %u.%u.%u.%u:%u -> %u.%u.%u.%u:%u\n",
|
||||
NIPQUAD(inet->saddr), ntohs(inet->sport),
|
||||
NIPQUAD(inet->daddr), ntohs(inet->dport));
|
||||
NIPQUAD(inet->inet_saddr), ntohs(inet->inet_sport),
|
||||
NIPQUAD(inet->inet_daddr), ntohs(inet->inet_dport));
|
||||
|
||||
conn = rds_conn_create(inet->saddr, inet->daddr, &rds_tcp_transport,
|
||||
GFP_KERNEL);
|
||||
conn = rds_conn_create(inet->inet_saddr, inet->inet_daddr,
|
||||
&rds_tcp_transport, GFP_KERNEL);
|
||||
if (IS_ERR(conn)) {
|
||||
ret = PTR_ERR(conn);
|
||||
goto out;
|
||||
|
|
|
|||
|
|
@ -170,8 +170,8 @@ void rds_shutdown_worker(struct work_struct *work)
|
|||
* handler is supposed to check for state DISCONNECTING
|
||||
*/
|
||||
mutex_lock(&conn->c_cm_lock);
|
||||
if (!rds_conn_transition(conn, RDS_CONN_UP, RDS_CONN_DISCONNECTING)
|
||||
&& !rds_conn_transition(conn, RDS_CONN_ERROR, RDS_CONN_DISCONNECTING)) {
|
||||
if (!rds_conn_transition(conn, RDS_CONN_UP, RDS_CONN_DISCONNECTING) &&
|
||||
!rds_conn_transition(conn, RDS_CONN_ERROR, RDS_CONN_DISCONNECTING)) {
|
||||
rds_conn_error(conn, "shutdown called in state %d\n",
|
||||
atomic_read(&conn->c_state));
|
||||
mutex_unlock(&conn->c_cm_lock);
|
||||
|
|
|
|||
Loading…
Reference in a new issue