aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddie Wai <eddie.wai@broadcom.com>2013-07-28 22:03:58 -0400
committerDavid S. Miller <davem@davemloft.net>2013-07-30 01:03:07 -0400
commitb3bd2d65e6faf4f6fe6f87d6a5163859af391109 (patch)
tree8db302a6037003679c6b61b236eae929c5f6fb6c
parent6cdcdbba600c0537f5c61a9ffa45e708950c1aa6 (diff)
cnic: Update TCP options setup for iSCSI.
Update TCP delayed ACK and timestamp options setup to match latest bnx2x firmware. Signed-off-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/cnic.c53
-rw-r--r--drivers/net/ethernet/broadcom/cnic_defs.h4
-rw-r--r--drivers/scsi/bnx2i/57xx_iscsi_hsi.h12
3 files changed, 37 insertions, 32 deletions
diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c
index 1a2e5ff003c3..24f2a0970a64 100644
--- a/drivers/net/ethernet/broadcom/cnic.c
+++ b/drivers/net/ethernet/broadcom/cnic.c
@@ -1427,6 +1427,28 @@ static void cnic_reply_bnx2x_kcqes(struct cnic_dev *dev, int ulp_type,
1427 rcu_read_unlock(); 1427 rcu_read_unlock();
1428} 1428}
1429 1429
1430static void cnic_bnx2x_set_tcp_options(struct cnic_dev *dev, int time_stamps,
1431 int en_tcp_dack)
1432{
1433 struct cnic_local *cp = dev->cnic_priv;
1434 struct bnx2x *bp = netdev_priv(dev->netdev);
1435 u8 xstorm_flags = XSTORM_L5CM_TCP_FLAGS_WND_SCL_EN;
1436 u16 tstorm_flags = 0;
1437
1438 if (time_stamps) {
1439 xstorm_flags |= XSTORM_L5CM_TCP_FLAGS_TS_ENABLED;
1440 tstorm_flags |= TSTORM_L5CM_TCP_FLAGS_TS_ENABLED;
1441 }
1442 if (en_tcp_dack)
1443 tstorm_flags |= TSTORM_L5CM_TCP_FLAGS_DELAYED_ACK_EN;
1444
1445 CNIC_WR8(dev, BAR_XSTRORM_INTMEM +
1446 XSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(cp->pfid), xstorm_flags);
1447
1448 CNIC_WR16(dev, BAR_TSTRORM_INTMEM +
1449 TSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(cp->pfid), tstorm_flags);
1450}
1451
1430static int cnic_bnx2x_iscsi_init1(struct cnic_dev *dev, struct kwqe *kwqe) 1452static int cnic_bnx2x_iscsi_init1(struct cnic_dev *dev, struct kwqe *kwqe)
1431{ 1453{
1432 struct cnic_local *cp = dev->cnic_priv; 1454 struct cnic_local *cp = dev->cnic_priv;
@@ -1506,6 +1528,10 @@ static int cnic_bnx2x_iscsi_init1(struct cnic_dev *dev, struct kwqe *kwqe)
1506 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + CSTORM_ISCSI_HQ_SIZE_OFFSET(pfid), 1528 CNIC_WR16(dev, BAR_CSTRORM_INTMEM + CSTORM_ISCSI_HQ_SIZE_OFFSET(pfid),
1507 hq_bds); 1529 hq_bds);
1508 1530
1531 cnic_bnx2x_set_tcp_options(dev,
1532 req1->flags & ISCSI_KWQE_INIT1_TIME_STAMPS_ENABLE,
1533 req1->flags & ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE);
1534
1509 return 0; 1535 return 0;
1510} 1536}
1511 1537
@@ -2035,9 +2061,6 @@ static void cnic_init_storm_conn_bufs(struct cnic_dev *dev,
2035 xstorm_buf->pseudo_header_checksum = 2061 xstorm_buf->pseudo_header_checksum =
2036 swab16(~csum_ipv6_magic(&src_ip, &dst_ip, 0, IPPROTO_TCP, 0)); 2062 swab16(~csum_ipv6_magic(&src_ip, &dst_ip, 0, IPPROTO_TCP, 0));
2037 2063
2038 if (!(kwqe1->tcp_flags & L4_KWQ_CONNECT_REQ1_NO_DELAY_ACK))
2039 tstorm_buf->params |=
2040 L5CM_TSTORM_CONN_BUFFER_DELAYED_ACK_ENABLE;
2041 if (kwqe3->ka_timeout) { 2064 if (kwqe3->ka_timeout) {
2042 tstorm_buf->ka_enable = 1; 2065 tstorm_buf->ka_enable = 1;
2043 tstorm_buf->ka_timeout = kwqe3->ka_timeout; 2066 tstorm_buf->ka_timeout = kwqe3->ka_timeout;
@@ -2084,25 +2107,6 @@ static void cnic_init_bnx2x_mac(struct cnic_dev *dev)
2084 mac[0]); 2107 mac[0]);
2085} 2108}
2086 2109
2087static void cnic_bnx2x_set_tcp_timestamp(struct cnic_dev *dev, int tcp_ts)
2088{
2089 struct cnic_local *cp = dev->cnic_priv;
2090 struct bnx2x *bp = netdev_priv(dev->netdev);
2091 u8 xstorm_flags = XSTORM_L5CM_TCP_FLAGS_WND_SCL_EN;
2092 u16 tstorm_flags = 0;
2093
2094 if (tcp_ts) {
2095 xstorm_flags |= XSTORM_L5CM_TCP_FLAGS_TS_ENABLED;
2096 tstorm_flags |= TSTORM_L5CM_TCP_FLAGS_TS_ENABLED;
2097 }
2098
2099 CNIC_WR8(dev, BAR_XSTRORM_INTMEM +
2100 XSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(cp->pfid), xstorm_flags);
2101
2102 CNIC_WR16(dev, BAR_TSTRORM_INTMEM +
2103 TSTORM_ISCSI_TCP_VARS_FLAGS_OFFSET(cp->pfid), tstorm_flags);
2104}
2105
2106static int cnic_bnx2x_connect(struct cnic_dev *dev, struct kwqe *wqes[], 2110static int cnic_bnx2x_connect(struct cnic_dev *dev, struct kwqe *wqes[],
2107 u32 num, int *work) 2111 u32 num, int *work)
2108{ 2112{
@@ -2178,9 +2182,6 @@ static int cnic_bnx2x_connect(struct cnic_dev *dev, struct kwqe *wqes[],
2178 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + 2182 CNIC_WR16(dev, BAR_XSTRORM_INTMEM +
2179 XSTORM_ISCSI_LOCAL_VLAN_OFFSET(cp->pfid), csk->vlan_id); 2183 XSTORM_ISCSI_LOCAL_VLAN_OFFSET(cp->pfid), csk->vlan_id);
2180 2184
2181 cnic_bnx2x_set_tcp_timestamp(dev,
2182 kwqe1->tcp_flags & L4_KWQ_CONNECT_REQ1_TIME_STAMP);
2183
2184 ret = cnic_submit_kwqe_16(dev, L5CM_RAMROD_CMD_ID_TCP_CONNECT, 2185 ret = cnic_submit_kwqe_16(dev, L5CM_RAMROD_CMD_ID_TCP_CONNECT,
2185 kwqe1->cid, ISCSI_CONNECTION_TYPE, &l5_data); 2186 kwqe1->cid, ISCSI_CONNECTION_TYPE, &l5_data);
2186 if (!ret) 2187 if (!ret)
@@ -4220,7 +4221,7 @@ static int cnic_cm_init_bnx2x_hw(struct cnic_dev *dev)
4220 u32 port = CNIC_PORT(cp); 4221 u32 port = CNIC_PORT(cp);
4221 4222
4222 cnic_init_bnx2x_mac(dev); 4223 cnic_init_bnx2x_mac(dev);
4223 cnic_bnx2x_set_tcp_timestamp(dev, 1); 4224 cnic_bnx2x_set_tcp_options(dev, 0, 1);
4224 4225
4225 CNIC_WR16(dev, BAR_XSTRORM_INTMEM + 4226 CNIC_WR16(dev, BAR_XSTRORM_INTMEM +
4226 XSTORM_ISCSI_LOCAL_VLAN_OFFSET(pfid), 0); 4227 XSTORM_ISCSI_LOCAL_VLAN_OFFSET(pfid), 0);
diff --git a/drivers/net/ethernet/broadcom/cnic_defs.h b/drivers/net/ethernet/broadcom/cnic_defs.h
index ede3db35d757..e53f09de5db3 100644
--- a/drivers/net/ethernet/broadcom/cnic_defs.h
+++ b/drivers/net/ethernet/broadcom/cnic_defs.h
@@ -5400,8 +5400,8 @@ struct tstorm_l5cm_tcp_flags {
5400 u16 flags; 5400 u16 flags;
5401#define TSTORM_L5CM_TCP_FLAGS_VLAN_ID (0xFFF<<0) 5401#define TSTORM_L5CM_TCP_FLAGS_VLAN_ID (0xFFF<<0)
5402#define TSTORM_L5CM_TCP_FLAGS_VLAN_ID_SHIFT 0 5402#define TSTORM_L5CM_TCP_FLAGS_VLAN_ID_SHIFT 0
5403#define TSTORM_L5CM_TCP_FLAGS_RSRV0 (0x1<<12) 5403#define TSTORM_L5CM_TCP_FLAGS_DELAYED_ACK_EN (0x1<<12)
5404#define TSTORM_L5CM_TCP_FLAGS_RSRV0_SHIFT 12 5404#define TSTORM_L5CM_TCP_FLAGS_DELAYED_ACK_SHIFT 12
5405#define TSTORM_L5CM_TCP_FLAGS_TS_ENABLED (0x1<<13) 5405#define TSTORM_L5CM_TCP_FLAGS_TS_ENABLED (0x1<<13)
5406#define TSTORM_L5CM_TCP_FLAGS_TS_ENABLED_SHIFT 13 5406#define TSTORM_L5CM_TCP_FLAGS_TS_ENABLED_SHIFT 13
5407#define TSTORM_L5CM_TCP_FLAGS_RSRV1 (0x3<<14) 5407#define TSTORM_L5CM_TCP_FLAGS_RSRV1 (0x3<<14)
diff --git a/drivers/scsi/bnx2i/57xx_iscsi_hsi.h b/drivers/scsi/bnx2i/57xx_iscsi_hsi.h
index f2db5fe7bdc2..62f00da09ad1 100644
--- a/drivers/scsi/bnx2i/57xx_iscsi_hsi.h
+++ b/drivers/scsi/bnx2i/57xx_iscsi_hsi.h
@@ -581,8 +581,10 @@ struct iscsi_kwqe_init1 {
581#define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE_SHIFT 4 581#define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE_SHIFT 4
582#define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE (0x1<<5) 582#define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE (0x1<<5)
583#define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE_SHIFT 5 583#define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE_SHIFT 5
584#define ISCSI_KWQE_INIT1_RESERVED1 (0x3<<6) 584#define ISCSI_KWQE_INIT1_TIME_STAMPS_ENABLE (0x1<<6)
585#define ISCSI_KWQE_INIT1_RESERVED1_SHIFT 6 585#define ISCSI_KWQE_INIT1_TIME_STAMPS_ENABLE_SHIFT 6
586#define ISCSI_KWQE_INIT1_RESERVED1 (0x1<<7)
587#define ISCSI_KWQE_INIT1_RESERVED1_SHIFT 7
586 u16 cq_num_wqes; 588 u16 cq_num_wqes;
587#elif defined(__LITTLE_ENDIAN) 589#elif defined(__LITTLE_ENDIAN)
588 u16 cq_num_wqes; 590 u16 cq_num_wqes;
@@ -593,8 +595,10 @@ struct iscsi_kwqe_init1 {
593#define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE_SHIFT 4 595#define ISCSI_KWQE_INIT1_DELAYED_ACK_ENABLE_SHIFT 4
594#define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE (0x1<<5) 596#define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE (0x1<<5)
595#define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE_SHIFT 5 597#define ISCSI_KWQE_INIT1_KEEP_ALIVE_ENABLE_SHIFT 5
596#define ISCSI_KWQE_INIT1_RESERVED1 (0x3<<6) 598#define ISCSI_KWQE_INIT1_TIME_STAMPS_ENABLE (0x1<<6)
597#define ISCSI_KWQE_INIT1_RESERVED1_SHIFT 6 599#define ISCSI_KWQE_INIT1_TIME_STAMPS_ENABLE_SHIFT 6
600#define ISCSI_KWQE_INIT1_RESERVED1 (0x1<<7)
601#define ISCSI_KWQE_INIT1_RESERVED1_SHIFT 7
598 u8 cq_log_wqes_per_page; 602 u8 cq_log_wqes_per_page;
599#endif 603#endif
600#if defined(__BIG_ENDIAN) 604#if defined(__BIG_ENDIAN)