aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet
diff options
context:
space:
mode:
authorVipul Pandya <vipul@chelsio.com>2012-12-10 04:30:54 -0500
committerRoland Dreier <roland@purestorage.com>2012-12-20 02:02:43 -0500
commit5be78ee924ae8fb2b4a5b8d012a7d003849337ee (patch)
treef1ca2268c5e752401e5cac097460c4fa19b0fa0c /drivers/net/ethernet
parentdca4faeb812f665dab0607d8e0660ae564387186 (diff)
RDMA/cxgb4: Fix LE hash collision bug for active open connection
It enables establishing active open connection using fw_ofld_connection work request when cpl_act_open_rpl says TCAM full error which may be because of LE hash collision. Current support is only for IPv4 active open connections. Sets ntuple bits in active open requests. For T4 firmware greater than 1.4.10.0 ntuple bits are required to be set. Adds nocong and enable_ecn module parameter options. Signed-off-by: Vipul Pandya <vipul@chelsio.com> [ Move all FW return values to t4fw_api.h. - Roland ] Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/net/ethernet')
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4_msg.h19
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4_regs.h2
-rw-r--r--drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h143
3 files changed, 162 insertions, 2 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
index 99ff71764499..dcf6d61794ea 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_msg.h
@@ -193,6 +193,10 @@ struct work_request_hdr {
193 __be64 wr_lo; 193 __be64 wr_lo;
194}; 194};
195 195
196/* wr_hi fields */
197#define S_WR_OP 24
198#define V_WR_OP(x) ((__u64)(x) << S_WR_OP)
199
196#define WR_HDR struct work_request_hdr wr 200#define WR_HDR struct work_request_hdr wr
197 201
198struct cpl_pass_open_req { 202struct cpl_pass_open_req {
@@ -204,12 +208,14 @@ struct cpl_pass_open_req {
204 __be32 peer_ip; 208 __be32 peer_ip;
205 __be64 opt0; 209 __be64 opt0;
206#define TX_CHAN(x) ((x) << 2) 210#define TX_CHAN(x) ((x) << 2)
211#define NO_CONG(x) ((x) << 4)
207#define DELACK(x) ((x) << 5) 212#define DELACK(x) ((x) << 5)
208#define ULP_MODE(x) ((x) << 8) 213#define ULP_MODE(x) ((x) << 8)
209#define RCV_BUFSIZ(x) ((x) << 12) 214#define RCV_BUFSIZ(x) ((x) << 12)
210#define DSCP(x) ((x) << 22) 215#define DSCP(x) ((x) << 22)
211#define SMAC_SEL(x) ((u64)(x) << 28) 216#define SMAC_SEL(x) ((u64)(x) << 28)
212#define L2T_IDX(x) ((u64)(x) << 36) 217#define L2T_IDX(x) ((u64)(x) << 36)
218#define TCAM_BYPASS(x) ((u64)(x) << 48)
213#define NAGLE(x) ((u64)(x) << 49) 219#define NAGLE(x) ((u64)(x) << 49)
214#define WND_SCALE(x) ((u64)(x) << 50) 220#define WND_SCALE(x) ((u64)(x) << 50)
215#define KEEP_ALIVE(x) ((u64)(x) << 54) 221#define KEEP_ALIVE(x) ((u64)(x) << 54)
@@ -247,8 +253,10 @@ struct cpl_pass_accept_rpl {
247#define RSS_QUEUE_VALID (1 << 10) 253#define RSS_QUEUE_VALID (1 << 10)
248#define RX_COALESCE_VALID(x) ((x) << 11) 254#define RX_COALESCE_VALID(x) ((x) << 11)
249#define RX_COALESCE(x) ((x) << 12) 255#define RX_COALESCE(x) ((x) << 12)
256#define PACE(x) ((x) << 16)
250#define TX_QUEUE(x) ((x) << 23) 257#define TX_QUEUE(x) ((x) << 23)
251#define RX_CHANNEL(x) ((x) << 26) 258#define RX_CHANNEL(x) ((x) << 26)
259#define CCTRL_ECN(x) ((x) << 27)
252#define WND_SCALE_EN(x) ((x) << 28) 260#define WND_SCALE_EN(x) ((x) << 28)
253#define TSTAMPS_EN(x) ((x) << 29) 261#define TSTAMPS_EN(x) ((x) << 29)
254#define SACK_EN(x) ((x) << 30) 262#define SACK_EN(x) ((x) << 30)
@@ -635,6 +643,17 @@ struct cpl_fw6_msg {
635/* cpl_fw6_msg.type values */ 643/* cpl_fw6_msg.type values */
636enum { 644enum {
637 FW6_TYPE_CMD_RPL = 0, 645 FW6_TYPE_CMD_RPL = 0,
646 FW6_TYPE_WR_RPL = 1,
647 FW6_TYPE_CQE = 2,
648 FW6_TYPE_OFLD_CONNECTION_WR_RPL = 3,
649};
650
651struct cpl_fw6_msg_ofld_connection_wr_rpl {
652 __u64 cookie;
653 __be32 tid; /* or atid in case of active failure */
654 __u8 t_state;
655 __u8 retval;
656 __u8 rsvd[2];
638}; 657};
639 658
640enum { 659enum {
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h b/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h
index aef529198922..a2c29f7b7aa1 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h
@@ -1097,4 +1097,6 @@
1097 1097
1098#define A_TP_TX_SCHED_PCMD 0x25 1098#define A_TP_TX_SCHED_PCMD 0x25
1099 1099
1100#define S_PORT 1
1101
1100#endif /* __T4_REGS_H */ 1102#endif /* __T4_REGS_H */
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h b/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
index e98b6fff2c96..a0dcccd846c9 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4fw_api.h
@@ -35,8 +35,43 @@
35#ifndef _T4FW_INTERFACE_H_ 35#ifndef _T4FW_INTERFACE_H_
36#define _T4FW_INTERFACE_H_ 36#define _T4FW_INTERFACE_H_
37 37
38enum fw_ret_val { 38enum fw_retval {
39 FW_ENOEXEC = 8, /* Exec format error; inv microcode */ 39 FW_SUCCESS = 0, /* completed sucessfully */
40 FW_EPERM = 1, /* operation not permitted */
41 FW_ENOENT = 2, /* no such file or directory */
42 FW_EIO = 5, /* input/output error; hw bad */
43 FW_ENOEXEC = 8, /* exec format error; inv microcode */
44 FW_EAGAIN = 11, /* try again */
45 FW_ENOMEM = 12, /* out of memory */
46 FW_EFAULT = 14, /* bad address; fw bad */
47 FW_EBUSY = 16, /* resource busy */
48 FW_EEXIST = 17, /* file exists */
49 FW_EINVAL = 22, /* invalid argument */
50 FW_ENOSPC = 28, /* no space left on device */
51 FW_ENOSYS = 38, /* functionality not implemented */
52 FW_EPROTO = 71, /* protocol error */
53 FW_EADDRINUSE = 98, /* address already in use */
54 FW_EADDRNOTAVAIL = 99, /* cannot assigned requested address */
55 FW_ENETDOWN = 100, /* network is down */
56 FW_ENETUNREACH = 101, /* network is unreachable */
57 FW_ENOBUFS = 105, /* no buffer space available */
58 FW_ETIMEDOUT = 110, /* timeout */
59 FW_EINPROGRESS = 115, /* fw internal */
60 FW_SCSI_ABORT_REQUESTED = 128, /* */
61 FW_SCSI_ABORT_TIMEDOUT = 129, /* */
62 FW_SCSI_ABORTED = 130, /* */
63 FW_SCSI_CLOSE_REQUESTED = 131, /* */
64 FW_ERR_LINK_DOWN = 132, /* */
65 FW_RDEV_NOT_READY = 133, /* */
66 FW_ERR_RDEV_LOST = 134, /* */
67 FW_ERR_RDEV_LOGO = 135, /* */
68 FW_FCOE_NO_XCHG = 136, /* */
69 FW_SCSI_RSP_ERR = 137, /* */
70 FW_ERR_RDEV_IMPL_LOGO = 138, /* */
71 FW_SCSI_UNDER_FLOW_ERR = 139, /* */
72 FW_SCSI_OVER_FLOW_ERR = 140, /* */
73 FW_SCSI_DDP_ERR = 141, /* DDP error*/
74 FW_SCSI_TASK_ERR = 142, /* No SCSI tasks available */
40}; 75};
41 76
42#define FW_T4VF_SGE_BASE_ADDR 0x0000 77#define FW_T4VF_SGE_BASE_ADDR 0x0000
@@ -50,6 +85,7 @@ enum fw_wr_opcodes {
50 FW_ULPTX_WR = 0x04, 85 FW_ULPTX_WR = 0x04,
51 FW_TP_WR = 0x05, 86 FW_TP_WR = 0x05,
52 FW_ETH_TX_PKT_WR = 0x08, 87 FW_ETH_TX_PKT_WR = 0x08,
88 FW_OFLD_CONNECTION_WR = 0x2f,
53 FW_FLOWC_WR = 0x0a, 89 FW_FLOWC_WR = 0x0a,
54 FW_OFLD_TX_DATA_WR = 0x0b, 90 FW_OFLD_TX_DATA_WR = 0x0b,
55 FW_CMD_WR = 0x10, 91 FW_CMD_WR = 0x10,
@@ -85,6 +121,7 @@ struct fw_wr_hdr {
85#define FW_WR_LEN16(x) ((x) << 0) 121#define FW_WR_LEN16(x) ((x) << 0)
86 122
87#define HW_TPL_FR_MT_PR_IV_P_FC 0X32B 123#define HW_TPL_FR_MT_PR_IV_P_FC 0X32B
124#define HW_TPL_FR_MT_PR_OV_P_FC 0X327
88 125
89/* filter wr reply code in cookie in CPL_SET_TCB_RPL */ 126/* filter wr reply code in cookie in CPL_SET_TCB_RPL */
90enum fw_filter_wr_cookie { 127enum fw_filter_wr_cookie {
@@ -379,6 +416,108 @@ struct fw_eth_tx_pkt_wr {
379 __be64 r3; 416 __be64 r3;
380}; 417};
381 418
419struct fw_ofld_connection_wr {
420 __be32 op_compl;
421 __be32 len16_pkd;
422 __u64 cookie;
423 __be64 r2;
424 __be64 r3;
425 struct fw_ofld_connection_le {
426 __be32 version_cpl;
427 __be32 filter;
428 __be32 r1;
429 __be16 lport;
430 __be16 pport;
431 union fw_ofld_connection_leip {
432 struct fw_ofld_connection_le_ipv4 {
433 __be32 pip;
434 __be32 lip;
435 __be64 r0;
436 __be64 r1;
437 __be64 r2;
438 } ipv4;
439 struct fw_ofld_connection_le_ipv6 {
440 __be64 pip_hi;
441 __be64 pip_lo;
442 __be64 lip_hi;
443 __be64 lip_lo;
444 } ipv6;
445 } u;
446 } le;
447 struct fw_ofld_connection_tcb {
448 __be32 t_state_to_astid;
449 __be16 cplrxdataack_cplpassacceptrpl;
450 __be16 rcv_adv;
451 __be32 rcv_nxt;
452 __be32 tx_max;
453 __be64 opt0;
454 __be32 opt2;
455 __be32 r1;
456 __be64 r2;
457 __be64 r3;
458 } tcb;
459};
460
461#define S_FW_OFLD_CONNECTION_WR_VERSION 31
462#define M_FW_OFLD_CONNECTION_WR_VERSION 0x1
463#define V_FW_OFLD_CONNECTION_WR_VERSION(x) \
464 ((x) << S_FW_OFLD_CONNECTION_WR_VERSION)
465#define G_FW_OFLD_CONNECTION_WR_VERSION(x) \
466 (((x) >> S_FW_OFLD_CONNECTION_WR_VERSION) & \
467 M_FW_OFLD_CONNECTION_WR_VERSION)
468#define F_FW_OFLD_CONNECTION_WR_VERSION \
469 V_FW_OFLD_CONNECTION_WR_VERSION(1U)
470
471#define S_FW_OFLD_CONNECTION_WR_CPL 30
472#define M_FW_OFLD_CONNECTION_WR_CPL 0x1
473#define V_FW_OFLD_CONNECTION_WR_CPL(x) ((x) << S_FW_OFLD_CONNECTION_WR_CPL)
474#define G_FW_OFLD_CONNECTION_WR_CPL(x) \
475 (((x) >> S_FW_OFLD_CONNECTION_WR_CPL) & M_FW_OFLD_CONNECTION_WR_CPL)
476#define F_FW_OFLD_CONNECTION_WR_CPL V_FW_OFLD_CONNECTION_WR_CPL(1U)
477
478#define S_FW_OFLD_CONNECTION_WR_T_STATE 28
479#define M_FW_OFLD_CONNECTION_WR_T_STATE 0xf
480#define V_FW_OFLD_CONNECTION_WR_T_STATE(x) \
481 ((x) << S_FW_OFLD_CONNECTION_WR_T_STATE)
482#define G_FW_OFLD_CONNECTION_WR_T_STATE(x) \
483 (((x) >> S_FW_OFLD_CONNECTION_WR_T_STATE) & \
484 M_FW_OFLD_CONNECTION_WR_T_STATE)
485
486#define S_FW_OFLD_CONNECTION_WR_RCV_SCALE 24
487#define M_FW_OFLD_CONNECTION_WR_RCV_SCALE 0xf
488#define V_FW_OFLD_CONNECTION_WR_RCV_SCALE(x) \
489 ((x) << S_FW_OFLD_CONNECTION_WR_RCV_SCALE)
490#define G_FW_OFLD_CONNECTION_WR_RCV_SCALE(x) \
491 (((x) >> S_FW_OFLD_CONNECTION_WR_RCV_SCALE) & \
492 M_FW_OFLD_CONNECTION_WR_RCV_SCALE)
493
494#define S_FW_OFLD_CONNECTION_WR_ASTID 0
495#define M_FW_OFLD_CONNECTION_WR_ASTID 0xffffff
496#define V_FW_OFLD_CONNECTION_WR_ASTID(x) \
497 ((x) << S_FW_OFLD_CONNECTION_WR_ASTID)
498#define G_FW_OFLD_CONNECTION_WR_ASTID(x) \
499 (((x) >> S_FW_OFLD_CONNECTION_WR_ASTID) & M_FW_OFLD_CONNECTION_WR_ASTID)
500
501#define S_FW_OFLD_CONNECTION_WR_CPLRXDATAACK 15
502#define M_FW_OFLD_CONNECTION_WR_CPLRXDATAACK 0x1
503#define V_FW_OFLD_CONNECTION_WR_CPLRXDATAACK(x) \
504 ((x) << S_FW_OFLD_CONNECTION_WR_CPLRXDATAACK)
505#define G_FW_OFLD_CONNECTION_WR_CPLRXDATAACK(x) \
506 (((x) >> S_FW_OFLD_CONNECTION_WR_CPLRXDATAACK) & \
507 M_FW_OFLD_CONNECTION_WR_CPLRXDATAACK)
508#define F_FW_OFLD_CONNECTION_WR_CPLRXDATAACK \
509 V_FW_OFLD_CONNECTION_WR_CPLRXDATAACK(1U)
510
511#define S_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL 14
512#define M_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL 0x1
513#define V_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL(x) \
514 ((x) << S_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL)
515#define G_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL(x) \
516 (((x) >> S_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL) & \
517 M_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL)
518#define F_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL \
519 V_FW_OFLD_CONNECTION_WR_CPLPASSACCEPTRPL(1U)
520
382enum fw_flowc_mnem { 521enum fw_flowc_mnem {
383 FW_FLOWC_MNEM_PFNVFN, /* PFN [15:8] VFN [7:0] */ 522 FW_FLOWC_MNEM_PFNVFN, /* PFN [15:8] VFN [7:0] */
384 FW_FLOWC_MNEM_CH, 523 FW_FLOWC_MNEM_CH,