[ewg] [PATCH] RDMA/nes: Fix for TSO low nic throughput - linux-next-pending

Tatyana Nikolova Tatyana.E.Nikolova at intel.com
Fri Sep 7 17:37:55 PDT 2012


Fix for TSO low nic throughput with linux-3.5
skb_is_gso() is changed to bool and returns 1 instead of MSS.
The gso_size from skb_shared_info is now used to pass MSS to hardware.

(the patch is linux-next-pending) 
 
Signed-off-by: Tatyana Nikolova <Tatyana.E.Nikolova at intel.com>
---
 drivers/infiniband/hw/nes/nes_nic.c |   28 +++++++++++++---------------
 1 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c
index 696b80e..5242294 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -388,18 +388,16 @@ static int nes_nic_send(struct sk_buff *skb, struct net_device *netdev)
 
 	if (skb->ip_summed == CHECKSUM_PARTIAL) {
 		tcph = tcp_hdr(skb);
-		if (1) {
-			if (skb_is_gso(skb)) {
-				/* nes_debug(NES_DBG_NIC_TX, "%s: TSO request... seg size = %u\n",
-						netdev->name, skb_is_gso(skb)); */
-				wqe_misc |= NES_NIC_SQ_WQE_LSO_ENABLE |
-						NES_NIC_SQ_WQE_COMPLETION | (u16)skb_is_gso(skb);
-				set_wqe_32bit_value(nic_sqe->wqe_words, NES_NIC_SQ_WQE_LSO_INFO_IDX,
-						((u32)tcph->doff) |
-						(((u32)(((unsigned char *)tcph) - skb->data)) << 4));
-			} else {
-				wqe_misc |= NES_NIC_SQ_WQE_COMPLETION;
-			}
+		if (skb_is_gso(skb)) {
+			nes_debug(NES_DBG_NIC_TX, "%s: TSO request... seg size = %u\n",
+					netdev->name, skb_shinfo(skb)->gso_size);
+			wqe_misc |= NES_NIC_SQ_WQE_LSO_ENABLE |
+					NES_NIC_SQ_WQE_COMPLETION | (u16)skb_shinfo(skb)->gso_size;
+			set_wqe_32bit_value(nic_sqe->wqe_words, NES_NIC_SQ_WQE_LSO_INFO_IDX,
+					((u32)tcph->doff) |
+					(((u32)(((unsigned char *)tcph) - skb->data)) << 4));
+		} else {
+			wqe_misc |= NES_NIC_SQ_WQE_COMPLETION;
 		}
 	} else {	/* CHECKSUM_HW */
 		wqe_misc |= NES_NIC_SQ_WQE_DISABLE_CHKSUM | NES_NIC_SQ_WQE_COMPLETION;
@@ -600,7 +598,7 @@ tso_sq_no_longer_full:
 							" (%u frags), tso_size=%u\n",
 							netdev->name,
 							skb->len, skb_headlen(skb),
-							skb_shinfo(skb)->nr_frags, skb_is_gso(skb));
+							skb_shinfo(skb)->nr_frags, skb_shinfo(skb)->gso_size);
 				}
 				memcpy(&nesnic->first_frag_vbase[nesnic->sq_head].buffer,
 						skb->data, min(((unsigned int)NES_FIRST_FRAG_SIZE),
@@ -652,8 +650,8 @@ tso_sq_no_longer_full:
 				} else {
 					nesnic->tx_skb[nesnic->sq_head] = NULL;
 				}
-				wqe_misc |= NES_NIC_SQ_WQE_COMPLETION | (u16)skb_is_gso(skb);
-				if ((tso_wqe_length + original_first_length) > skb_is_gso(skb)) {
+				wqe_misc |= NES_NIC_SQ_WQE_COMPLETION | (u16)skb_shinfo(skb)->gso_size;
+				if ((tso_wqe_length + original_first_length) > skb_shinfo(skb)->gso_size) {
 					wqe_misc |= NES_NIC_SQ_WQE_LSO_ENABLE;
 				} else {
 					iph->tot_len = htons(tso_wqe_length + original_first_length - nhoffset);
-- 
1.7.4.2




More information about the ewg mailing list