Skip to content

Commit

Permalink
Merge branch 'for-4.2-misc' into k.o/for-4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Doug Ledford committed Jun 2, 2015
2 parents 73cdaae + 1156256 commit b806ef3
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 18 deletions.
2 changes: 2 additions & 0 deletions drivers/infiniband/core/cma.c
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,7 @@ static int cma_iw_listen(struct rdma_id_private *id_priv, int backlog)
if (IS_ERR(id))
return PTR_ERR(id);

id->tos = id_priv->tos;
id_priv->cm_id.iw = id;

memcpy(&id_priv->cm_id.iw->local_addr, cma_src_addr(id_priv),
Expand Down Expand Up @@ -2851,6 +2852,7 @@ static int cma_connect_iw(struct rdma_id_private *id_priv,
if (IS_ERR(cm_id))
return PTR_ERR(cm_id);

cm_id->tos = id_priv->tos;
id_priv->cm_id.iw = cm_id;

memcpy(&cm_id->local_addr, cma_src_addr(id_priv),
Expand Down
5 changes: 3 additions & 2 deletions drivers/infiniband/hw/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,6 @@ static struct ib_flow *mlx4_ib_create_flow(struct ib_qp *qp,
&mflow->reg_id[i].id);
if (err)
goto err_create_flow;
i++;
if (is_bonded) {
/* Application always sees one port so the mirror rule
* must be on port #2
Expand All @@ -1200,14 +1199,15 @@ static struct ib_flow *mlx4_ib_create_flow(struct ib_qp *qp,
j++;
}

i++;
}

if (i < ARRAY_SIZE(type) && flow_attr->type == IB_FLOW_ATTR_NORMAL) {
err = mlx4_ib_tunnel_steer_add(qp, flow_attr,
&mflow->reg_id[i].id);
if (err)
goto err_create_flow;
i++;

if (is_bonded) {
flow_attr->port = 2;
err = mlx4_ib_tunnel_steer_add(qp, flow_attr,
Expand All @@ -1218,6 +1218,7 @@ static struct ib_flow *mlx4_ib_create_flow(struct ib_qp *qp,
j++;
}
/* function to create mirror rule */
i++;
}

return &mflow->ibflow;
Expand Down
7 changes: 7 additions & 0 deletions drivers/infiniband/hw/nes/nes_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1616,6 +1616,8 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
&cm_node->loc_addr, cm_node->loc_port,
&cm_node->rem_addr, cm_node->rem_port);
cm_node->listener = listener;
if (listener)
cm_node->tos = listener->tos;
cm_node->netdev = nesvnic->netdev;
cm_node->cm_id = cm_info->cm_id;
memcpy(cm_node->loc_mac, nesvnic->netdev->dev_addr, ETH_ALEN);
Expand Down Expand Up @@ -2938,6 +2940,9 @@ static int nes_cm_init_tsa_conn(struct nes_qp *nesqp, struct nes_cm_node *cm_nod

nesqp->nesqp_context->misc2 |= cpu_to_le32(64 << NES_QPCONTEXT_MISC2_TTL_SHIFT);

nesqp->nesqp_context->misc2 |= cpu_to_le32(
cm_node->tos << NES_QPCONTEXT_MISC2_TOS_SHIFT);

nesqp->nesqp_context->mss |= cpu_to_le32(((u32)cm_node->tcp_cntxt.mss) << 16);

nesqp->nesqp_context->tcp_state_flow_label |= cpu_to_le32(
Expand Down Expand Up @@ -3612,6 +3617,7 @@ int nes_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
cm_node->ord_size = 1;

cm_node->apbvt_set = apbvt_set;
cm_node->tos = cm_id->tos;
nesqp->cm_node = cm_node;
cm_node->nesqp = nesqp;
nes_add_ref(&nesqp->ibqp);
Expand Down Expand Up @@ -3666,6 +3672,7 @@ int nes_create_listen(struct iw_cm_id *cm_id, int backlog)
}

cm_id->provider_data = cm_node;
cm_node->tos = cm_id->tos;

if (!cm_node->reused_node) {
if (nes_create_mapinfo(&cm_info))
Expand Down
2 changes: 2 additions & 0 deletions drivers/infiniband/hw/nes/nes_cm.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,7 @@ struct nes_cm_listener {
int backlog;
enum nes_cm_listener_state listener_state;
u32 reused_node;
u8 tos;
};

/* per connection node and node state information */
Expand Down Expand Up @@ -352,6 +353,7 @@ struct nes_cm_node {
struct list_head reset_entry;
struct nes_qp *nesqp;
atomic_t passive_state;
u8 tos;
};

/* structure for client or CM to fill when making CM api calls. */
Expand Down
7 changes: 6 additions & 1 deletion drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,12 @@ static struct ocrdma_pd *_ocrdma_alloc_pd(struct ocrdma_dev *dev,

if (dev->pd_mgr->pd_prealloc_valid) {
status = ocrdma_get_pd_num(dev, pd);
return (status == 0) ? pd : ERR_PTR(status);
if (status == 0) {
return pd;
} else {
kfree(pd);
return ERR_PTR(status);
}
}

retry:
Expand Down
4 changes: 2 additions & 2 deletions drivers/infiniband/ulp/ipoib/ipoib_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv)
{
struct ipoib_neigh_table *ntbl = &priv->ntbl;
struct ipoib_neigh_hash *htbl;
struct ipoib_neigh **buckets;
struct ipoib_neigh __rcu **buckets;
u32 size;

clear_bit(IPOIB_NEIGH_TBL_FLUSH, &priv->flags);
Expand All @@ -1146,7 +1146,7 @@ static int ipoib_neigh_hash_init(struct ipoib_dev_priv *priv)
htbl->size = size;
htbl->mask = (size - 1);
htbl->buckets = buckets;
ntbl->htbl = htbl;
RCU_INIT_POINTER(ntbl->htbl, htbl);
htbl->ntbl = ntbl;
atomic_set(&ntbl->entries, 0);

Expand Down
1 change: 1 addition & 0 deletions include/rdma/iw_cm.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ struct iw_cm_id {
/* Used by provider to add and remove refs on IW cm_id */
void (*add_ref)(struct iw_cm_id *);
void (*rem_ref)(struct iw_cm_id *);
u8 tos;
};

struct iw_cm_conn_param {
Expand Down
17 changes: 11 additions & 6 deletions net/rds/ib_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,8 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
}

rds_message_addref(rm);
rm->data.op_dmasg = 0;
rm->data.op_dmaoff = 0;
ic->i_data_op = &rm->data;

/* Finalize the header */
Expand Down Expand Up @@ -624,7 +626,7 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
send = &ic->i_sends[pos];
first = send;
prev = NULL;
scat = &ic->i_data_op->op_sg[sg];
scat = &ic->i_data_op->op_sg[rm->data.op_dmasg];
i = 0;
do {
unsigned int len = 0;
Expand All @@ -646,17 +648,20 @@ int rds_ib_xmit(struct rds_connection *conn, struct rds_message *rm,
/* Set up the data, if present */
if (i < work_alloc
&& scat != &rm->data.op_sg[rm->data.op_count]) {
len = min(RDS_FRAG_SIZE, ib_sg_dma_len(dev, scat) - off);
len = min(RDS_FRAG_SIZE,
ib_sg_dma_len(dev, scat) - rm->data.op_dmaoff);
send->s_wr.num_sge = 2;

send->s_sge[1].addr = ib_sg_dma_address(dev, scat) + off;
send->s_sge[1].addr = ib_sg_dma_address(dev, scat);
send->s_sge[1].addr += rm->data.op_dmaoff;
send->s_sge[1].length = len;

bytes_sent += len;
off += len;
if (off == ib_sg_dma_len(dev, scat)) {
rm->data.op_dmaoff += len;
if (rm->data.op_dmaoff == ib_sg_dma_len(dev, scat)) {
scat++;
off = 0;
rm->data.op_dmasg++;
rm->data.op_dmaoff = 0;
}
}

Expand Down
18 changes: 11 additions & 7 deletions net/rds/iw_send.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,8 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm,
ic->i_unsignaled_wrs = rds_iw_sysctl_max_unsig_wrs;
ic->i_unsignaled_bytes = rds_iw_sysctl_max_unsig_bytes;
rds_message_addref(rm);
rm->data.op_dmasg = 0;
rm->data.op_dmaoff = 0;
ic->i_rm = rm;

/* Finalize the header */
Expand Down Expand Up @@ -622,7 +624,7 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm,
send = &ic->i_sends[pos];
first = send;
prev = NULL;
scat = &rm->data.op_sg[sg];
scat = &rm->data.op_sg[rm->data.op_dmasg];
sent = 0;
i = 0;

Expand Down Expand Up @@ -656,10 +658,11 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm,

send = &ic->i_sends[pos];

len = min(RDS_FRAG_SIZE, ib_sg_dma_len(dev, scat) - off);
len = min(RDS_FRAG_SIZE,
ib_sg_dma_len(dev, scat) - rm->data.op_dmaoff);
rds_iw_xmit_populate_wr(ic, send, pos,
ib_sg_dma_address(dev, scat) + off, len,
send_flags);
ib_sg_dma_address(dev, scat) + rm->data.op_dmaoff, len,
send_flags);

/*
* We want to delay signaling completions just enough to get
Expand Down Expand Up @@ -687,10 +690,11 @@ int rds_iw_xmit(struct rds_connection *conn, struct rds_message *rm,
&send->s_wr, send->s_wr.num_sge, send->s_wr.next);

sent += len;
off += len;
if (off == ib_sg_dma_len(dev, scat)) {
rm->data.op_dmaoff += len;
if (rm->data.op_dmaoff == ib_sg_dma_len(dev, scat)) {
scat++;
off = 0;
rm->data.op_dmaoff = 0;
rm->data.op_dmasg++;
}

add_header:
Expand Down
2 changes: 2 additions & 0 deletions net/rds/rds.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,8 @@ struct rds_message {
unsigned int op_active:1;
unsigned int op_nents;
unsigned int op_count;
unsigned int op_dmasg;
unsigned int op_dmaoff;
struct scatterlist *op_sg;
} data;
};
Expand Down

0 comments on commit b806ef3

Please sign in to comment.