diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2017-02-07 05:27:14 +0300 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2017-03-17 22:11:44 +0300 |
commit | e3cdf68d4a861d91ef62ed615483e673f07fccfe (patch) | |
tree | e2ce2ca2e229f416e60e4c1fe377dead5aaaf25a /drivers/net/ethernet/intel/igb/igb.h | |
parent | 8649aaef4044681257ed38cf8706aea88430f2c4 (diff) | |
download | linux-e3cdf68d4a861d91ef62ed615483e673f07fccfe.tar.xz |
igb: Add support for padding packet
With the size of the frame limited we can now write to an offset within the
buffer instead of having to write at the very start of the buffer. The
advantage to this is that it allows us to leave padding room for things
like supporting XDP in the future.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igb/igb.h')
-rw-r--r-- | drivers/net/ethernet/intel/igb/igb.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h index eb91c87e0c1d..dc6e2980718f 100644 --- a/drivers/net/ethernet/intel/igb/igb.h +++ b/drivers/net/ethernet/intel/igb/igb.h @@ -314,6 +314,7 @@ struct igb_q_vector { enum e1000_ring_flags_t { IGB_RING_FLAG_RX_3K_BUFFER, + IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, IGB_RING_FLAG_RX_SCTP_CSUM, IGB_RING_FLAG_RX_LB_VLAN_BSWAP, IGB_RING_FLAG_TX_CTX_IDX, @@ -327,11 +328,21 @@ enum e1000_ring_flags_t { #define clear_ring_uses_large_buffer(ring) \ clear_bit(IGB_RING_FLAG_RX_3K_BUFFER, &(ring)->flags) +#define ring_uses_build_skb(ring) \ + test_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags) +#define set_ring_build_skb_enabled(ring) \ + set_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags) +#define clear_ring_build_skb_enabled(ring) \ + clear_bit(IGB_RING_FLAG_RX_BUILD_SKB_ENABLED, &(ring)->flags) + static inline unsigned int igb_rx_bufsz(struct igb_ring *ring) { #if (PAGE_SIZE < 8192) if (ring_uses_large_buffer(ring)) return IGB_RXBUFFER_3072; + + if (ring_uses_build_skb(ring)) + return IGB_MAX_FRAME_BUILD_SKB + IGB_TS_HDR_LEN; #endif return IGB_RXBUFFER_2048; } |