netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Prashant Sreedharan <prashant@broadcom.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Michael Chan <mchan@broadcom.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Boris Ostrovsky <boris.ostrovsky@oracle.com>,
	David Vrabel <david.vrabel@citrix.com>,
	Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>,
	Vlad Yasevich <vyasevich@gmail.com>,
	"Nithin Nayak Sujir" <nsujir@broadcom.com>,
	<xen-devel@lists.xensource.com>, <netdev@vger.kernel.org>
Subject: Re: tg3 NIC driver bug in 3.14.x under Xen [and 3 more messages]
Date: Thu, 9 Apr 2015 11:08:03 -0700	[thread overview]
Message-ID: <1428602883.4720.31.camel@prashant> (raw)
In-Reply-To: <21798.46590.928152.666550@mariner.uk.xensource.com>

[-- Attachment #1: Type: text/plain, Size: 1215 bytes --]

On Thu, 2015-04-09 at 18:25 +0100, Ian Jackson wrote:

> root@bedbug:~# ethtool -S eth0 | grep -v ': 0$'
> NIC statistics:
>      rx_octets: 8196868
>      rx_ucast_packets: 633
>      rx_mcast_packets: 1
>      rx_bcast_packets: 123789
>      tx_octets: 42854
>      tx_ucast_packets: 9
>      tx_mcast_packets: 8
>      tx_bcast_packets: 603
> root@bedbug:~# ifconfig eth0
> eth0      Link encap:Ethernet  HWaddr 00:13:72:14:c0:51  
>           inet addr:10.80.249.102  Bcast:10.80.251.255
>           Mask:255.255.252.0
>           inet6 addr: fe80::213:72ff:fe14:c051/64 Scope:Link
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:124774 errors:0 dropped:88921 overruns:0 frame:0
>           TX packets:620 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:1000 
>           RX bytes:8222158 (7.8 MiB)  TX bytes:42854 (41.8 KiB)
>           Interrupt:17 
> 
> root@bedbug:~#
> 
> It appears therefore that packets are being corrupted on the receive
> path, and the kernel then drops them (as misaddressed).
> 
thanks for the repo, the RX drop counter is updated at few places in the
driver. Please use the attached debug patch and provide the logs

[-- Attachment #2: tg3_debug_1.patch --]
[-- Type: text/x-patch, Size: 1976 bytes --]

>From 777363eb77bddd52b9983c0025fed8b4ec151417 Mon Sep 17 00:00:00 2001
From: Prashant Sreedharan <prashant@broadcom.com>
Date: Thu, 9 Apr 2015 10:52:17 -0700
Subject: [stable: 3.14.37]tg3: debug_patch

---
 drivers/net/ethernet/broadcom/tg3.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 8206113..5e2c9d6 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -6871,8 +6871,11 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
 
 			skb_size = tg3_alloc_rx_data(tp, tpr, opaque_key,
 						    *post_ptr, &frag_size);
-			if (skb_size < 0)
+			if (skb_size < 0) {
+				netdev_err(tp->dev, "alloc_rx failure %x %x %x\n",
+					   skb_size, opaque_key, frag_size);
 				goto drop_it;
+			}
 
 			pci_unmap_single(tp->pdev, dma_addr, skb_size,
 					 PCI_DMA_FROMDEVICE);
@@ -6886,6 +6889,8 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
 
 			skb = build_skb(data, frag_size);
 			if (!skb) {
+				netdev_err(tp->dev, "build_skb failure %d\n",
+					   frag_size);
 				tg3_frag_free(frag_size != 0, data);
 				goto drop_it_no_recycle;
 			}
@@ -6896,8 +6901,10 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
 
 			skb = netdev_alloc_skb(tp->dev,
 					       len + TG3_RAW_IP_ALIGN);
-			if (skb == NULL)
+			if (skb == NULL) {
+				netdev_err(tp->dev, "alloc_skb fail %d\n", len);
 				goto drop_it_no_recycle;
+			}
 
 			skb_reserve(skb, TG3_RAW_IP_ALIGN);
 			pci_dma_sync_single_for_cpu(tp->pdev, dma_addr, len, PCI_DMA_FROMDEVICE);
@@ -6925,6 +6932,8 @@ static int tg3_rx(struct tg3_napi *tnapi, int budget)
 		if (len > (tp->dev->mtu + ETH_HLEN) &&
 		    skb->protocol != htons(ETH_P_8021Q) &&
 		    skb->protocol != htons(ETH_P_8021AD)) {
+			netdev_err(tp->dev, "Proto %x %x\n",
+				   skb->protocol, len);
 			dev_kfree_skb(skb);
 			goto drop_it_no_recycle;
 		}
-- 
1.7.1


  reply	other threads:[~2015-04-09 18:31 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-07 15:12 tg3 NIC driver bug in 3.14.x under Xen Ian Jackson
2015-04-07 15:37 ` Konrad Rzeszutek Wilk
2015-04-07 18:25   ` Ian Jackson
2015-04-07 16:55 ` Michael Chan
2015-04-07 17:58   ` Ian Jackson
2015-04-07 18:13     ` Ian Jackson
2015-04-07 23:21       ` Michael Chan
2015-04-07 23:22         ` Prashant Sreedharan
2015-04-08 13:59           ` tg3 NIC driver bug in 3.14.x under Xen [and 3 more messages] Ian Jackson
2015-04-09  1:43             ` Prashant Sreedharan
2015-04-09 11:11               ` Ian Jackson
2015-04-09 16:10                 ` Prashant Sreedharan
2015-04-09 16:57                   ` Ian Jackson
2015-04-09 17:25                     ` Ian Jackson
2015-04-09 18:08                       ` Prashant Sreedharan [this message]
2015-04-10 15:06                         ` Ian Jackson
2015-04-11  8:01                           ` Prashant
2015-04-15 10:54                             ` Ian Jackson
2015-04-16  2:53                               ` Prashant
2015-04-16 10:18                                 ` Ian Jackson
2015-04-16 12:24                                   ` cascardo
2015-04-16 16:39                                     ` Michael Chan
2015-04-16 17:15                                       ` Ian Jackson
2015-04-16 22:51                                         ` Prashant Sreedharan
2015-04-17 16:29                                           ` Ian Jackson
2015-04-17 17:19                                             ` David Miller
2015-04-17 17:46                                               ` Michael Chan
2015-04-17 19:04                                                 ` Konrad Rzeszutek Wilk
2015-04-17 19:12                                                   ` David Miller
2015-04-17 18:52                                                     ` Prashant Sreedharan
2015-04-21 15:05                                                       ` Ian Jackson
2015-04-16 18:14                                       ` David Miller
2015-04-09 18:26                       ` Michael Chan
2015-04-10 11:43                         ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1428602883.4720.31.camel@prashant \
    --to=prashant@broadcom.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=cascardo@linux.vnet.ibm.com \
    --cc=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=mchan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=nsujir@broadcom.com \
    --cc=vyasevich@gmail.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).