diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2011-05-27 05:31:52 +0000 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-06-25 00:06:51 -0700 |
commit | a535c30e9e98d201089503a0ffa0093cba16e796 (patch) | |
tree | 5e15e3c107edf07b3d6e2d4dc834a43cdf75b52e /drivers/net/ixgbe/ixgbe.h | |
parent | 897ab15606ce896b6a574a263beb51cbfb43f041 (diff) | |
download | op-kernel-dev-a535c30e9e98d201089503a0ffa0093cba16e796.zip op-kernel-dev-a535c30e9e98d201089503a0ffa0093cba16e796.tar.gz |
ixgbe: Update method used for determining descriptor count for an skb
This patch updates the current methods used for determining if we have
enough space to transmit a given skb. The current method is quite wasteful
as it has us go through and determine how each page is going to be broken
up. That only needs to be done if pages are larger than our maximum data
per TXD. As such I have wrapped that in a page size check.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe.h')
-rw-r--r-- | drivers/net/ixgbe/ixgbe.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h index 393ceae..744b641 100644 --- a/drivers/net/ixgbe/ixgbe.h +++ b/drivers/net/ixgbe/ixgbe.h @@ -131,6 +131,13 @@ struct vf_macvlans { u8 vf_macvlan[ETH_ALEN]; }; +#define IXGBE_MAX_TXD_PWR 14 +#define IXGBE_MAX_DATA_PER_TXD (1 << IXGBE_MAX_TXD_PWR) + +/* Tx Descriptors needed, worst case */ +#define TXD_USE_COUNT(S) DIV_ROUND_UP((S), IXGBE_MAX_DATA_PER_TXD) +#define DESC_NEEDED ((MAX_SKB_FRAGS * TXD_USE_COUNT(PAGE_SIZE)) + 4) + /* wrapper around a pointer to a socket buffer, * so a DMA handle can be stored along with the buffer */ struct ixgbe_tx_buffer { |