netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-30
@ 2014-10-30 12:33 Jeff Kirsher
  2014-10-30 12:33 ` [net 1/4] e1000: unset IFF_UNICAST_FLT on WMware 82545EM Jeff Kirsher
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Jeff Kirsher @ 2014-10-30 12:33 UTC (permalink / raw)
  To: davem; +Cc: Jeff Kirsher, netdev, nhorman, sassmann, jogreene

This series contains updates to e1000, igb and ixgbe.

Francesco Ruggeri fixes an issue with e1000 where in a VM the driver did
not support unicast filtering.

Roman Gushchin fixes an issue with igb where the driver was re-using
mapped pages so that packets were still getting dropped even if all
the memory issues are gone and there is free memory.

Junwei Zhang found where in the ixgbe_clean_rx_ring() we were repeating
the assignment of NULL to the receive buffer skb and fixes it.

Emil fixes a race condition between setup_link and SFP detection routine
in the watchdog when setting the advertised speed.

The following are changes since commit d70127e8a942364de8dd140fe73893efda363293:
  inet: frags: remove the WARN_ON from inet_evict_bucket
and are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net master

Emil Tantilov (1):
  ixgbe: fix race when setting advertised speed

Francesco Ruggeri (1):
  e1000: unset IFF_UNICAST_FLT on WMware 82545EM

Junwei Zhang (1):
  ixgbe: need not repeat init skb with NULL

Roman Gushchin (1):
  igb: don't reuse pages with pfmemalloc flag

 drivers/net/ethernet/intel/e1000/e1000_main.c    | 5 ++++-
 drivers/net/ethernet/intel/igb/igb_main.c        | 6 +++++-
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 ++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c    | 2 +-
 4 files changed, 14 insertions(+), 3 deletions(-)

-- 
1.9.3

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

* [net 1/4] e1000: unset IFF_UNICAST_FLT on WMware 82545EM
  2014-10-30 12:33 [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-30 Jeff Kirsher
@ 2014-10-30 12:33 ` Jeff Kirsher
  2014-10-30 12:33 ` [net 2/4] igb: don't reuse pages with pfmemalloc flag Jeff Kirsher
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2014-10-30 12:33 UTC (permalink / raw)
  To: davem
  Cc: Francesco Ruggeri, netdev, nhorman, sassmann, jogreene,
	Francesco Ruggeri, Jeff Kirsher

From: Francesco Ruggeri <fruggeri@aristanetworks.com>

VMWare's e1000 implementation does not seem to support unicast filtering.
This can be observed by configuring a macvlan interface on eth0 in a VM in
VMWare Fusion 5.0.5, and trying to use that interface instead of eth0.
Tested on 3.16.

Signed-off-by: Francesco Ruggeri <fruggeri@arista.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 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 5f6aded..24f3986 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -1075,7 +1075,10 @@ static int e1000_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 				  NETIF_F_HW_CSUM |
 				  NETIF_F_SG);
 
-	netdev->priv_flags |= IFF_UNICAST_FLT;
+	/* Do not set IFF_UNICAST_FLT for VMWare's 82545EM */
+	if (hw->device_id != E1000_DEV_ID_82545EM_COPPER ||
+	    hw->subsystem_vendor_id != PCI_VENDOR_ID_VMWARE)
+		netdev->priv_flags |= IFF_UNICAST_FLT;
 
 	adapter->en_mng_pt = e1000_enable_mng_pass_thru(hw);
 
-- 
1.9.3

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

* [net 2/4] igb: don't reuse pages with pfmemalloc flag
  2014-10-30 12:33 [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-30 Jeff Kirsher
  2014-10-30 12:33 ` [net 1/4] e1000: unset IFF_UNICAST_FLT on WMware 82545EM Jeff Kirsher
@ 2014-10-30 12:33 ` Jeff Kirsher
  2014-10-30 12:33 ` [net 3/4] ixgbe: need not repeat init skb with NULL Jeff Kirsher
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2014-10-30 12:33 UTC (permalink / raw)
  To: davem; +Cc: Roman Gushchin, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Roman Gushchin <klamm@yandex-team.ru>

Incoming packet is dropped silently by sk_filter(), if the skb was
allocated from pfmemalloc reserves and the corresponding socket is
not marked with the SOCK_MEMALLOC flag.

Igb driver allocates pages for DMA with __skb_alloc_page(), which
calls alloc_pages_node() with the __GFP_MEMALLOC flag. So, in case
of OOM condition, igb can get pages with pfmemalloc flag set.

If an incoming packet hits the pfmemalloc page and is large enough
(small packets are copying into the memory, allocated with
netdev_alloc_skb_ip_align(), so they are not affected), it will be
dropped.

This behavior is ok under high memory pressure, but the problem is
that the igb driver reuses these mapped pages. So, packets are still
dropping even if all memory issues are gone and there is a plenty
of free memory.

In my case, some TCP sessions hang on a small percentage (< 0.1%)
of machines days after OOMs.

Fix this by avoiding reuse of such pages.

Signed-off-by: Roman Gushchin <klamm@yandex-team.ru>
Tested-by: Aaron Brown "aaron.f.brown@intel.com"
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index a21b144..a2d72a8 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -6537,6 +6537,9 @@ static bool igb_can_reuse_rx_page(struct igb_rx_buffer *rx_buffer,
 	if (unlikely(page_to_nid(page) != numa_node_id()))
 		return false;
 
+	if (unlikely(page->pfmemalloc))
+		return false;
+
 #if (PAGE_SIZE < 8192)
 	/* if we are only owner of page we can reuse it */
 	if (unlikely(page_count(page) != 1))
@@ -6603,7 +6606,8 @@ static bool igb_add_rx_frag(struct igb_ring *rx_ring,
 		memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long)));
 
 		/* we can reuse buffer as-is, just make sure it is local */
-		if (likely(page_to_nid(page) == numa_node_id()))
+		if (likely((page_to_nid(page) == numa_node_id()) &&
+			   !page->pfmemalloc))
 			return true;
 
 		/* this page cannot be reused so discard it */
-- 
1.9.3

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

* [net 3/4] ixgbe: need not repeat init skb with NULL
  2014-10-30 12:33 [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-30 Jeff Kirsher
  2014-10-30 12:33 ` [net 1/4] e1000: unset IFF_UNICAST_FLT on WMware 82545EM Jeff Kirsher
  2014-10-30 12:33 ` [net 2/4] igb: don't reuse pages with pfmemalloc flag Jeff Kirsher
@ 2014-10-30 12:33 ` Jeff Kirsher
  2014-10-30 12:33 ` [net 4/4] ixgbe: fix race when setting advertised speed Jeff Kirsher
  2014-10-30 23:47 ` [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-30 David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2014-10-30 12:33 UTC (permalink / raw)
  To: davem
  Cc: Junwei Zhang, netdev, nhorman, sassmann, jogreene, Martin Zhang,
	Jeff Kirsher

From: Junwei Zhang <linggao.zjw@alibaba-inc.com>

Signed-off-by: Martin Zhang <martinbj2008@gmail.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index fec5212..d2df4e3 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4321,8 +4321,8 @@ static void ixgbe_clean_rx_ring(struct ixgbe_ring *rx_ring)
 				IXGBE_CB(skb)->page_released = false;
 			}
 			dev_kfree_skb(skb);
+			rx_buffer->skb = NULL;
 		}
-		rx_buffer->skb = NULL;
 		if (rx_buffer->dma)
 			dma_unmap_page(dev, rx_buffer->dma,
 				       ixgbe_rx_pg_size(rx_ring),
-- 
1.9.3

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

* [net 4/4] ixgbe: fix race when setting advertised speed
  2014-10-30 12:33 [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-30 Jeff Kirsher
                   ` (2 preceding siblings ...)
  2014-10-30 12:33 ` [net 3/4] ixgbe: need not repeat init skb with NULL Jeff Kirsher
@ 2014-10-30 12:33 ` Jeff Kirsher
  2014-10-30 23:47 ` [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-30 David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: Jeff Kirsher @ 2014-10-30 12:33 UTC (permalink / raw)
  To: davem; +Cc: Emil Tantilov, netdev, nhorman, sassmann, jogreene, Jeff Kirsher

From: Emil Tantilov <emil.s.tantilov@intel.com>

Following commands:

modprobe ixgbe
ifconfig ethX up
ethtool -s ethX advertise 0x020

can lead to "setup link failed with code -14" error due to the setup_link
call racing with the SFP detection routine in the watchdog.

This patch resolves this issue by protecting the setup_link call with check
for __IXGBE_IN_SFP_INIT.

Reported-by: Scott Harrison <scoharr2@cisco.com>
Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 3ce4a25..0ae038b 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -342,12 +342,16 @@ static int ixgbe_set_settings(struct net_device *netdev,
 		if (old == advertised)
 			return err;
 		/* this sets the link speed and restarts auto-neg */
+		while (test_and_set_bit(__IXGBE_IN_SFP_INIT, &adapter->state))
+			usleep_range(1000, 2000);
+
 		hw->mac.autotry_restart = true;
 		err = hw->mac.ops.setup_link(hw, advertised, true);
 		if (err) {
 			e_info(probe, "setup link failed with code %d\n", err);
 			hw->mac.ops.setup_link(hw, old, true);
 		}
+		clear_bit(__IXGBE_IN_SFP_INIT, &adapter->state);
 	} else {
 		/* in this case we currently only support 10Gb/FULL */
 		u32 speed = ethtool_cmd_speed(ecmd);
-- 
1.9.3

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

* Re: [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-30
  2014-10-30 12:33 [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-30 Jeff Kirsher
                   ` (3 preceding siblings ...)
  2014-10-30 12:33 ` [net 4/4] ixgbe: fix race when setting advertised speed Jeff Kirsher
@ 2014-10-30 23:47 ` David Miller
  4 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2014-10-30 23:47 UTC (permalink / raw)
  To: jeffrey.t.kirsher; +Cc: netdev, nhorman, sassmann, jogreene

From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Date: Thu, 30 Oct 2014 05:33:52 -0700

> This series contains updates to e1000, igb and ixgbe.
> 
> Francesco Ruggeri fixes an issue with e1000 where in a VM the driver did
> not support unicast filtering.
> 
> Roman Gushchin fixes an issue with igb where the driver was re-using
> mapped pages so that packets were still getting dropped even if all
> the memory issues are gone and there is free memory.
> 
> Junwei Zhang found where in the ixgbe_clean_rx_ring() we were repeating
> the assignment of NULL to the receive buffer skb and fixes it.
> 
> Emil fixes a race condition between setup_link and SFP detection routine
> in the watchdog when setting the advertised speed.

Pulled, thanks Jeff.

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

end of thread, other threads:[~2014-10-30 23:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-30 12:33 [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-30 Jeff Kirsher
2014-10-30 12:33 ` [net 1/4] e1000: unset IFF_UNICAST_FLT on WMware 82545EM Jeff Kirsher
2014-10-30 12:33 ` [net 2/4] igb: don't reuse pages with pfmemalloc flag Jeff Kirsher
2014-10-30 12:33 ` [net 3/4] ixgbe: need not repeat init skb with NULL Jeff Kirsher
2014-10-30 12:33 ` [net 4/4] ixgbe: fix race when setting advertised speed Jeff Kirsher
2014-10-30 23:47 ` [net 0/4][pull request] Intel Wired LAN Driver Updates 2014-10-30 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).