From: Vladimir Sokolovsky Date: Wed, 12 Sep 2012 11:33:27 +0000 (+0300) Subject: RDMA/nes: Add linux-next-pending patches X-Git-Tag: vofed-3.5-x~41 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=b289be60bc1e563867d86706670ac34ba9d741bd;p=~tnikolova%2Fcompat-rdma%2F.git RDMA/nes: Add linux-next-pending patches Signed-off-by: Vladimir Sokolovsky --- diff --git a/linux-next-pending/0001-RDMA-nes-Fix-for-loopback-MAC-address-Backport-chang.patch b/linux-next-pending/0001-RDMA-nes-Fix-for-loopback-MAC-address-Backport-chang.patch new file mode 100644 index 0000000..22ae56a --- /dev/null +++ b/linux-next-pending/0001-RDMA-nes-Fix-for-loopback-MAC-address-Backport-chang.patch @@ -0,0 +1,33 @@ +From 536c7cc5997776dc9e65d9ab8869d535505506a2 Mon Sep 17 00:00:00 2001 +From: Tatyana Nikolova +Date: Fri, 7 Sep 2012 19:41:29 -0500 +Subject: [PATCH 1/4] RDMA/nes: Fix for loopback MAC address - Backport change + +RDMA/nes: Fix for resolving correctly the MAC address for loopback connection +(the patch should be applied on top of previous backports) + +Signed-off-by: Tatyana Nikolova +--- + drivers/infiniband/hw/nes/nes_cm.c | 5 +---- + 1 file changed, 1 insertion(+), 4 deletions(-) + +diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c +index 0b5b1a9..d9fa245 100644 +--- a/drivers/infiniband/hw/nes/nes_cm.c ++++ b/drivers/infiniband/hw/nes/nes_cm.c +@@ -1363,11 +1363,8 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi + else + netdev = nesvnic->netdev; + +-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,1,0)) + neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, netdev); +-#else +- neigh = dst_neigh_lookup(&rt->dst, &dst_ip); +-#endif ++ + rcu_read_lock(); + if (neigh) { + if (neigh->nud_state & NUD_VALID) { +-- +1.7.9.5 + diff --git a/linux-next-pending/0002-RDMA-nes-Fix-for-TSO-low-nic-throughput-linux-next-p.patch b/linux-next-pending/0002-RDMA-nes-Fix-for-TSO-low-nic-throughput-linux-next-p.patch new file mode 100644 index 0000000..781c750 --- /dev/null +++ b/linux-next-pending/0002-RDMA-nes-Fix-for-TSO-low-nic-throughput-linux-next-p.patch @@ -0,0 +1,73 @@ +From a2eb1d38ce10c7ce8070194b21fabe36fdd40ffd Mon Sep 17 00:00:00 2001 +From: Tatyana Nikolova +Date: Fri, 7 Sep 2012 19:37:55 -0500 +Subject: [PATCH 2/4] RDMA/nes: Fix for TSO low nic throughput - + linux-next-pending + +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 +--- + drivers/infiniband/hw/nes/nes_nic.c | 28 +++++++++++++--------------- + 1 file 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.9.5 + diff --git a/linux-next-pending/0003-RDMA-nes-Loopback-clean-up-linux-next-pending.patch b/linux-next-pending/0003-RDMA-nes-Loopback-clean-up-linux-next-pending.patch new file mode 100644 index 0000000..a76a1b0 --- /dev/null +++ b/linux-next-pending/0003-RDMA-nes-Loopback-clean-up-linux-next-pending.patch @@ -0,0 +1,86 @@ +From 5061a057e8d166edd67d28d9531c0b1b4b8a8724 Mon Sep 17 00:00:00 2001 +From: Tatyana Nikolova +Date: Fri, 7 Sep 2012 19:34:28 -0500 +Subject: [PATCH 3/4] RDMA/nes: Loopback clean up - linux-next-pending + +Necessary clean up for the loopback code + +(the patch is linux-next-pending) + +Signed-off-by: Tatyana Nikolova +--- + drivers/infiniband/hw/nes/nes_cm.c | 30 ++++++------------------------ + 1 file changed, 6 insertions(+), 24 deletions(-) + +diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c +index d9fa245..8a2c301 100644 +--- a/drivers/infiniband/hw/nes/nes_cm.c ++++ b/drivers/infiniband/hw/nes/nes_cm.c +@@ -1472,12 +1472,8 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core, + cm_node->loopbackpartner = NULL; + + /* get the mac addr for the remote node */ +- if (ipv4_is_loopback(htonl(cm_node->rem_addr))) { +- arpindex = nes_arp_table(nesdev, ntohl(nesvnic->local_ipaddr), NULL, NES_ARP_RESOLVE); +- } else { +- oldarpindex = nes_arp_table(nesdev, cm_node->rem_addr, NULL, NES_ARP_RESOLVE); +- arpindex = nes_addr_resolve_neigh(nesvnic, cm_info->rem_addr, oldarpindex); +- } ++ oldarpindex = nes_arp_table(nesdev, cm_node->rem_addr, NULL, NES_ARP_RESOLVE); ++ arpindex = nes_addr_resolve_neigh(nesvnic, cm_info->rem_addr, oldarpindex); + if (arpindex < 0) { + kfree(cm_node); + return NULL; +@@ -3160,11 +3156,7 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) + nesqp->nesqp_context->tcpPorts[1] = + cpu_to_le16(ntohs(cm_id->remote_addr.sin_port)); + +- if (ipv4_is_loopback(cm_id->remote_addr.sin_addr.s_addr)) +- nesqp->nesqp_context->ip0 = +- cpu_to_le32(ntohl(nesvnic->local_ipaddr)); +- else +- nesqp->nesqp_context->ip0 = ++ nesqp->nesqp_context->ip0 = + cpu_to_le32(ntohl(cm_id->remote_addr.sin_addr.s_addr)); + + nesqp->nesqp_context->misc2 |= cpu_to_le32( +@@ -3189,10 +3181,7 @@ int nes_accept(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param) + memset(&nes_quad, 0, sizeof(nes_quad)); + nes_quad.DstIpAdrIndex = + cpu_to_le32((u32)PCI_FUNC(nesdev->pcidev->devfn) << 24); +- if (ipv4_is_loopback(cm_id->remote_addr.sin_addr.s_addr)) +- nes_quad.SrcIpadr = nesvnic->local_ipaddr; +- else +- nes_quad.SrcIpadr = cm_id->remote_addr.sin_addr.s_addr; ++ nes_quad.SrcIpadr = cm_id->remote_addr.sin_addr.s_addr; + nes_quad.TcpPorts[0] = cm_id->remote_addr.sin_port; + nes_quad.TcpPorts[1] = cm_id->local_addr.sin_port; + +@@ -3545,11 +3534,7 @@ static void cm_event_connected(struct nes_cm_event *event) + cpu_to_le16(ntohs(cm_id->local_addr.sin_port)); + nesqp->nesqp_context->tcpPorts[1] = + cpu_to_le16(ntohs(cm_id->remote_addr.sin_port)); +- if (ipv4_is_loopback(cm_id->remote_addr.sin_addr.s_addr)) +- nesqp->nesqp_context->ip0 = +- cpu_to_le32(ntohl(nesvnic->local_ipaddr)); +- else +- nesqp->nesqp_context->ip0 = ++ nesqp->nesqp_context->ip0 = + cpu_to_le32(ntohl(cm_id->remote_addr.sin_addr.s_addr)); + + nesqp->nesqp_context->misc2 |= cpu_to_le32( +@@ -3578,10 +3563,7 @@ static void cm_event_connected(struct nes_cm_event *event) + + nes_quad.DstIpAdrIndex = + cpu_to_le32((u32)PCI_FUNC(nesdev->pcidev->devfn) << 24); +- if (ipv4_is_loopback(cm_id->remote_addr.sin_addr.s_addr)) +- nes_quad.SrcIpadr = nesvnic->local_ipaddr; +- else +- nes_quad.SrcIpadr = cm_id->remote_addr.sin_addr.s_addr; ++ nes_quad.SrcIpadr = cm_id->remote_addr.sin_addr.s_addr; + nes_quad.TcpPorts[0] = cm_id->remote_addr.sin_port; + nes_quad.TcpPorts[1] = cm_id->local_addr.sin_port; + +-- +1.7.9.5 + diff --git a/linux-next-pending/0004-RDMA-nes-TSO-is-enabled-again-for-linux-3.5-Backport.patch b/linux-next-pending/0004-RDMA-nes-TSO-is-enabled-again-for-linux-3.5-Backport.patch new file mode 100644 index 0000000..b2cbbef --- /dev/null +++ b/linux-next-pending/0004-RDMA-nes-TSO-is-enabled-again-for-linux-3.5-Backport.patch @@ -0,0 +1,34 @@ +From 927a677bdc854f1a8cbd766560486c5ffdea0ab7 Mon Sep 17 00:00:00 2001 +From: Tatyana Nikolova +Date: Fri, 7 Sep 2012 19:45:21 -0500 +Subject: [PATCH 4/4] RDMA/nes: TSO is enabled again for linux-3.5 - Backport + change + +RDMA/nes: TSO is enabled again for linux-3.5 +(the patch should be applied on top of previous backports) + +Signed-off-by: Tatyana Nikolova +--- + drivers/infiniband/hw/nes/nes_nic.c | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/drivers/infiniband/hw/nes/nes_nic.c b/drivers/infiniband/hw/nes/nes_nic.c +index 5242294..4f73965 100644 +--- a/drivers/infiniband/hw/nes/nes_nic.c ++++ b/drivers/infiniband/hw/nes/nes_nic.c +@@ -1758,12 +1758,10 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev, + netdev->features |= NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_TX; + + if ((nesvnic->logical_port < 2) || (nesdev->nesadapter->hw_rev != NE020_REV)) { +-#if (LINUX_VERSION_CODE <= KERNEL_VERSION(3,3,0)) + netdev->features |= NETIF_F_TSO; + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) + netdev->hw_features |= NETIF_F_TSO; + #endif +-#endif + } + + nes_debug(NES_DBG_INIT, "nesvnic = %p, reported features = 0x%lX, QPid = %d," +-- +1.7.9.5 +