aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/cxgbi/cxgb3i
diff options
context:
space:
mode:
authorKaren Xie <kxie@chelsio.com>2015-04-10 16:57:12 -0400
committerJames Bottomley <JBottomley@Odin.com>2015-05-25 11:46:24 -0400
commit81daf10c76770ef9fbb59f4d024f67517edf21d3 (patch)
tree3268a415562369642fe5bfedbfe223edf1759e5b /drivers/scsi/cxgbi/cxgb3i
parentdee0586e15d5d5796dd76bdc0ecfb7df7c5ee1c8 (diff)
cxgbi: use per-connection link-speed dependent send/recv windows
For adapters supporting both 10G and 40G use per-connection send/recv window and calculate the size based on the link speed. Signed-off-by: Karen Xie <kxie@chelsio.com> Reviewed-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <JBottomley@Odin.com>
Diffstat (limited to 'drivers/scsi/cxgbi/cxgb3i')
-rw-r--r--drivers/scsi/cxgbi/cxgb3i/cxgb3i.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
index 3db4c63978c5..0ae71562a491 100644
--- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
+++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
@@ -156,7 +156,7 @@ static int push_tx_frames(struct cxgbi_sock *csk, int req_completion);
156static void send_act_open_req(struct cxgbi_sock *csk, struct sk_buff *skb, 156static void send_act_open_req(struct cxgbi_sock *csk, struct sk_buff *skb,
157 const struct l2t_entry *e) 157 const struct l2t_entry *e)
158{ 158{
159 unsigned int wscale = cxgbi_sock_compute_wscale(cxgb3i_rcv_win); 159 unsigned int wscale = cxgbi_sock_compute_wscale(csk->rcv_win);
160 struct cpl_act_open_req *req = (struct cpl_act_open_req *)skb->head; 160 struct cpl_act_open_req *req = (struct cpl_act_open_req *)skb->head;
161 161
162 skb->priority = CPL_PRIORITY_SETUP; 162 skb->priority = CPL_PRIORITY_SETUP;
@@ -172,7 +172,7 @@ static void send_act_open_req(struct cxgbi_sock *csk, struct sk_buff *skb,
172 V_WND_SCALE(wscale) | V_MSS_IDX(csk->mss_idx) | 172 V_WND_SCALE(wscale) | V_MSS_IDX(csk->mss_idx) |
173 V_L2T_IDX(e->idx) | V_TX_CHANNEL(e->smt_idx)); 173 V_L2T_IDX(e->idx) | V_TX_CHANNEL(e->smt_idx));
174 req->opt0l = htonl(V_ULP_MODE(ULP2_MODE_ISCSI) | 174 req->opt0l = htonl(V_ULP_MODE(ULP2_MODE_ISCSI) |
175 V_RCV_BUFSIZ(cxgb3i_rcv_win>>10)); 175 V_RCV_BUFSIZ(csk->rcv_win >> 10));
176 176
177 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK, 177 log_debug(1 << CXGBI_DBG_TOE | 1 << CXGBI_DBG_SOCK,
178 "csk 0x%p,%u,0x%lx,%u, %pI4:%u-%pI4:%u, %u,%u,%u.\n", 178 "csk 0x%p,%u,0x%lx,%u, %pI4:%u-%pI4:%u, %u,%u,%u.\n",
@@ -369,7 +369,7 @@ static inline void make_tx_data_wr(struct cxgbi_sock *csk, struct sk_buff *skb,
369 req->flags |= htonl(V_TX_ACK_PAGES(2) | F_TX_INIT | 369 req->flags |= htonl(V_TX_ACK_PAGES(2) | F_TX_INIT |
370 V_TX_CPU_IDX(csk->rss_qid)); 370 V_TX_CPU_IDX(csk->rss_qid));
371 /* sendbuffer is in units of 32KB. */ 371 /* sendbuffer is in units of 32KB. */
372 req->param |= htonl(V_TX_SNDBUF(cxgb3i_snd_win >> 15)); 372 req->param |= htonl(V_TX_SNDBUF(csk->snd_win >> 15));
373 cxgbi_sock_set_flag(csk, CTPF_TX_DATA_SENT); 373 cxgbi_sock_set_flag(csk, CTPF_TX_DATA_SENT);
374 } 374 }
375} 375}
@@ -503,8 +503,8 @@ static int do_act_establish(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
503 csk, csk->state, csk->flags, csk->tid); 503 csk, csk->state, csk->flags, csk->tid);
504 504
505 csk->copied_seq = csk->rcv_wup = csk->rcv_nxt = rcv_isn; 505 csk->copied_seq = csk->rcv_wup = csk->rcv_nxt = rcv_isn;
506 if (cxgb3i_rcv_win > (M_RCV_BUFSIZ << 10)) 506 if (csk->rcv_win > (M_RCV_BUFSIZ << 10))
507 csk->rcv_wup -= cxgb3i_rcv_win - (M_RCV_BUFSIZ << 10); 507 csk->rcv_wup -= csk->rcv_win - (M_RCV_BUFSIZ << 10);
508 508
509 cxgbi_sock_established(csk, ntohl(req->snd_isn), ntohs(req->tcp_opt)); 509 cxgbi_sock_established(csk, ntohl(req->snd_isn), ntohs(req->tcp_opt));
510 510
@@ -988,6 +988,8 @@ static int init_act_open(struct cxgbi_sock *csk)
988 goto rel_resource; 988 goto rel_resource;
989 skb->sk = (struct sock *)csk; 989 skb->sk = (struct sock *)csk;
990 set_arp_failure_handler(skb, act_open_arp_failure); 990 set_arp_failure_handler(skb, act_open_arp_failure);
991 csk->snd_win = cxgb3i_snd_win;
992 csk->rcv_win = cxgb3i_rcv_win;
991 993
992 csk->wr_max_cred = csk->wr_cred = T3C_DATA(t3dev)->max_wrs - 1; 994 csk->wr_max_cred = csk->wr_cred = T3C_DATA(t3dev)->max_wrs - 1;
993 csk->wr_una_cred = 0; 995 csk->wr_una_cred = 0;
@@ -1320,8 +1322,6 @@ static void cxgb3i_dev_open(struct t3cdev *t3dev)
1320 cdev->nports = adapter->params.nports; 1322 cdev->nports = adapter->params.nports;
1321 cdev->mtus = adapter->params.mtus; 1323 cdev->mtus = adapter->params.mtus;
1322 cdev->nmtus = NMTUS; 1324 cdev->nmtus = NMTUS;
1323 cdev->snd_win = cxgb3i_snd_win;
1324 cdev->rcv_win = cxgb3i_rcv_win;
1325 cdev->rx_credit_thres = cxgb3i_rx_credit_thres; 1325 cdev->rx_credit_thres = cxgb3i_rx_credit_thres;
1326 cdev->skb_tx_rsvd = CXGB3I_TX_HEADER_LEN; 1326 cdev->skb_tx_rsvd = CXGB3I_TX_HEADER_LEN;
1327 cdev->skb_rx_extra = sizeof(struct cpl_iscsi_hdr_norss); 1327 cdev->skb_rx_extra = sizeof(struct cpl_iscsi_hdr_norss);