netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [NET-2.6 PATCHv2 0/1]qlcnic: bug fix
@ 2011-04-13  3:05 amit.salecha
  2011-04-13  3:05 ` [PATCHv2 NET-2.6 1/1] qlcnic: limit skb frags for non tso packet amit.salecha
  0 siblings, 1 reply; 3+ messages in thread
From: amit.salecha @ 2011-04-13  3:05 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman, anirban.chakraborty

David,
	Apply this fix to net-2.6. this is series two as earlier email got corrupted.
	Same netxen_nic apply to qlcnic.

	This patch will give hunk failure while merging to net-next tree.
	Two lines below diff has changed in qlcnic_xmit_frame().

	Sorry, for all spam and corrupted emails. I understand your work load and
	this nuisance really distrubed all people. As people give their precious time
	in reviewing patches.

	Going forward will make sure these type of events not repeated by Qlogic.

-Amit

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCHv2 NET-2.6 1/1] qlcnic: limit skb frags for non tso packet
  2011-04-13  3:05 [NET-2.6 PATCHv2 0/1]qlcnic: bug fix amit.salecha
@ 2011-04-13  3:05 ` amit.salecha
  2011-04-13 18:53   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: amit.salecha @ 2011-04-13  3:05 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman, anirban.chakraborty, Amit Kumar Salecha,
	stable

From: Amit Kumar Salecha <amit.salecha@qlogic.com>

Machines are getting deadlock in four node cluster environment.
All nodes are accessing (find /gfs2 -depth -print|cpio -ocv > /dev/null)
200 GB storage on a GFS2 filesystem.
This result in memory fragmentation and driver receives 18 frags for
1448 byte packets.
For non tso packet, fw drops the tx request, if it has >14 frags.

Fixing it by pulling extra frags.

Cc: stable@kernel.org
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 drivers/net/qlcnic/qlcnic.h      |    1 +
 drivers/net/qlcnic/qlcnic_main.c |   14 ++++++++++++++
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index dc44564..b0dead0 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -99,6 +99,7 @@
 #define TX_UDPV6_PKT	0x0c
 
 /* Tx defines */
+#define QLCNIC_MAX_FRAGS_PER_TX	14
 #define MAX_TSO_HEADER_DESC	2
 #define MGMT_CMD_DESC_RESV	4
 #define TX_STOP_THRESH		((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index cd88c7e..cb1a1ef 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -2099,6 +2099,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 	struct cmd_desc_type0 *hwdesc, *first_desc;
 	struct pci_dev *pdev;
 	struct ethhdr *phdr;
+	int delta = 0;
 	int i, k;
 
 	u32 producer;
@@ -2118,6 +2119,19 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 	}
 
 	frag_count = skb_shinfo(skb)->nr_frags + 1;
+	/* 14 frags supported for normal packet and
+	 * 32 frags supported for TSO packet
+	 */
+	if (!skb_is_gso(skb) && frag_count > QLCNIC_MAX_FRAGS_PER_TX) {
+
+		for (i = 0; i < (frag_count - QLCNIC_MAX_FRAGS_PER_TX); i++)
+			delta += skb_shinfo(skb)->frags[i].size;
+
+		if (!__pskb_pull_tail(skb, delta))
+			goto drop_packet;
+
+		frag_count = 1 + skb_shinfo(skb)->nr_frags;
+	}
 
 	/* 4 fragments per cmd des */
 	no_of_desc = (frag_count + 3) >> 2;
-- 
1.6.0.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCHv2 NET-2.6 1/1] qlcnic: limit skb frags for non tso packet
  2011-04-13  3:05 ` [PATCHv2 NET-2.6 1/1] qlcnic: limit skb frags for non tso packet amit.salecha
@ 2011-04-13 18:53   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2011-04-13 18:53 UTC (permalink / raw)
  To: amit.salecha; +Cc: netdev, ameen.rahman, anirban.chakraborty, stable

From: amit.salecha@qlogic.com
Date: Tue, 12 Apr 2011 20:05:55 -0700

> From: Amit Kumar Salecha <amit.salecha@qlogic.com>
> 
> Machines are getting deadlock in four node cluster environment.
> All nodes are accessing (find /gfs2 -depth -print|cpio -ocv > /dev/null)
> 200 GB storage on a GFS2 filesystem.
> This result in memory fragmentation and driver receives 18 frags for
> 1448 byte packets.
> For non tso packet, fw drops the tx request, if it has >14 frags.
> 
> Fixing it by pulling extra frags.
> 
> Cc: stable@kernel.org
> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>

Applied.

But like Greg said, please kill that footer notice on your outgoing
emails when engaging in any discussion on a public mailing list.

Thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-04-13 18:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-13  3:05 [NET-2.6 PATCHv2 0/1]qlcnic: bug fix amit.salecha
2011-04-13  3:05 ` [PATCHv2 NET-2.6 1/1] qlcnic: limit skb frags for non tso packet amit.salecha
2011-04-13 18:53   ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).