Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 150297
b: refs/heads/master
c: e76678d
h: refs/heads/master
i:
  150295: 336f37c
v: v3
  • Loading branch information
Alexander Duyck authored and David S. Miller committed May 18, 2009
1 parent 33f70b3 commit 43c6f52
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 82d048186e403f36e083b37ad42aa90abb7dcaac
refs/heads/master: e76678dd654545c98a5d0bdc66bd41350573c23e
2 changes: 2 additions & 0 deletions trunk/drivers/net/ixgbe/ixgbe.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@
#define IXGBE_RXBUFFER_128 128 /* Used for packet split */
#define IXGBE_RXBUFFER_256 256 /* Used for packet split */
#define IXGBE_RXBUFFER_2048 2048
#define IXGBE_RXBUFFER_4096 4096
#define IXGBE_RXBUFFER_8192 8192
#define IXGBE_MAX_RXBUFFER 16384 /* largest size for a single descriptor */

#define IXGBE_RX_HDR_SIZE IXGBE_RXBUFFER_256
Expand Down
29 changes: 18 additions & 11 deletions trunk/drivers/net/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1995,21 +1995,28 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
rscctrl = IXGBE_READ_REG(hw, IXGBE_RSCCTL(j));
rscctrl |= IXGBE_RSCCTL_RSCEN;
/*
* if packet split is enabled we can only support up
* to max frags + 1 descriptors.
* we must limit the number of descriptors so that the
* total size of max desc * buf_len is not greater
* than 65535
*/
if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED)
#if (MAX_SKB_FRAGS < 3)
rscctrl |= IXGBE_RSCCTL_MAXDESC_1;
#elif (MAX_SKB_FRAGS < 7)
rscctrl |= IXGBE_RSCCTL_MAXDESC_4;
#elif (MAX_SKB_FRAGS < 15)
if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) {
#if (MAX_SKB_FRAGS > 16)
rscctrl |= IXGBE_RSCCTL_MAXDESC_16;
#elif (MAX_SKB_FRAGS > 8)
rscctrl |= IXGBE_RSCCTL_MAXDESC_8;
#elif (MAX_SKB_FRAGS > 4)
rscctrl |= IXGBE_RSCCTL_MAXDESC_4;
#else
rscctrl |= IXGBE_RSCCTL_MAXDESC_16;
rscctrl |= IXGBE_RSCCTL_MAXDESC_1;
#endif
else
rscctrl |= IXGBE_RSCCTL_MAXDESC_16;
} else {
if (rx_buf_len < IXGBE_RXBUFFER_4096)
rscctrl |= IXGBE_RSCCTL_MAXDESC_16;
else if (rx_buf_len < IXGBE_RXBUFFER_8192)
rscctrl |= IXGBE_RSCCTL_MAXDESC_8;
else
rscctrl |= IXGBE_RSCCTL_MAXDESC_4;
}
IXGBE_WRITE_REG(hw, IXGBE_RSCCTL(j), rscctrl);
}
/* Disable RSC for ACK packets */
Expand Down

0 comments on commit 43c6f52

Please sign in to comment.