Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291981
b: refs/heads/master
c: 42872c7
h: refs/heads/master
i:
  291979: 1621c41
v: v3
  • Loading branch information
Roland Dreier committed Mar 12, 2012
1 parent 1a7f553 commit 6d3247d
Show file tree
Hide file tree
Showing 19 changed files with 66 additions and 108 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: db5a7a65c05867cb6ff5cb6d556a0edfce631d2d
refs/heads/master: 42872c7a5ed8d3ed49f51cb783978ca50369c564
24 changes: 13 additions & 11 deletions trunk/drivers/infiniband/core/iwcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -624,17 +624,6 @@ static void cm_conn_req_handler(struct iwcm_id_private *listen_id_priv,
*/
BUG_ON(iw_event->status);

/*
* We could be destroying the listening id. If so, ignore this
* upcall.
*/
spin_lock_irqsave(&listen_id_priv->lock, flags);
if (listen_id_priv->state != IW_CM_STATE_LISTEN) {
spin_unlock_irqrestore(&listen_id_priv->lock, flags);
goto out;
}
spin_unlock_irqrestore(&listen_id_priv->lock, flags);

cm_id = iw_create_cm_id(listen_id_priv->id.device,
listen_id_priv->id.cm_handler,
listen_id_priv->id.context);
Expand All @@ -649,6 +638,19 @@ static void cm_conn_req_handler(struct iwcm_id_private *listen_id_priv,
cm_id_priv = container_of(cm_id, struct iwcm_id_private, id);
cm_id_priv->state = IW_CM_STATE_CONN_RECV;

/*
* We could be destroying the listening id. If so, ignore this
* upcall.
*/
spin_lock_irqsave(&listen_id_priv->lock, flags);
if (listen_id_priv->state != IW_CM_STATE_LISTEN) {
spin_unlock_irqrestore(&listen_id_priv->lock, flags);
iw_cm_reject(cm_id, NULL, 0);
iw_destroy_cm_id(cm_id);
goto out;
}
spin_unlock_irqrestore(&listen_id_priv->lock, flags);

ret = alloc_work_entries(cm_id_priv, 3);
if (ret) {
iw_cm_reject(cm_id, NULL, 0);
Expand Down
27 changes: 15 additions & 12 deletions trunk/drivers/infiniband/core/sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,33 +179,36 @@ static ssize_t rate_show(struct ib_port *p, struct port_attribute *unused,
{
struct ib_port_attr attr;
char *speed = "";
int rate;
int rate = -1; /* in deci-Gb/sec */
ssize_t ret;

ret = ib_query_port(p->ibdev, p->port_num, &attr);
if (ret)
return ret;

rate = (25 * attr.active_speed) / 10;

switch (attr.active_speed) {
case 2:
case IB_SPEED_SDR:
rate = 25;
break;
case IB_SPEED_DDR:
speed = " DDR";
rate = 50;
break;
case 4:
case IB_SPEED_QDR:
speed = " QDR";
rate = 100;
break;
case 8:
case IB_SPEED_FDR10:
speed = " FDR10";
rate = 10;
rate = 100;
break;
case 16:
case IB_SPEED_FDR:
speed = " FDR";
rate = 14;
rate = 140;
break;
case 32:
case IB_SPEED_EDR:
speed = " EDR";
rate = 25;
rate = 250;
break;
}

Expand All @@ -214,7 +217,7 @@ static ssize_t rate_show(struct ib_port *p, struct port_attribute *unused,
return -EINVAL;

return sprintf(buf, "%d%s Gb/sec (%dX%s)\n",
rate, (attr.active_speed == 1) ? ".5" : "",
rate / 10, rate % 10 ? ".5" : "",
ib_width_enum_to_int(attr.active_width), speed);
}

Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/amso1100/c2_provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ static int c2_query_port(struct ib_device *ibdev,
props->pkey_tbl_len = 1;
props->qkey_viol_cntr = 0;
props->active_width = 1;
props->active_speed = 1;
props->active_speed = IB_SPEED_SDR;

return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/cxgb3/iwch_provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,7 @@ static int iwch_query_port(struct ib_device *ibdev,
props->gid_tbl_len = 1;
props->pkey_tbl_len = 1;
props->active_width = 2;
props->active_speed = 2;
props->active_speed = IB_SPEED_DDR;
props->max_msg_sz = -1;

return 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/cxgb4/provider.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ static int c4iw_query_port(struct ib_device *ibdev, u8 port,
props->gid_tbl_len = 1;
props->pkey_tbl_len = 1;
props->active_width = 2;
props->active_speed = 2;
props->active_speed = IB_SPEED_DDR;
props->max_msg_sz = -1;

return 0;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/ehca/ehca_hca.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ int ehca_query_port(struct ib_device *ibdev,
props->phys_state = 5;
props->state = rblock->state;
props->active_width = IB_WIDTH_12X;
props->active_speed = 0x1;
props->active_speed = IB_SPEED_SDR;
}

query_port1:
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/infiniband/hw/mlx4/cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,8 @@ static int mlx4_ib_poll_one(struct mlx4_ib_cq *cq,
wc->dlid_path_bits = (g_mlpath_rqpn >> 24) & 0x7f;
wc->wc_flags |= g_mlpath_rqpn & 0x80000000 ? IB_WC_GRH : 0;
wc->pkey_index = be32_to_cpu(cqe->immed_rss_invalid) & 0x7f;
wc->csum_ok = mlx4_ib_ipoib_csum_ok(cqe->status, cqe->checksum);
wc->wc_flags |= mlx4_ib_ipoib_csum_ok(cqe->status,
cqe->checksum) ? IB_WC_IP_CSUM_OK : 0;
if (rdma_port_get_link_layer(wc->qp->device,
(*cur_qp)->port) == IB_LINK_LAYER_ETHERNET)
wc->sl = be16_to_cpu(cqe->sl_vid) >> 13;
Expand Down
33 changes: 15 additions & 18 deletions trunk/drivers/infiniband/hw/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,31 +230,28 @@ static int ib_link_query_port(struct ib_device *ibdev, u8 port,

switch (ext_active_speed) {
case 1:
props->active_speed = 16; /* FDR */
props->active_speed = IB_SPEED_FDR;
break;
case 2:
props->active_speed = 32; /* EDR */
props->active_speed = IB_SPEED_EDR;
break;
}
}

/* If reported active speed is QDR, check if is FDR-10 */
if (props->active_speed == 4) {
if (to_mdev(ibdev)->dev->caps.ext_port_cap[port] &
MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO) {
init_query_mad(in_mad);
in_mad->attr_id = MLX4_ATTR_EXTENDED_PORT_INFO;
in_mad->attr_mod = cpu_to_be32(port);

err = mlx4_MAD_IFC(to_mdev(ibdev), 1, 1, port,
NULL, NULL, in_mad, out_mad);
if (err)
goto out;
if (props->active_speed == IB_SPEED_QDR) {
init_query_mad(in_mad);
in_mad->attr_id = MLX4_ATTR_EXTENDED_PORT_INFO;
in_mad->attr_mod = cpu_to_be32(port);

/* Checking LinkSpeedActive for FDR-10 */
if (out_mad->data[15] & 0x1)
props->active_speed = 8;
}
err = mlx4_MAD_IFC(to_mdev(ibdev), 1, 1, port,
NULL, NULL, in_mad, out_mad);
if (err)
return err;

/* Checking LinkSpeedActive for FDR-10 */
if (out_mad->data[15] & 0x1)
props->active_speed = IB_SPEED_FDR10;
}
out:
kfree(in_mad);
Expand Down Expand Up @@ -290,7 +287,7 @@ static int eth_link_query_port(struct ib_device *ibdev, u8 port,

props->active_width = (((u8 *)mailbox->buf)[5] == 0x40) ?
IB_WIDTH_4X : IB_WIDTH_1X;
props->active_speed = 4;
props->active_speed = IB_SPEED_QDR;
props->port_cap_flags = IB_PORT_CM_SUP;
props->gid_tbl_len = mdev->dev->caps.gid_table_len[port];
props->max_msg_sz = mdev->dev->caps.max_msg_sz;
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/infiniband/hw/mthca/mthca_cq.c
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,8 @@ static inline int mthca_poll_one(struct mthca_dev *dev,
entry->wc_flags |= cqe->g_mlpath & 0x80 ? IB_WC_GRH : 0;
checksum = (be32_to_cpu(cqe->rqpn) >> 24) |
((be32_to_cpu(cqe->my_ee) >> 16) & 0xff00);
entry->csum_ok = (cqe->sl_ipok & 1 && checksum == 0xffff);
entry->wc_flags |= (cqe->sl_ipok & 1 && checksum == 0xffff) ?
IB_WC_IP_CSUM_OK : 0;
}

entry->status = IB_WC_SUCCESS;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/hw/nes/nes_verbs.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ static int nes_query_port(struct ib_device *ibdev, u8 port, struct ib_port_attr
props->pkey_tbl_len = 1;
props->qkey_viol_cntr = 0;
props->active_width = IB_WIDTH_4X;
props->active_speed = 1;
props->active_speed = IB_SPEED_SDR;
props->max_msg_sz = 0x80000000;

return 0;
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/infiniband/hw/qib/qib_rc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2048,7 +2048,6 @@ void qib_rc_rcv(struct qib_ctxtdata *rcd, struct qib_ib_header *hdr,
wc.pkey_index = 0;
wc.dlid_path_bits = 0;
wc.port_num = 0;
wc.csum_ok = 0;
/* Signal completion event if the solicited bit is set. */
qib_cq_enter(to_icq(qp->ibqp.recv_cq), &wc,
(ohdr->bth[0] &
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/infiniband/hw/qib/qib_uc.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ void qib_uc_rcv(struct qib_ibport *ibp, struct qib_ib_header *hdr,
wc.pkey_index = 0;
wc.dlid_path_bits = 0;
wc.port_num = 0;
wc.csum_ok = 0;
/* Signal completion event if the solicited bit is set. */
qib_cq_enter(to_icq(qp->ibqp.recv_cq), &wc,
(ohdr->bth[0] &
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/infiniband/ulp/ipoib/ipoib_ib.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ static void ipoib_ib_handle_rx_wc(struct net_device *dev, struct ib_wc *wc)
dev->stats.rx_bytes += skb->len;

skb->dev = dev;
if ((dev->features & NETIF_F_RXCSUM) && likely(wc->csum_ok))
if ((dev->features & NETIF_F_RXCSUM) &&
likely(wc->wc_flags & IB_WC_IP_CSUM_OK))
skb->ip_summed = CHECKSUM_UNNECESSARY;

napi_gro_receive(&priv->napi, skb);
Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/net/ethernet/mellanox/mlx4/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1455,16 +1455,11 @@ static int mlx4_setup_hca(struct mlx4_dev *dev)
"ib capabilities (%d). Continuing "
"with caps = 0\n", port, err);
dev->caps.ib_port_def_cap[port] = ib_port_default_caps;

if (mlx4_is_mfunc(dev))
dev->caps.port_ib_mtu[port] = IB_MTU_2048;
else
dev->caps.port_ib_mtu[port] = IB_MTU_4096;
err = mlx4_check_ext_port_caps(dev, port);
if (err)
mlx4_warn(dev, "failed to get port %d extended "
"port capabilities support info (%d)."
" Assuming not supported\n",
port, err);

err = mlx4_SET_PORT(dev, port);
if (err) {
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/net/ethernet/mellanox/mlx4/mlx4.h
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,6 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave,
struct mlx4_cmd_mailbox *outbox,
struct mlx4_cmd_info *cmd);
int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps);
int mlx4_check_ext_port_caps(struct mlx4_dev *dev, u8 port);


int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
Expand Down
43 changes: 0 additions & 43 deletions trunk/drivers/net/ethernet/mellanox/mlx4/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,49 +590,6 @@ int mlx4_get_port_ib_caps(struct mlx4_dev *dev, u8 port, __be32 *caps)
return err;
}

int mlx4_check_ext_port_caps(struct mlx4_dev *dev, u8 port)
{
struct mlx4_cmd_mailbox *inmailbox, *outmailbox;
u8 *inbuf, *outbuf;
int err, packet_error;

inmailbox = mlx4_alloc_cmd_mailbox(dev);
if (IS_ERR(inmailbox))
return PTR_ERR(inmailbox);

outmailbox = mlx4_alloc_cmd_mailbox(dev);
if (IS_ERR(outmailbox)) {
mlx4_free_cmd_mailbox(dev, inmailbox);
return PTR_ERR(outmailbox);
}

inbuf = inmailbox->buf;
outbuf = outmailbox->buf;
memset(inbuf, 0, 256);
memset(outbuf, 0, 256);
inbuf[0] = 1;
inbuf[1] = 1;
inbuf[2] = 1;
inbuf[3] = 1;

*(__be16 *) (&inbuf[16]) = MLX4_ATTR_EXTENDED_PORT_INFO;
*(__be32 *) (&inbuf[20]) = cpu_to_be32(port);

err = mlx4_cmd_box(dev, inmailbox->dma, outmailbox->dma, port, 3,
MLX4_CMD_MAD_IFC, MLX4_CMD_TIME_CLASS_C,
MLX4_CMD_NATIVE);

packet_error = be16_to_cpu(*(__be16 *) (outbuf + 4));

dev->caps.ext_port_cap[port] = (!err && !packet_error) ?
MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO
: 0;

mlx4_free_cmd_mailbox(dev, inmailbox);
mlx4_free_cmd_mailbox(dev, outmailbox);
return err;
}

static int mlx4_common_set_port(struct mlx4_dev *dev, int slave, u32 in_mod,
u8 op_mod, struct mlx4_cmd_mailbox *inbox)
{
Expand Down
5 changes: 0 additions & 5 deletions trunk/include/linux/mlx4/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ enum {

#define MLX4_ATTR_EXTENDED_PORT_INFO cpu_to_be16(0xff90)

enum {
MLX_EXT_PORT_CAP_FLAG_EXTENDED_PORT_INFO = 1 << 0
};

enum {
MLX4_BMME_FLAG_LOCAL_INV = 1 << 6,
MLX4_BMME_FLAG_REMOTE_INV = 1 << 7,
Expand Down Expand Up @@ -314,7 +310,6 @@ struct mlx4_caps {
u32 port_mask[MLX4_MAX_PORTS + 1];
enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1];
u32 max_counters;
u8 ext_port_cap[MLX4_MAX_PORTS + 1];
u8 port_ib_mtu[MLX4_MAX_PORTS + 1];
};

Expand Down
11 changes: 10 additions & 1 deletion trunk/include/rdma/ib_verbs.h
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,15 @@ static inline int ib_width_enum_to_int(enum ib_port_width width)
}
}

enum ib_port_speed {
IB_SPEED_SDR = 1,
IB_SPEED_DDR = 2,
IB_SPEED_QDR = 4,
IB_SPEED_FDR10 = 8,
IB_SPEED_FDR = 16,
IB_SPEED_EDR = 32
};

struct ib_protocol_stats {
/* TBD... */
};
Expand Down Expand Up @@ -509,6 +518,7 @@ enum ib_wc_flags {
IB_WC_GRH = 1,
IB_WC_WITH_IMM = (1<<1),
IB_WC_WITH_INVALIDATE = (1<<2),
IB_WC_IP_CSUM_OK = (1<<3),
};

struct ib_wc {
Expand All @@ -529,7 +539,6 @@ struct ib_wc {
u8 sl;
u8 dlid_path_bits;
u8 port_num; /* valid only for DR SMPs on switches */
int csum_ok;
};

enum ib_cq_notify_flags {
Expand Down

0 comments on commit 6d3247d

Please sign in to comment.