Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband

Pull infiniband/rdma fixes from Roland Dreier:
"cxgb4 hardware driver fixes"

* tag 'rdma-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
RDMA/cxgb4: Update Kconfig to include Chelsio T5 adapter
RDMA/cxgb4: Only allow kernel db ringing for T4 devs
RDMA/cxgb4: Force T5 connections to use TAHOE congestion control
RDMA/cxgb4: Fix endpoint mutex deadlocks

+55 -18
+3 -3
drivers/infiniband/hw/cxgb4/Kconfig
··· 1 1 config INFINIBAND_CXGB4 2 - tristate "Chelsio T4 RDMA Driver" 2 + tristate "Chelsio T4/T5 RDMA Driver" 3 3 depends on CHELSIO_T4 && INET && (IPV6 || IPV6=n) 4 4 select GENERIC_ALLOCATOR 5 5 ---help--- 6 - This is an iWARP/RDMA driver for the Chelsio T4 1GbE and 7 - 10GbE adapters. 6 + This is an iWARP/RDMA driver for the Chelsio T4 and T5 7 + 1GbE, 10GbE adapters and T5 40GbE adapter. 8 8 9 9 For general information about Chelsio and our products, visit 10 10 our website at <http://www.chelsio.com>.
+28 -11
drivers/infiniband/hw/cxgb4/cm.c
··· 587 587 opt2 |= SACK_EN(1); 588 588 if (wscale && enable_tcp_window_scaling) 589 589 opt2 |= WND_SCALE_EN(1); 590 + if (is_t5(ep->com.dev->rdev.lldi.adapter_type)) { 591 + opt2 |= T5_OPT_2_VALID; 592 + opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); 593 + } 590 594 t4_set_arp_err_handler(skb, NULL, act_open_req_arp_failure); 591 595 592 596 if (is_t4(ep->com.dev->rdev.lldi.adapter_type)) { ··· 1000 996 static int abort_connection(struct c4iw_ep *ep, struct sk_buff *skb, gfp_t gfp) 1001 997 { 1002 998 PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid); 1003 - state_set(&ep->com, ABORTING); 999 + __state_set(&ep->com, ABORTING); 1004 1000 set_bit(ABORT_CONN, &ep->com.history); 1005 1001 return send_abort(ep, skb, gfp); 1006 1002 } ··· 1158 1154 return credits; 1159 1155 } 1160 1156 1161 - static void process_mpa_reply(struct c4iw_ep *ep, struct sk_buff *skb) 1157 + static int process_mpa_reply(struct c4iw_ep *ep, struct sk_buff *skb) 1162 1158 { 1163 1159 struct mpa_message *mpa; 1164 1160 struct mpa_v2_conn_params *mpa_v2_params; ··· 1168 1164 struct c4iw_qp_attributes attrs; 1169 1165 enum c4iw_qp_attr_mask mask; 1170 1166 int err; 1167 + int disconnect = 0; 1171 1168 1172 1169 PDBG("%s ep %p tid %u\n", __func__, ep, ep->hwtid); 1173 1170 ··· 1178 1173 * will abort the connection. 1179 1174 */ 1180 1175 if (stop_ep_timer(ep)) 1181 - return; 1176 + return 0; 1182 1177 1183 1178 /* 1184 1179 * If we get more than the supported amount of private data ··· 1200 1195 * if we don't even have the mpa message, then bail. 1201 1196 */ 1202 1197 if (ep->mpa_pkt_len < sizeof(*mpa)) 1203 - return; 1198 + return 0; 1204 1199 mpa = (struct mpa_message *) ep->mpa_pkt; 1205 1200 1206 1201 /* Validate MPA header. */ ··· 1240 1235 * We'll continue process when more data arrives. 1241 1236 */ 1242 1237 if (ep->mpa_pkt_len < (sizeof(*mpa) + plen)) 1243 - return; 1238 + return 0; 1244 1239 1245 1240 if (mpa->flags & MPA_REJECT) { 1246 1241 err = -ECONNREFUSED; ··· 1342 1337 attrs.layer_etype = LAYER_MPA | DDP_LLP; 1343 1338 attrs.ecode = MPA_NOMATCH_RTR; 1344 1339 attrs.next_state = C4IW_QP_STATE_TERMINATE; 1340 + attrs.send_term = 1; 1345 1341 err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, 1346 - C4IW_QP_ATTR_NEXT_STATE, &attrs, 0); 1342 + C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); 1347 1343 err = -ENOMEM; 1344 + disconnect = 1; 1348 1345 goto out; 1349 1346 } 1350 1347 ··· 1362 1355 attrs.layer_etype = LAYER_MPA | DDP_LLP; 1363 1356 attrs.ecode = MPA_INSUFF_IRD; 1364 1357 attrs.next_state = C4IW_QP_STATE_TERMINATE; 1358 + attrs.send_term = 1; 1365 1359 err = c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, 1366 - C4IW_QP_ATTR_NEXT_STATE, &attrs, 0); 1360 + C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); 1367 1361 err = -ENOMEM; 1362 + disconnect = 1; 1368 1363 goto out; 1369 1364 } 1370 1365 goto out; ··· 1375 1366 send_abort(ep, skb, GFP_KERNEL); 1376 1367 out: 1377 1368 connect_reply_upcall(ep, err); 1378 - return; 1369 + return disconnect; 1379 1370 } 1380 1371 1381 1372 static void process_mpa_request(struct c4iw_ep *ep, struct sk_buff *skb) ··· 1533 1524 unsigned int tid = GET_TID(hdr); 1534 1525 struct tid_info *t = dev->rdev.lldi.tids; 1535 1526 __u8 status = hdr->status; 1527 + int disconnect = 0; 1536 1528 1537 1529 ep = lookup_tid(t, tid); 1538 1530 if (!ep) ··· 1549 1539 switch (ep->com.state) { 1550 1540 case MPA_REQ_SENT: 1551 1541 ep->rcv_seq += dlen; 1552 - process_mpa_reply(ep, skb); 1542 + disconnect = process_mpa_reply(ep, skb); 1553 1543 break; 1554 1544 case MPA_REQ_WAIT: 1555 1545 ep->rcv_seq += dlen; ··· 1565 1555 ep->com.state, ep->hwtid, status); 1566 1556 attrs.next_state = C4IW_QP_STATE_TERMINATE; 1567 1557 c4iw_modify_qp(ep->com.qp->rhp, ep->com.qp, 1568 - C4IW_QP_ATTR_NEXT_STATE, &attrs, 0); 1558 + C4IW_QP_ATTR_NEXT_STATE, &attrs, 1); 1559 + disconnect = 1; 1569 1560 break; 1570 1561 } 1571 1562 default: 1572 1563 break; 1573 1564 } 1574 1565 mutex_unlock(&ep->com.mutex); 1566 + if (disconnect) 1567 + c4iw_ep_disconnect(ep, 0, GFP_KERNEL); 1575 1568 return 0; 1576 1569 } 1577 1570 ··· 2021 2008 G_IP_HDR_LEN(hlen); 2022 2009 if (tcph->ece && tcph->cwr) 2023 2010 opt2 |= CCTRL_ECN(1); 2011 + } 2012 + if (is_t5(ep->com.dev->rdev.lldi.adapter_type)) { 2013 + opt2 |= T5_OPT_2_VALID; 2014 + opt2 |= V_CONG_CNTRL(CONG_ALG_TAHOE); 2024 2015 } 2025 2016 2026 2017 rpl = cplhdr(skb); ··· 3499 3482 __func__, ep, ep->hwtid, ep->com.state); 3500 3483 abort = 0; 3501 3484 } 3502 - mutex_unlock(&ep->com.mutex); 3503 3485 if (abort) 3504 3486 abort_connection(ep, NULL, GFP_KERNEL); 3487 + mutex_unlock(&ep->com.mutex); 3505 3488 c4iw_put_ep(&ep->com); 3506 3489 } 3507 3490
+1
drivers/infiniband/hw/cxgb4/iw_cxgb4.h
··· 435 435 u8 ecode; 436 436 u16 sq_db_inc; 437 437 u16 rq_db_inc; 438 + u8 send_term; 438 439 }; 439 440 440 441 struct c4iw_qp {
+9 -4
drivers/infiniband/hw/cxgb4/qp.c
··· 1388 1388 qhp->attr.layer_etype = attrs->layer_etype; 1389 1389 qhp->attr.ecode = attrs->ecode; 1390 1390 ep = qhp->ep; 1391 - disconnect = 1; 1392 - c4iw_get_ep(&qhp->ep->com); 1393 - if (!internal) 1391 + if (!internal) { 1392 + c4iw_get_ep(&qhp->ep->com); 1394 1393 terminate = 1; 1395 - else { 1394 + disconnect = 1; 1395 + } else { 1396 + terminate = qhp->attr.send_term; 1396 1397 ret = rdma_fini(rhp, qhp, ep); 1397 1398 if (ret) 1398 1399 goto err; ··· 1777 1776 /* 1778 1777 * Use SQ_PSN and RQ_PSN to pass in IDX_INC values for 1779 1778 * ringing the queue db when we're in DB_FULL mode. 1779 + * Only allow this on T4 devices. 1780 1780 */ 1781 1781 attrs.sq_db_inc = attr->sq_psn; 1782 1782 attrs.rq_db_inc = attr->rq_psn; 1783 1783 mask |= (attr_mask & IB_QP_SQ_PSN) ? C4IW_QP_ATTR_SQ_DB : 0; 1784 1784 mask |= (attr_mask & IB_QP_RQ_PSN) ? C4IW_QP_ATTR_RQ_DB : 0; 1785 + if (is_t5(to_c4iw_qp(ibqp)->rhp->rdev.lldi.adapter_type) && 1786 + (mask & (C4IW_QP_ATTR_SQ_DB|C4IW_QP_ATTR_RQ_DB))) 1787 + return -EINVAL; 1785 1788 1786 1789 return c4iw_modify_qp(rhp, qhp, mask, &attrs, 0); 1787 1790 }
+14
drivers/infiniband/hw/cxgb4/t4fw_ri_api.h
··· 836 836 #define V_RX_DACK_CHANGE(x) ((x) << S_RX_DACK_CHANGE) 837 837 #define F_RX_DACK_CHANGE V_RX_DACK_CHANGE(1U) 838 838 839 + enum { /* TCP congestion control algorithms */ 840 + CONG_ALG_RENO, 841 + CONG_ALG_TAHOE, 842 + CONG_ALG_NEWRENO, 843 + CONG_ALG_HIGHSPEED 844 + }; 845 + 846 + #define S_CONG_CNTRL 14 847 + #define M_CONG_CNTRL 0x3 848 + #define V_CONG_CNTRL(x) ((x) << S_CONG_CNTRL) 849 + #define G_CONG_CNTRL(x) (((x) >> S_CONG_CNTRL) & M_CONG_CNTRL) 850 + 851 + #define T5_OPT_2_VALID (1 << 31) 852 + 839 853 #endif /* _T4FW_RI_API_H_ */