All of lore.kernel.org
 help / color / mirror / Atom feed
* Pull request: sfc 2013-03-06
@ 2013-03-06 19:14 Ben Hutchings
  2013-03-06 19:28 ` [PATCH net 1/2] sfc: Disable soft interrupt handling during efx_device_detach_sync() Ben Hutchings
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ben Hutchings @ 2013-03-06 19:14 UTC (permalink / raw)
  To: David Miller; +Cc: linux-net-drivers, scrum-linux, netdev

The following changes since commit aab2b4bf224ef8358d262f95b568b8ad0cecf0a0:

  tcp: fix double-counted receiver RTT when leaving receiver fast path (2013-03-04 14:12:07 -0500)

are available in the git repository at:
  git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc.git sfc-3.9

Fix regressions introduced by the last set of fixes (sorry):

1. Potential deadlock when disabling TX queues.
2. RX was broken on architectures other than x86 and powerpc.

I still expect to send one more bug fix for 3.9, but as it sometimes
takes days to reproduce the bug it's going to take a couple of weeks of
testing to be confident that it's really fixed.

Ben.

Ben Hutchings (2):
      sfc: Disable soft interrupt handling during efx_device_detach_sync()
      sfc: Correct efx_rx_buffer::page_offset when EFX_PAGE_IP_ALIGN != 0

 drivers/net/ethernet/sfc/efx.h |    4 ++--
 drivers/net/ethernet/sfc/rx.c  |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

-- 
Ben Hutchings, Staff Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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

* [PATCH net 1/2] sfc: Disable soft interrupt handling during efx_device_detach_sync()
  2013-03-06 19:14 Pull request: sfc 2013-03-06 Ben Hutchings
@ 2013-03-06 19:28 ` Ben Hutchings
  2013-03-06 19:29 ` [PATCH net 2/2] sfc: Correct efx_rx_buffer::page_offset when EFX_PAGE_IP_ALIGN != 0 Ben Hutchings
  2013-03-06 19:51 ` Pull request: sfc 2013-03-06 David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Ben Hutchings @ 2013-03-06 19:28 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers, scrum-linux

efx_device_detach_sync() locks all TX queues before marking the device
detached and thus disabling further TX scheduling.  But it can still
be interrupted by TX completions which then result in TX scheduling in
soft interrupt context.  This will deadlock when it tries to acquire
a TX queue lock that efx_device_detach_sync() already acquired.

To avoid deadlock, we must use netif_tx_{,un}lock_bh().

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/ethernet/sfc/efx.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h
index 50247df..d2f790d 100644
--- a/drivers/net/ethernet/sfc/efx.h
+++ b/drivers/net/ethernet/sfc/efx.h
@@ -171,9 +171,9 @@ static inline void efx_device_detach_sync(struct efx_nic *efx)
 	 * TX scheduler is stopped when we're done and before
 	 * netif_device_present() becomes false.
 	 */
-	netif_tx_lock(dev);
+	netif_tx_lock_bh(dev);
 	netif_device_detach(dev);
-	netif_tx_unlock(dev);
+	netif_tx_unlock_bh(dev);
 }
 
 #endif /* EFX_EFX_H */
-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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

* [PATCH net 2/2] sfc: Correct efx_rx_buffer::page_offset when EFX_PAGE_IP_ALIGN != 0
  2013-03-06 19:14 Pull request: sfc 2013-03-06 Ben Hutchings
  2013-03-06 19:28 ` [PATCH net 1/2] sfc: Disable soft interrupt handling during efx_device_detach_sync() Ben Hutchings
@ 2013-03-06 19:29 ` Ben Hutchings
  2013-03-06 19:51 ` Pull request: sfc 2013-03-06 David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Ben Hutchings @ 2013-03-06 19:29 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-net-drivers, scrum-linux

RX DMA buffers start at an offset of EFX_PAGE_IP_ALIGN bytes from the
start of a cache line.  This offset obviously needs to be included in
the virtual address, but this was missed in commit b590ace09d51
('sfc: Fix efx_rx_buf_offset() in the presence of swiotlb') since
EFX_PAGE_IP_ALIGN is equal to 0 on both x86 and powerpc.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/net/ethernet/sfc/rx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index 879ff58..bb579a6 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -215,7 +215,7 @@ static int efx_init_rx_buffers_page(struct efx_rx_queue *rx_queue)
 		rx_buf = efx_rx_buffer(rx_queue, index);
 		rx_buf->dma_addr = dma_addr + EFX_PAGE_IP_ALIGN;
 		rx_buf->u.page = page;
-		rx_buf->page_offset = page_offset;
+		rx_buf->page_offset = page_offset + EFX_PAGE_IP_ALIGN;
 		rx_buf->len = efx->rx_buffer_len - EFX_PAGE_IP_ALIGN;
 		rx_buf->flags = EFX_RX_BUF_PAGE;
 		++rx_queue->added_count;
-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

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

* Re: Pull request: sfc 2013-03-06
  2013-03-06 19:14 Pull request: sfc 2013-03-06 Ben Hutchings
  2013-03-06 19:28 ` [PATCH net 1/2] sfc: Disable soft interrupt handling during efx_device_detach_sync() Ben Hutchings
  2013-03-06 19:29 ` [PATCH net 2/2] sfc: Correct efx_rx_buffer::page_offset when EFX_PAGE_IP_ALIGN != 0 Ben Hutchings
@ 2013-03-06 19:51 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2013-03-06 19:51 UTC (permalink / raw)
  To: bhutchings; +Cc: linux-net-drivers, scrum-linux, netdev

From: Ben Hutchings <bhutchings@solarflare.com>
Date: Wed, 6 Mar 2013 19:14:21 +0000

> The following changes since commit aab2b4bf224ef8358d262f95b568b8ad0cecf0a0:
> 
>   tcp: fix double-counted receiver RTT when leaving receiver fast path (2013-03-04 14:12:07 -0500)
> 
> are available in the git repository at:
>   git://git.kernel.org/pub/scm/linux/kernel/git/bwh/sfc.git sfc-3.9
> 
> Fix regressions introduced by the last set of fixes (sorry):
> 
> 1. Potential deadlock when disabling TX queues.
> 2. RX was broken on architectures other than x86 and powerpc.
> 
> I still expect to send one more bug fix for 3.9, but as it sometimes
> takes days to reproduce the bug it's going to take a couple of weeks of
> testing to be confident that it's really fixed.

Pulled, thanks Ben.

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

end of thread, other threads:[~2013-03-06 19:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-06 19:14 Pull request: sfc 2013-03-06 Ben Hutchings
2013-03-06 19:28 ` [PATCH net 1/2] sfc: Disable soft interrupt handling during efx_device_detach_sync() Ben Hutchings
2013-03-06 19:29 ` [PATCH net 2/2] sfc: Correct efx_rx_buffer::page_offset when EFX_PAGE_IP_ALIGN != 0 Ben Hutchings
2013-03-06 19:51 ` Pull request: sfc 2013-03-06 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.