All of lore.kernel.org
 help / color / mirror / Atom feed
* [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-03-02
@ 2017-03-03  2:24 Jeff Kirsher
  2017-03-03  2:24 ` [net 1/2] ixgbe: update the rss key on h/w, when ethtool ask for it Jeff Kirsher
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jeff Kirsher @ 2017-03-03  2:24 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene

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.

The following are changes since commit 9f674e48c13dcbc31ac903433727837795b81efe:
  xen-netback: Use GFP_ATOMIC to allocate hash
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue 10GbE

Alexander Duyck (1):
  ixgbe: Limit use of 2K buffers on architectures with 256B or larger
    cache lines

Paolo Abeni (1):
  ixgbe: update the rss key on h/w, when ethtool ask for it

 drivers/net/ethernet/intel/ixgbe/ixgbe.h         |  3 ++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c |  4 +++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c    | 22 ++++++++++++++++++----
 3 files changed, 23 insertions(+), 6 deletions(-)

-- 
2.12.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [net 1/2] ixgbe: update the rss key on h/w, when ethtool ask for it
  2017-03-03  2:24 [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-03-02 Jeff Kirsher
@ 2017-03-03  2:24 ` Jeff Kirsher
  2017-03-03  2:24 ` [net 2/2] ixgbe: Limit use of 2K buffers on architectures with 256B or larger cache lines Jeff Kirsher
  2017-03-03 17:33 ` [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-03-02 David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2017-03-03  2:24 UTC (permalink / raw)
  To: davem; +Cc: Paolo Abeni, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Paolo Abeni <pabeni@redhat.com>

Currently ixgbe_set_rxfh() updates the rss_key copy in the driver
memory, but does not push the new value into the h/w. This commit
add a new helper for the latter operation and call it in
ixgbe_set_rxfh(), so that the h/w rss key value can be really
updated via ethtool.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe.h         |  1 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c |  4 +++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c    | 19 ++++++++++++++++---
 3 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index a2cc43d28888..7a951b116821 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -929,6 +929,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
 				  struct ixgbe_adapter *adapter,
 				  struct ixgbe_ring *tx_ring);
 u32 ixgbe_rss_indir_tbl_entries(struct ixgbe_adapter *adapter);
+void ixgbe_store_key(struct ixgbe_adapter *adapter);
 void ixgbe_store_reta(struct ixgbe_adapter *adapter);
 s32 ixgbe_negotiate_fc(struct ixgbe_hw *hw, u32 adv_reg, u32 lp_reg,
 		       u32 adv_sym, u32 adv_asm, u32 lp_sym, u32 lp_asm);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index a7574c7b12af..90fa5bf23d1b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -2998,8 +2998,10 @@ static int ixgbe_set_rxfh(struct net_device *netdev, const u32 *indir,
 	}
 
 	/* Fill out the rss hash key */
-	if (key)
+	if (key) {
 		memcpy(adapter->rss_key, key, ixgbe_get_rxfh_key_size(netdev));
+		ixgbe_store_key(adapter);
+	}
 
 	ixgbe_store_reta(adapter);
 
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 060cdce8058f..67ab13fd163c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -3474,6 +3474,21 @@ u32 ixgbe_rss_indir_tbl_entries(struct ixgbe_adapter *adapter)
 }
 
 /**
+ * ixgbe_store_key - Write the RSS key to HW
+ * @adapter: device handle
+ *
+ * Write the RSS key stored in adapter.rss_key to HW.
+ */
+void ixgbe_store_key(struct ixgbe_adapter *adapter)
+{
+	struct ixgbe_hw *hw = &adapter->hw;
+	int i;
+
+	for (i = 0; i < 10; i++)
+		IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), adapter->rss_key[i]);
+}
+
+/**
  * ixgbe_store_reta - Write the RETA table to HW
  * @adapter: device handle
  *
@@ -3538,7 +3553,6 @@ static void ixgbe_store_vfreta(struct ixgbe_adapter *adapter)
 
 static void ixgbe_setup_reta(struct ixgbe_adapter *adapter)
 {
-	struct ixgbe_hw *hw = &adapter->hw;
 	u32 i, j;
 	u32 reta_entries = ixgbe_rss_indir_tbl_entries(adapter);
 	u16 rss_i = adapter->ring_feature[RING_F_RSS].indices;
@@ -3551,8 +3565,7 @@ static void ixgbe_setup_reta(struct ixgbe_adapter *adapter)
 		rss_i = 4;
 
 	/* Fill out hash function seeds */
-	for (i = 0; i < 10; i++)
-		IXGBE_WRITE_REG(hw, IXGBE_RSSRK(i), adapter->rss_key[i]);
+	ixgbe_store_key(adapter);
 
 	/* Fill out redirection table */
 	memset(adapter->rss_indir_tbl, 0, sizeof(adapter->rss_indir_tbl));
-- 
2.12.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [net 2/2] ixgbe: Limit use of 2K buffers on architectures with 256B or larger cache lines
  2017-03-03  2:24 [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-03-02 Jeff Kirsher
  2017-03-03  2:24 ` [net 1/2] ixgbe: update the rss key on h/w, when ethtool ask for it Jeff Kirsher
@ 2017-03-03  2:24 ` Jeff Kirsher
  2017-03-03 12:24   ` David Laight
  2017-03-03 17:33 ` [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-03-02 David Miller
  2 siblings, 1 reply; 6+ messages in thread
From: Jeff Kirsher @ 2017-03-03  2:24 UTC (permalink / raw)
  To: davem; +Cc: Alexander Duyck, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Alexander Duyck <alexander.h.duyck@intel.com>

On architectures that have a cache line size larger than 64 Bytes we start
running into issues where the amount of headroom for the frame starts
shrinking.

The size of skb_shared_info on a system with a 64B L1 cache line size is
320.  This increases to 384 with a 128B cache line, and 512 with a 256B
cache line.

In addition the NET_SKB_PAD value increases as well consistent with the
cache line size.  As a result when we get to a 256B cache line as seen on
the s390 we end up 768 bytes used by padding and shared info leaving us
with only 1280 bytes to use for data storage.  On architectures such as
this we should default to using 3K Rx buffers out of a 8K page instead of
trying to do 1.5K buffers out of a 4K page.

To take all of this into account I have added one small check so that we
compare the max_frame to the amount of actual data we can store.  This was
already occurring for igb, but I had overlooked it for ixgbe as it doesn't
have strict limits for 82599 once we enable jumbo frames.  By adding this
check we will automatically enable 3K Rx buffers as soon as the maximum
frame size we can handle drops below the standard Ethernet MTU.

I also went through and fixed one small typo that I found where I had left
an IGB in a variable name due to a copy/paste error.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe.h      | 2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 7a951b116821..b1ecc2627a5a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -96,7 +96,7 @@
 #define IXGBE_MAX_FRAME_BUILD_SKB \
 	(SKB_WITH_OVERHEAD(IXGBE_RXBUFFER_2K) - IXGBE_SKB_PAD)
 #else
-#define IGB_MAX_FRAME_BUILD_SKB IXGBE_RXBUFFER_2K
+#define IXGBE_MAX_FRAME_BUILD_SKB IXGBE_RXBUFFER_2K
 #endif
 
 /*
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 67ab13fd163c..a7a430a7be2c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -3972,7 +3972,8 @@ static void ixgbe_set_rx_buffer_len(struct ixgbe_adapter *adapter)
 		if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED)
 			set_bit(__IXGBE_RX_3K_BUFFER, &rx_ring->state);
 
-		if (max_frame > (ETH_FRAME_LEN + ETH_FCS_LEN))
+		if ((max_frame > (ETH_FRAME_LEN + ETH_FCS_LEN)) ||
+		    (max_frame > IXGBE_MAX_FRAME_BUILD_SKB))
 			set_bit(__IXGBE_RX_3K_BUFFER, &rx_ring->state);
 #endif
 	}
-- 
2.12.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* RE: [net 2/2] ixgbe: Limit use of 2K buffers on architectures with 256B or larger cache lines
  2017-03-03  2:24 ` [net 2/2] ixgbe: Limit use of 2K buffers on architectures with 256B or larger cache lines Jeff Kirsher
@ 2017-03-03 12:24   ` David Laight
  2017-03-03 15:55     ` Duyck, Alexander H
  0 siblings, 1 reply; 6+ messages in thread
From: David Laight @ 2017-03-03 12:24 UTC (permalink / raw)
  To: 'Jeff Kirsher', davem
  Cc: Alexander Duyck, netdev, nhorman, sassmann, jogreene

From: Jeff Kirsher
> Sent: 03 March 2017 02:25
> From: Alexander Duyck <alexander.h.duyck@intel.com>
> 
> On architectures that have a cache line size larger than 64 Bytes we start
> running into issues where the amount of headroom for the frame starts
> shrinking.
> 
> The size of skb_shared_info on a system with a 64B L1 cache line size is
> 320.  This increases to 384 with a 128B cache line, and 512 with a 256B
> cache line.

Perhaps some of the CACHE_LINE_ALIGNED markers don't actually need
to force alignment with large line sizes?

I realise some things have hard requirements for cache alignment
(eg non-coherent dma), but others are just there to limit the number
of cache lines read and/or dirtied.

	David

^ permalink raw reply	[flat|nested] 6+ messages in thread

* RE: [net 2/2] ixgbe: Limit use of 2K buffers on architectures with 256B or larger cache lines
  2017-03-03 12:24   ` David Laight
@ 2017-03-03 15:55     ` Duyck, Alexander H
  0 siblings, 0 replies; 6+ messages in thread
From: Duyck, Alexander H @ 2017-03-03 15:55 UTC (permalink / raw)
  To: David Laight, Kirsher, Jeffrey T, davem
  Cc: netdev, nhorman, sassmann, jogreene

> -----Original Message-----
> From: David Laight [mailto:David.Laight@ACULAB.COM]
> Sent: Friday, March 3, 2017 4:25 AM
> To: Kirsher, Jeffrey T <jeffrey.t.kirsher@intel.com>; davem@davemloft.net
> Cc: Duyck, Alexander H <alexander.h.duyck@intel.com>;
> netdev@vger.kernel.org; nhorman@redhat.com; sassmann@redhat.com;
> jogreene@redhat.com
> Subject: RE: [net 2/2] ixgbe: Limit use of 2K buffers on architectures with 256B
> or larger cache lines
> 
> From: Jeff Kirsher
> > Sent: 03 March 2017 02:25
> > From: Alexander Duyck <alexander.h.duyck@intel.com>
> >
> > On architectures that have a cache line size larger than 64 Bytes we
> > start running into issues where the amount of headroom for the frame
> > starts shrinking.
> >
> > The size of skb_shared_info on a system with a 64B L1 cache line size
> > is 320.  This increases to 384 with a 128B cache line, and 512 with a
> > 256B cache line.
> 
> Perhaps some of the CACHE_LINE_ALIGNED markers don't actually need to
> force alignment with large line sizes?
> 
> I realise some things have hard requirements for cache alignment (eg non-
> coherent dma), but others are just there to limit the number of cache lines read
> and/or dirtied.
> 
> 	David

For our purposes I think this works well enough.  Basically we wanted to guarantee we have enough headroom for XDP.  In the case of the Mellanox drivers they are guaranteeing 256 if I recall correctly.

I have some follow-up patches for net-next that will make it so that we can just do a build-time test that will determine the padding size and allow us to always guaranteed at least NET_SKB_PAD + NET_IP_ALIGN.

- Alex

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-03-02
  2017-03-03  2:24 [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-03-02 Jeff Kirsher
  2017-03-03  2:24 ` [net 1/2] ixgbe: update the rss key on h/w, when ethtool ask for it Jeff Kirsher
  2017-03-03  2:24 ` [net 2/2] ixgbe: Limit use of 2K buffers on architectures with 256B or larger cache lines Jeff Kirsher
@ 2017-03-03 17:33 ` David Miller
  2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-03-03 17:33 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu,  2 Mar 2017 18:24:46 -0800

> This series contains fixes to ixgbe only.

Pulled, thanks Jeff.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-03-03 17:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-03  2:24 [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-03-02 Jeff Kirsher
2017-03-03  2:24 ` [net 1/2] ixgbe: update the rss key on h/w, when ethtool ask for it Jeff Kirsher
2017-03-03  2:24 ` [net 2/2] ixgbe: Limit use of 2K buffers on architectures with 256B or larger cache lines Jeff Kirsher
2017-03-03 12:24   ` David Laight
2017-03-03 15:55     ` Duyck, Alexander H
2017-03-03 17:33 ` [net 0/2][pull request] Intel Wired LAN Driver Updates 2017-03-02 David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.