[PATCH net 1/2] tg3: Fix for diasllow rx coalescing time to be 0

2016-08-02 Thread skallam
From: Satish Baddipadige 

When the rx coalescing time is 0, interrupts
are not generated from the controller and rx path hangs.
To avoid this rx hang, updating the driver to not allow
rx coalescing time to be 0.

Signed-off-by: Satish Baddipadige 
Signed-off-by: Siva Reddy Kallam 
Signed-off-by: Michael Chan 
---
 drivers/net/ethernet/broadcom/tg3.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c 
b/drivers/net/ethernet/broadcom/tg3.c
index ff300f7..f3c6c91 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -14014,6 +14014,7 @@ static int tg3_set_coalesce(struct net_device *dev, 
struct ethtool_coalesce *ec)
}
 
if ((ec->rx_coalesce_usecs > MAX_RXCOL_TICKS) ||
+   (!ec->rx_coalesce_usecs) ||
(ec->tx_coalesce_usecs > MAX_TXCOL_TICKS) ||
(ec->rx_max_coalesced_frames > MAX_RXMAX_FRAMES) ||
(ec->tx_max_coalesced_frames > MAX_TXMAX_FRAMES) ||
-- 
1.7.1



[PATCH net 2/2] tg3: Report the correct number of RSS queues through tg3_get_rxnfc

2016-08-02 Thread skallam
From: Siva Reddy Kallam 

This patch remove the wrong substraction from info->data in
tg3_get_rxnfc function. Without this patch, the number of RSS
queues reported is less by one.

Reported-by: Michal Soltys 
Signed-off-by: Siva Reddy Kallam 
Signed-off-by: Michael Chan 
---
 drivers/net/ethernet/broadcom/tg3.c |4 
 1 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c 
b/drivers/net/ethernet/broadcom/tg3.c
index f3c6c91..6592612 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -12552,10 +12552,6 @@ static int tg3_get_rxnfc(struct net_device *dev, 
struct ethtool_rxnfc *info,
info->data = TG3_RSS_MAX_NUM_QS;
}
 
-   /* The first interrupt vector only
-* handles link interrupts.
-*/
-   info->data -= 1;
return 0;
 
default:
-- 
1.7.1



[PATCH net 0/2] tg3: Disallow 0 rx coalesce time and correctly report RSS queues in tg3_get_rxnfc

2016-08-02 Thread skallam
From: Siva Reddy Kallam 

First patch:
Diasllow rx coalescing time to be 0

Second patch:
Report the correct number of RSS queues through tg3_get_rxnfc

Satish Baddipadige (1):
  tg3: Fix for diasllow rx coalescing time to be 0

Siva Reddy Kallam (1):
  tg3: Report the correct number of RSS queues through tg3_get_rxnfc

 drivers/net/ethernet/broadcom/tg3.c |5 +
 1 files changed, 1 insertions(+), 4 deletions(-)



[PATCH net-next] MAINTAINERS: Update tg3 maintainer

2016-02-04 Thread skallam
From: Siva Reddy Kallam 

Signed-off-by: Siva Reddy Kallam 
Signed-off-by: Michael Chan 
Acked-by: Prashant Sreedharan 
---
 MAINTAINERS | 1 +
 1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index f678c37..5edcb8a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2424,6 +2424,7 @@ F:include/linux/bcm963xx_nvram.h
 F: include/linux/bcm963xx_tag.h
 
 BROADCOM TG3 GIGABIT ETHERNET DRIVER
+M: Siva Reddy Kallam 
 M: Prashant Sreedharan 
 M: Michael Chan 
 L: netdev@vger.kernel.org
-- 
1.9.1



[PATCH net v2] tg3: Fix for tg3 transmit queue 0 timed out when too many gso_segs

2016-02-03 Thread skallam
From: Siva Reddy Kallam 

tg3_tso_bug() can hit a condition where the entire tx ring is not big
enough to segment the GSO packet. For example, if MSS is very small,
gso_segs can exceed the tx ring size. When we hit the condition, it
will cause tx timeout.

tg3_tso_bug() is called to handle TSO and DMA hardware bugs.
For TSO bugs, if tg3_tso_bug() cannot succeed, we have to drop the packet.
For DMA bugs, we can still fall back to linearize the SKB and let the
hardware transmit the TSO packet.

This patch adds a function tg3_tso_bug_gso_check() to check if there
are enough tx descriptors for GSO before calling tg3_tso_bug().
The caller will then handle the error appropriately - drop or
lineraize the SKB.

v2: Corrected patch description to avoid confusion.

Signed-off-by: Siva Reddy Kallam 
Signed-off-by: Michael Chan 
Acked-by: Prashant Sreedharan 
---
 drivers/net/ethernet/broadcom/tg3.c | 25 +++--
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/tg3.c 
b/drivers/net/ethernet/broadcom/tg3.c
index 9293675..eb3d347 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -7831,6 +7831,14 @@ static int tigon3_dma_hwbug_workaround(struct tg3_napi 
*tnapi,
return ret;
 }
 
+static bool tg3_tso_bug_gso_check(struct tg3_napi *tnapi, struct sk_buff *skb)
+{
+   /* Check if we will never have enough descriptors,
+* as gso_segs can be more than current ring size
+*/
+   return skb_shinfo(skb)->gso_segs < tnapi->tx_pending / 3;
+}
+
 static netdev_tx_t tg3_start_xmit(struct sk_buff *, struct net_device *);
 
 /* Use GSO to workaround all TSO packets that meet HW bug conditions
@@ -7934,14 +7942,19 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, 
struct net_device *dev)
 * vlan encapsulated.
 */
if (skb->protocol == htons(ETH_P_8021Q) ||
-   skb->protocol == htons(ETH_P_8021AD))
-   return tg3_tso_bug(tp, tnapi, txq, skb);
+   skb->protocol == htons(ETH_P_8021AD)) {
+   if (tg3_tso_bug_gso_check(tnapi, skb))
+   return tg3_tso_bug(tp, tnapi, txq, skb);
+   goto drop;
+   }
 
if (!skb_is_gso_v6(skb)) {
if (unlikely((ETH_HLEN + hdr_len) > 80) &&
-   tg3_flag(tp, TSO_BUG))
-   return tg3_tso_bug(tp, tnapi, txq, skb);
-
+   tg3_flag(tp, TSO_BUG)) {
+   if (tg3_tso_bug_gso_check(tnapi, skb))
+   return tg3_tso_bug(tp, tnapi, txq, skb);
+   goto drop;
+   }
ip_csum = iph->check;
ip_tot_len = iph->tot_len;
iph->check = 0;
@@ -8073,7 +8086,7 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, 
struct net_device *dev)
if (would_hit_hwbug) {
tg3_tx_skb_unmap(tnapi, tnapi->tx_prod, i);
 
-   if (mss) {
+   if (mss && tg3_tso_bug_gso_check(tnapi, skb)) {
/* If it's a TSO packet, do GSO instead of
 * allocating and copying to a large linear SKB
 */
-- 
1.9.1