aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/benet/be.h
diff options
context:
space:
mode:
authorAjit Khaparde <ajitk@serverengines.com>2009-06-26 02:51:07 +0000
committerDavid S. Miller <davem@davemloft.net>2009-06-28 17:34:25 -0700
commitbd46cb6cf11867130a41ea9546dd65688b71f3c2 (patch)
treebfd797129c817d3989f471914ef4979d008ef0d8 /drivers/net/benet/be.h
parentff780cd8f2fa928b193554f593b36d1243554212 (diff)
be2net: Fix to avoid a crash seen on PPC with LRO and Jumbo frames.
While testing the driver on PPC, we ran into a crash with LRO, Jumbo frames. With CONFIG_PPC_64K_PAGES configured (a default in PPC), MAX_SKB_FRAGS drops to 3 and we were crossing the array limits on skb_shinfo(skb)->frags[]. Now we coalesce the frags from the same physical page into one slot in skb_shinfo(skb)->frags[] and go to the next index when the frag is from different physical page. This patch is against the net-2.6 tree. Signed-off-by: Ajit Khaparde <ajitk@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be.h')
-rw-r--r--drivers/net/benet/be.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/benet/be.h b/drivers/net/benet/be.h
index f703758f0a6..5b4bf3d2cdc 100644
--- a/drivers/net/benet/be.h
+++ b/drivers/net/benet/be.h
@@ -73,7 +73,7 @@ static inline char *nic_name(struct pci_dev *pdev)
#define RX_FRAGS_REFILL_WM (RX_Q_LEN - MAX_RX_POST)
#define BE_MAX_LRO_DESCRIPTORS 16
-#define BE_MAX_FRAGS_PER_FRAME 16
+#define BE_MAX_FRAGS_PER_FRAME (min((u32) 16, (u32) MAX_SKB_FRAGS))
struct be_dma_mem {
void *va;