diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-05-17 16:57:47 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-05-18 18:09:43 -0400 |
commit | e76678dd654545c98a5d0bdc66bd41350573c23e (patch) | |
tree | 86e4ff745d686f82353c460542e321ba0b09cbc0 | |
parent | 82d048186e403f36e083b37ad42aa90abb7dcaac (diff) |
ixgbe: set max desc to prevent total RSC packet size of 64K
The performance of hardware RSC is greatly reduced if the total for max rsc
descriptors multiplied by the buffer size is greater than 65535. To
prevent this we need to adjust the max rsc descriptors appropriately.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ixgbe/ixgbe.h | 2 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 29 |
2 files changed, 20 insertions, 11 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index d291d1cbe041..05a24055ac2f 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h | |||
@@ -75,6 +75,8 @@ | |||
75 | #define IXGBE_RXBUFFER_128 128 /* Used for packet split */ | 75 | #define IXGBE_RXBUFFER_128 128 /* Used for packet split */ |
76 | #define IXGBE_RXBUFFER_256 256 /* Used for packet split */ | 76 | #define IXGBE_RXBUFFER_256 256 /* Used for packet split */ |
77 | #define IXGBE_RXBUFFER_2048 2048 | 77 | #define IXGBE_RXBUFFER_2048 2048 |
78 | #define IXGBE_RXBUFFER_4096 4096 | ||
79 | #define IXGBE_RXBUFFER_8192 8192 | ||
78 | #define IXGBE_MAX_RXBUFFER 16384 /* largest size for a single descriptor */ | 80 | #define IXGBE_MAX_RXBUFFER 16384 /* largest size for a single descriptor */ |
79 | 81 | ||
80 | #define IXGBE_RX_HDR_SIZE IXGBE_RXBUFFER_256 | 82 | #define IXGBE_RX_HDR_SIZE IXGBE_RXBUFFER_256 |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index b53f26501173..4ab17ab7fbce 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -1995,21 +1995,28 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter) | |||
1995 | rscctrl = IXGBE_READ_REG(hw, IXGBE_RSCCTL(j)); | 1995 | rscctrl = IXGBE_READ_REG(hw, IXGBE_RSCCTL(j)); |
1996 | rscctrl |= IXGBE_RSCCTL_RSCEN; | 1996 | rscctrl |= IXGBE_RSCCTL_RSCEN; |
1997 | /* | 1997 | /* |
1998 | * if packet split is enabled we can only support up | 1998 | * we must limit the number of descriptors so that the |
1999 | * to max frags + 1 descriptors. | 1999 | * total size of max desc * buf_len is not greater |
2000 | * than 65535 | ||
2000 | */ | 2001 | */ |
2001 | if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) | 2002 | if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) { |
2002 | #if (MAX_SKB_FRAGS < 3) | 2003 | #if (MAX_SKB_FRAGS > 16) |
2003 | rscctrl |= IXGBE_RSCCTL_MAXDESC_1; | 2004 | rscctrl |= IXGBE_RSCCTL_MAXDESC_16; |
2004 | #elif (MAX_SKB_FRAGS < 7) | 2005 | #elif (MAX_SKB_FRAGS > 8) |
2005 | rscctrl |= IXGBE_RSCCTL_MAXDESC_4; | ||
2006 | #elif (MAX_SKB_FRAGS < 15) | ||
2007 | rscctrl |= IXGBE_RSCCTL_MAXDESC_8; | 2006 | rscctrl |= IXGBE_RSCCTL_MAXDESC_8; |
2007 | #elif (MAX_SKB_FRAGS > 4) | ||
2008 | rscctrl |= IXGBE_RSCCTL_MAXDESC_4; | ||
2008 | #else | 2009 | #else |
2009 | rscctrl |= IXGBE_RSCCTL_MAXDESC_16; | 2010 | rscctrl |= IXGBE_RSCCTL_MAXDESC_1; |
2010 | #endif | 2011 | #endif |
2011 | else | 2012 | } else { |
2012 | rscctrl |= IXGBE_RSCCTL_MAXDESC_16; | 2013 | if (rx_buf_len < IXGBE_RXBUFFER_4096) |
2014 | rscctrl |= IXGBE_RSCCTL_MAXDESC_16; | ||
2015 | else if (rx_buf_len < IXGBE_RXBUFFER_8192) | ||
2016 | rscctrl |= IXGBE_RSCCTL_MAXDESC_8; | ||
2017 | else | ||
2018 | rscctrl |= IXGBE_RSCCTL_MAXDESC_4; | ||
2019 | } | ||
2013 | IXGBE_WRITE_REG(hw, IXGBE_RSCCTL(j), rscctrl); | 2020 | IXGBE_WRITE_REG(hw, IXGBE_RSCCTL(j), rscctrl); |
2014 | } | 2021 | } |
2015 | /* Disable RSC for ACK packets */ | 2022 | /* Disable RSC for ACK packets */ |