diff options
author | Shahed Shaikh <shahed.shaikh@qlogic.com> | 2013-02-18 07:06:16 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-19 00:47:01 -0500 |
commit | 99e8587900a3d32b1eaa3a92da90b49e9d4ff765 (patch) | |
tree | 299bad8dae01ef115cf5e6a9dd3f08d65f1ca449 | |
parent | ac166700991c8f2760e4d3656b4783986cfbf545 (diff) |
qlcnic: fix estimation of receive MSS in case of LRO for 83xx adapter
Set gso_size to MSS obtained from adapter to avoid incorrect estimation
of receive MSS, which would lead to delayed ACKs in some traffic patterns
Example:
Send two or three packets and wait for ack and only then send
remaining packets.
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | 13 | ||||
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | 24 |
3 files changed, 29 insertions, 9 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h index 127fa273e421..61f81f6c84a9 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.h | |||
@@ -223,6 +223,7 @@ struct qlc_83xx_idc { | |||
223 | #define QLC_83XX_GET_LSO_CAPABILITY(val) (val & 0x40) | 223 | #define QLC_83XX_GET_LSO_CAPABILITY(val) (val & 0x40) |
224 | #define QLC_83XX_GET_HW_LRO_CAPABILITY(val) (val & 0x400) | 224 | #define QLC_83XX_GET_HW_LRO_CAPABILITY(val) (val & 0x400) |
225 | #define QLC_83XX_GET_VLAN_ALIGN_CAPABILITY(val) (val & 0x4000) | 225 | #define QLC_83XX_GET_VLAN_ALIGN_CAPABILITY(val) (val & 0x4000) |
226 | #define QLC_83XX_GET_FW_LRO_MSS_CAPABILITY(val) (val & 0x20000) | ||
226 | #define QLC_83XX_VIRTUAL_NIC_MODE 0xFF | 227 | #define QLC_83XX_VIRTUAL_NIC_MODE 0xFF |
227 | #define QLC_83XX_DEFAULT_MODE 0x0 | 228 | #define QLC_83XX_DEFAULT_MODE 0x0 |
228 | #define QLCNIC_BRDTYPE_83XX_10G 0x0083 | 229 | #define QLCNIC_BRDTYPE_83XX_10G 0x0083 |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c index 662292de1486..2990f45df787 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c | |||
@@ -88,6 +88,8 @@ | |||
88 | #define qlcnic_get_lro_sts_mss(sts_data1) \ | 88 | #define qlcnic_get_lro_sts_mss(sts_data1) \ |
89 | ((sts_data1 >> 32) & 0x0FFFF) | 89 | ((sts_data1 >> 32) & 0x0FFFF) |
90 | 90 | ||
91 | #define qlcnic_83xx_get_lro_sts_mss(sts) ((sts) & 0xffff) | ||
92 | |||
91 | /* opcode field in status_desc */ | 93 | /* opcode field in status_desc */ |
92 | #define QLCNIC_SYN_OFFLOAD 0x03 | 94 | #define QLCNIC_SYN_OFFLOAD 0x03 |
93 | #define QLCNIC_RXPKT_DESC 0x04 | 95 | #define QLCNIC_RXPKT_DESC 0x04 |
@@ -1423,7 +1425,7 @@ qlcnic_83xx_process_lro(struct qlcnic_adapter *adapter, | |||
1423 | bool push; | 1425 | bool push; |
1424 | int l2_hdr_offset, l4_hdr_offset; | 1426 | int l2_hdr_offset, l4_hdr_offset; |
1425 | int index; | 1427 | int index; |
1426 | u16 lro_length, length, data_offset; | 1428 | u16 lro_length, length, data_offset, gso_size; |
1427 | u16 vid = 0xffff; | 1429 | u16 vid = 0xffff; |
1428 | 1430 | ||
1429 | if (unlikely(ring > adapter->max_rds_rings)) | 1431 | if (unlikely(ring > adapter->max_rds_rings)) |
@@ -1478,6 +1480,15 @@ qlcnic_83xx_process_lro(struct qlcnic_adapter *adapter, | |||
1478 | th->psh = push; | 1480 | th->psh = push; |
1479 | length = skb->len; | 1481 | length = skb->len; |
1480 | 1482 | ||
1483 | if (adapter->flags & QLCNIC_FW_LRO_MSS_CAP) { | ||
1484 | gso_size = qlcnic_83xx_get_lro_sts_mss(sts_data[0]); | ||
1485 | skb_shinfo(skb)->gso_size = gso_size; | ||
1486 | if (skb->protocol == htons(ETH_P_IPV6)) | ||
1487 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; | ||
1488 | else | ||
1489 | skb_shinfo(skb)->gso_type = SKB_GSO_TCPV4; | ||
1490 | } | ||
1491 | |||
1481 | if (vid != 0xffff) | 1492 | if (vid != 0xffff) |
1482 | __vlan_hwaccel_put_tag(skb, vid); | 1493 | __vlan_hwaccel_put_tag(skb, vid); |
1483 | 1494 | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 3a0f18215d62..e03017a999b4 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -1339,11 +1339,24 @@ qlcnic_free_irq(struct qlcnic_adapter *adapter) | |||
1339 | } | 1339 | } |
1340 | } | 1340 | } |
1341 | 1341 | ||
1342 | static void qlcnic_get_lro_mss_capability(struct qlcnic_adapter *adapter) | ||
1343 | { | ||
1344 | u32 capab = 0; | ||
1345 | |||
1346 | if (qlcnic_82xx_check(adapter)) { | ||
1347 | if (adapter->ahw->capabilities2 & | ||
1348 | QLCNIC_FW_CAPABILITY_2_LRO_MAX_TCP_SEG) | ||
1349 | adapter->flags |= QLCNIC_FW_LRO_MSS_CAP; | ||
1350 | } else { | ||
1351 | capab = adapter->ahw->capabilities; | ||
1352 | if (QLC_83XX_GET_FW_LRO_MSS_CAPABILITY(capab)) | ||
1353 | adapter->flags |= QLCNIC_FW_LRO_MSS_CAP; | ||
1354 | } | ||
1355 | } | ||
1356 | |||
1342 | int __qlcnic_up(struct qlcnic_adapter *adapter, struct net_device *netdev) | 1357 | int __qlcnic_up(struct qlcnic_adapter *adapter, struct net_device *netdev) |
1343 | { | 1358 | { |
1344 | int ring; | 1359 | int ring; |
1345 | u32 capab2; | ||
1346 | |||
1347 | struct qlcnic_host_rds_ring *rds_ring; | 1360 | struct qlcnic_host_rds_ring *rds_ring; |
1348 | 1361 | ||
1349 | if (adapter->is_up != QLCNIC_ADAPTER_UP_MAGIC) | 1362 | if (adapter->is_up != QLCNIC_ADAPTER_UP_MAGIC) |
@@ -1353,12 +1366,7 @@ int __qlcnic_up(struct qlcnic_adapter *adapter, struct net_device *netdev) | |||
1353 | return 0; | 1366 | return 0; |
1354 | if (qlcnic_set_eswitch_port_config(adapter)) | 1367 | if (qlcnic_set_eswitch_port_config(adapter)) |
1355 | return -EIO; | 1368 | return -EIO; |
1356 | 1369 | qlcnic_get_lro_mss_capability(adapter); | |
1357 | if (adapter->ahw->capabilities & QLCNIC_FW_CAPABILITY_MORE_CAPS) { | ||
1358 | capab2 = QLCRD32(adapter, CRB_FW_CAPABILITIES_2); | ||
1359 | if (capab2 & QLCNIC_FW_CAPABILITY_2_LRO_MAX_TCP_SEG) | ||
1360 | adapter->flags |= QLCNIC_FW_LRO_MSS_CAP; | ||
1361 | } | ||
1362 | 1370 | ||
1363 | if (qlcnic_fw_create_ctx(adapter)) | 1371 | if (qlcnic_fw_create_ctx(adapter)) |
1364 | return -EIO; | 1372 | return -EIO; |