Skip to content

Commit f7bb3d8

Browse files
committed
Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue
Jeff Kirsher says: ==================== Intel Wired LAN Driver Updates 2017-03-02 This series contains fixes to ixgbe only. Paolo fixes the driver so that you can actually update the RSS key value via ethtool. Alex fixes an issue on architectures that have a cache line size larger than 64 Bytes, where the amount of headroom for the frame starts shrinking. To take this into account, Alex adds one small check so that we compare the max_frame to the amount of actual data we can store, so we will automatically enable 3K receive buffers as soon as the maximum frame size we can handle drops below the standard Ethernet MTU. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 9f674e4 + c74042f commit f7bb3d8

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
#define IXGBE_MAX_FRAME_BUILD_SKB \
9797
(SKB_WITH_OVERHEAD(IXGBE_RXBUFFER_2K) - IXGBE_SKB_PAD)
9898
#else
99-
#define IGB_MAX_FRAME_BUILD_SKB IXGBE_RXBUFFER_2K
99+
#define IXGBE_MAX_FRAME_BUILD_SKB IXGBE_RXBUFFER_2K
100100
#endif
101101

102102
/*
@@ -929,6 +929,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
929929
struct ixgbe_adapter *adapter,
930930
struct ixgbe_ring *tx_ring);
931931
u32 ixgbe_rss_indir_tbl_entries(struct ixgbe_adapter *adapter);
932+
void ixgbe_store_key(struct ixgbe_adapter *adapter);
932933
void ixgbe_store_reta(struct ixgbe_adapter *adapter);
933934
s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg,
934935
u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm);

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2998,8 +2998,10 @@ static int ixgbe_set_rxfh(struct net_device *netdev, const u32 *indir,
29982998
}
29992999

30003000
/* Fill out the rss hash key */
3001-
if (key)
3001+
if (key) {
30023002
memcpy(adapter->rss_key, key, ixgbe_get_rxfh_key_size(netdev));
3003+
ixgbe_store_key(adapter);
3004+
}
30033005

30043006
ixgbe_store_reta(adapter);
30053007

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3473,6 +3473,21 @@ u32 ixgbe_rss_indir_tbl_entries(struct ixgbe_adapter *adapter)
34733473
return 512;
34743474
}
34753475

3476+
/**
3477+
* ixgbe_store_key - Write the RSS key to HW
3478+
* @adapter: device handle
3479+
*
3480+
* Write the RSS key stored in adapter.rss_key to HW.
3481+
*/
3482+
void ixgbe_store_key(struct ixgbe_adapter *adapter)
3483+
{
3484+
struct ixgbe_hw *hw = &adapter->hw;
3485+
int i;
3486+
3487+
for (i = 0; i < 10; i++)
3488+
IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), adapter->rss_key[i]);
3489+
}
3490+
34763491
/**
34773492
* ixgbe_store_reta - Write the RETA table to HW
34783493
* @adapter: device handle
@@ -3538,7 +3553,6 @@ static void ixgbe_store_vfreta(struct ixgbe_adapter *adapter)
35383553

35393554
static void ixgbe_setup_reta(struct ixgbe_adapter *adapter)
35403555
{
3541-
struct ixgbe_hw *hw = &adapter->hw;
35423556
u32 i, j;
35433557
u32 reta_entries = ixgbe_rss_indir_tbl_entries(adapter);
35443558
u16 rss_i = adapter->ring_feature[RING_F_RSS].indices;
@@ -3551,8 +3565,7 @@ static void ixgbe_setup_reta(struct ixgbe_adapter *adapter)
35513565
rss_i = 4;
35523566

35533567
/* Fill out hash function seeds */
3554-
for (i = 0; i < 10; i++)
3555-
IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), adapter->rss_key[i]);
3568+
ixgbe_store_key(adapter);
35563569

35573570
/* Fill out redirection table */
35583571
memset(adapter->rss_indir_tbl, 0, sizeof(adapter->rss_indir_tbl));
@@ -3959,7 +3972,8 @@ static void ixgbe_set_rx_buffer_len(struct ixgbe_adapter *adapter)
39593972
if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED)
39603973
set_bit(__IXGBE_RX_3K_BUFFER, &rx_ring->state);
39613974

3962-
if (max_frame > (ETH_FRAME_LEN + ETH_FCS_LEN))
3975+
if ((max_frame > (ETH_FRAME_LEN + ETH_FCS_LEN)) ||
3976+
(max_frame > IXGBE_MAX_FRAME_BUILD_SKB))
39633977
set_bit(__IXGBE_RX_3K_BUFFER, &rx_ring->state);
39643978
#endif
39653979
}

0 commit comments

Comments
 (0)