netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net 0/3][pull request] Intel Wired LAN Driver Updates 2016-04-05
@ 2016-04-05 22:30 Jeff Kirsher
  2016-04-05 22:30 ` [net 1/3] i40e: fix errant PCIe bandwidth message Jeff Kirsher
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Jeff Kirsher @ 2016-04-05 22:30 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene, john.ronciak

This series contains updates to i40e and e1000.

Jesse fixes an issue where code was added by a previous commit but the
flag to enable it was never set.

Alex fixes the e1000 driver from grossly overestimated the descriptors
needed to transmit a frame.

The following are changes since commit eb8e97715f29a1240cdf67b0df725be27433259f:
  sctp: use list_* in sctp_list_dequeue
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-queue master

Alexander Duyck (2):
  e1000: Do not overestimate descriptor counts in Tx pre-check
  e1000: Double Tx descriptors needed check for 82544

Jesse Brandeburg (1):
  i40e: fix errant PCIe bandwidth message

 drivers/net/ethernet/intel/e1000/e1000_main.c | 21 +++++++++++++++++++--
 drivers/net/ethernet/intel/i40e/i40e_main.c   |  1 +
 2 files changed, 20 insertions(+), 2 deletions(-)

-- 
2.5.5

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

* [net 1/3] i40e: fix errant PCIe bandwidth message
  2016-04-05 22:30 [net 0/3][pull request] Intel Wired LAN Driver Updates 2016-04-05 Jeff Kirsher
@ 2016-04-05 22:30 ` Jeff Kirsher
  2016-04-05 22:30 ` [net 2/3] e1000: Do not overestimate descriptor counts in Tx pre-check Jeff Kirsher
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Jeff Kirsher @ 2016-04-05 22:30 UTC (permalink / raw)
  To: davem
  Cc: Jesse Brandeburg, netdev, nhorman, sassmann, jogreene,
	Anjali Singhai Jain, Stefan Assman, Jeff Kirsher

From: Jesse Brandeburg <jesse.brandeburg@intel.com>

There was an error introduced with commit 3fced535079a ("i40e: X722 is
on the IOSF bus and does not report the PCI bus info"), where code was
added but the enabling flag is never set.

CC: Anjali Singhai Jain <anjali.singhai@intel.com>
CC: Stefan Assman <sassman@redhat.com>
Fixes: 3fced535079a ("i40e: X722 is on the IOSF bus ...")
Reported-by: Steve Best <sbest@redhat.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/i40e/i40e_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index 6700643..3449129 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -8559,6 +8559,7 @@ static int i40e_sw_init(struct i40e_pf *pf)
 			     I40E_FLAG_OUTER_UDP_CSUM_CAPABLE |
 			     I40E_FLAG_WB_ON_ITR_CAPABLE |
 			     I40E_FLAG_MULTIPLE_TCP_UDP_RSS_PCTYPE |
+			     I40E_FLAG_NO_PCI_LINK_CHECK |
 			     I40E_FLAG_100M_SGMII_CAPABLE |
 			     I40E_FLAG_USE_SET_LLDP_MIB |
 			     I40E_FLAG_GENEVE_OFFLOAD_CAPABLE;
-- 
2.5.5

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

* [net 2/3] e1000: Do not overestimate descriptor counts in Tx pre-check
  2016-04-05 22:30 [net 0/3][pull request] Intel Wired LAN Driver Updates 2016-04-05 Jeff Kirsher
  2016-04-05 22:30 ` [net 1/3] i40e: fix errant PCIe bandwidth message Jeff Kirsher
@ 2016-04-05 22:30 ` Jeff Kirsher
  2016-04-05 22:30 ` [net 3/3] e1000: Double Tx descriptors needed check for 82544 Jeff Kirsher
  2016-04-05 23:32 ` [net 0/3][pull request] Intel Wired LAN Driver Updates 2016-04-05 David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Jeff Kirsher @ 2016-04-05 22:30 UTC (permalink / raw)
  To: davem; +Cc: Alexander Duyck, netdev, nhorman, sassmann, jogreene,
	Jeff Kirsher

From: Alexander Duyck <aduyck@mirantis.com>

The current code path is capable of grossly overestimating the number of
descriptors needed to transmit a new frame.  This specifically occurs if
the skb contains a number of 4K pages.  The issue is that the logic for
determining the descriptors needed is ((S) >> (X)) + 1.  When X is 12 it
means that we were indicating that we required 2 descriptors for each 4K
page when we only needed one.

This change corrects this by instead adding (1 << (X)) - 1 to the S value
instead of adding 1 after the fact.  This way we get an accurate descriptor
needed count as we are essentially doing a DIV_ROUNDUP().

Reported-by: Ivan Suzdal <isuzdal@mirantis.com>
Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000/e1000_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 3fc7bde..d213fb4 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -3106,7 +3106,7 @@ static int e1000_maybe_stop_tx(struct net_device *netdev,
 	return __e1000_maybe_stop_tx(netdev, size);
 }
 
-#define TXD_USE_COUNT(S, X) (((S) >> (X)) + 1)
+#define TXD_USE_COUNT(S, X) (((S) + ((1 << (X)) - 1)) >> (X))
 static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
 				    struct net_device *netdev)
 {
-- 
2.5.5

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

* [net 3/3] e1000: Double Tx descriptors needed check for 82544
  2016-04-05 22:30 [net 0/3][pull request] Intel Wired LAN Driver Updates 2016-04-05 Jeff Kirsher
  2016-04-05 22:30 ` [net 1/3] i40e: fix errant PCIe bandwidth message Jeff Kirsher
  2016-04-05 22:30 ` [net 2/3] e1000: Do not overestimate descriptor counts in Tx pre-check Jeff Kirsher
@ 2016-04-05 22:30 ` Jeff Kirsher
  2016-04-05 23:32 ` [net 0/3][pull request] Intel Wired LAN Driver Updates 2016-04-05 David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: Jeff Kirsher @ 2016-04-05 22:30 UTC (permalink / raw)
  To: davem; +Cc: Alexander Duyck, netdev, nhorman, sassmann, jogreene,
	Jeff Kirsher

From: Alexander Duyck <aduyck@mirantis.com>

The 82544 has code that adds one additional descriptor per data buffer.
However we weren't taking that into account when determining the descriptors
needed for the next transmit at the end of the xmit_frame path.

This change takes that into account by doubling the number of descriptors
needed for the 82544 so that we can avoid a potential issue where we could
hang the Tx ring by loading frames with xmit_more enabled and then stopping
the ring without writing the tail.

In addition it adds a few more descriptors to account for some additional
workarounds that have been added over time.

Signed-off-by: Alexander Duyck <aduyck@mirantis.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/e1000/e1000_main.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index d213fb4..ae90d4f 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -3256,12 +3256,29 @@ static netdev_tx_t e1000_xmit_frame(struct sk_buff *skb,
 			     nr_frags, mss);
 
 	if (count) {
+		/* The descriptors needed is higher than other Intel drivers
+		 * due to a number of workarounds.  The breakdown is below:
+		 * Data descriptors: MAX_SKB_FRAGS + 1
+		 * Context Descriptor: 1
+		 * Keep head from touching tail: 2
+		 * Workarounds: 3
+		 */
+		int desc_needed = MAX_SKB_FRAGS + 7;
+
 		netdev_sent_queue(netdev, skb->len);
 		skb_tx_timestamp(skb);
 
 		e1000_tx_queue(adapter, tx_ring, tx_flags, count);
+
+		/* 82544 potentially requires twice as many data descriptors
+		 * in order to guarantee buffers don't end on evenly-aligned
+		 * dwords
+		 */
+		if (adapter->pcix_82544)
+			desc_needed += MAX_SKB_FRAGS + 1;
+
 		/* Make sure there is space in the ring for the next send. */
-		e1000_maybe_stop_tx(netdev, tx_ring, MAX_SKB_FRAGS + 2);
+		e1000_maybe_stop_tx(netdev, tx_ring, desc_needed);
 
 		if (!skb->xmit_more ||
 		    netif_xmit_stopped(netdev_get_tx_queue(netdev, 0))) {
-- 
2.5.5

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

* Re: [net 0/3][pull request] Intel Wired LAN Driver Updates 2016-04-05
  2016-04-05 22:30 [net 0/3][pull request] Intel Wired LAN Driver Updates 2016-04-05 Jeff Kirsher
                   ` (2 preceding siblings ...)
  2016-04-05 22:30 ` [net 3/3] e1000: Double Tx descriptors needed check for 82544 Jeff Kirsher
@ 2016-04-05 23:32 ` David Miller
  3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2016-04-05 23:32 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene, john.ronciak

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Tue,  5 Apr 2016 15:30:48 -0700

> This series contains updates to i40e and e1000.

Pulled, thanks Jeff.

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

end of thread, other threads:[~2016-04-05 23:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-05 22:30 [net 0/3][pull request] Intel Wired LAN Driver Updates 2016-04-05 Jeff Kirsher
2016-04-05 22:30 ` [net 1/3] i40e: fix errant PCIe bandwidth message Jeff Kirsher
2016-04-05 22:30 ` [net 2/3] e1000: Do not overestimate descriptor counts in Tx pre-check Jeff Kirsher
2016-04-05 22:30 ` [net 3/3] e1000: Double Tx descriptors needed check for 82544 Jeff Kirsher
2016-04-05 23:32 ` [net 0/3][pull request] Intel Wired LAN Driver Updates 2016-04-05 David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).