stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	stable@vger.kernel.org, Shradha Shah <sshah@solarflare.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: [PATCH 3.14 12/23] Call efx_set_channels() before efx->type->dimension_resources()
Date: Fri, 11 Apr 2014 09:12:01 -0700	[thread overview]
Message-ID: <20140411161201.929555705@linuxfoundation.org> (raw)
In-Reply-To: <20140411161200.236939691@linuxfoundation.org>

3.14-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Daniel Pieczko <dpieczko@solarflare.com>

[ Upstream commit 52ad762b85ed7947ec9eff6b036eb985352f6874 ]

When using the "separate_tx_channels=1" module parameter, the TX queues are
initially numbered starting from the first TX-only channel number (after all the
RX-only channels).  efx_set_channels() renumbers the queues so that they are
indexed from zero.

On EF10, the TX queues need to be relabelled in this way before calling the
dimension_resources NIC type operation, otherwise the TX queue PIO buffers can be
linked to the wrong VIs when using "separate_tx_channels=1".

Added comments to explain UC/WC mappings for PIO buffers

Signed-off-by: Shradha Shah <sshah@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/net/ethernet/sfc/ef10.c |    7 +++++++
 drivers/net/ethernet/sfc/efx.c  |    3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

--- a/drivers/net/ethernet/sfc/ef10.c
+++ b/drivers/net/ethernet/sfc/ef10.c
@@ -565,10 +565,17 @@ static int efx_ef10_dimension_resources(
 	 * several of each (in fact that's the only option if host
 	 * page size is >4K).  So we may allocate some extra VIs just
 	 * for writing PIO buffers through.
+	 *
+	 * The UC mapping contains (min_vis - 1) complete VIs and the
+	 * first half of the next VI.  Then the WC mapping begins with
+	 * the second half of this last VI.
 	 */
 	uc_mem_map_size = PAGE_ALIGN((min_vis - 1) * EFX_VI_PAGE_SIZE +
 				     ER_DZ_TX_PIOBUF);
 	if (nic_data->n_piobufs) {
+		/* pio_write_vi_base rounds down to give the number of complete
+		 * VIs inside the UC mapping.
+		 */
 		pio_write_vi_base = uc_mem_map_size / EFX_VI_PAGE_SIZE;
 		wc_mem_map_size = (PAGE_ALIGN((pio_write_vi_base +
 					       nic_data->n_piobufs) *
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1603,6 +1603,8 @@ static int efx_probe_nic(struct efx_nic
 	if (rc)
 		goto fail1;
 
+	efx_set_channels(efx);
+
 	rc = efx->type->dimension_resources(efx);
 	if (rc)
 		goto fail2;
@@ -1613,7 +1615,6 @@ static int efx_probe_nic(struct efx_nic
 		efx->rx_indir_table[i] =
 			ethtool_rxfh_indir_default(i, efx->rss_spread);
 
-	efx_set_channels(efx);
 	netif_set_real_num_tx_queues(efx->net_dev, efx->n_tx_channels);
 	netif_set_real_num_rx_queues(efx->net_dev, efx->n_rx_channels);
 



  parent reply	other threads:[~2014-04-11 16:12 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11 16:11 [PATCH 3.14 00/23] 3.14.1-stable review Greg Kroah-Hartman
2014-04-11 16:11 ` [PATCH 3.14 01/23] Revert "ALSA: hda - Increment default stream numbers for AMD HDMI controllers" Greg Kroah-Hartman
2014-04-11 16:11 ` [PATCH 3.14 02/23] selinux: correctly label /proc inodes in use before the policy is loaded Greg Kroah-Hartman
2014-04-11 16:11 ` [PATCH 3.14 03/23] x86, pageattr: Export page unmapping interface Greg Kroah-Hartman
2014-04-11 16:11 ` [PATCH 3.14 04/23] x86/efi: Make efi virtual runtime map passing more robust Greg Kroah-Hartman
2014-04-11 16:11 ` [PATCH 3.14 05/23] futex: avoid race between requeue and wake Greg Kroah-Hartman
2014-04-11 16:11 ` [PATCH 3.14 06/23] xen-netback: remove pointless clause from if statement Greg Kroah-Hartman
2014-04-11 16:11 ` [PATCH 3.14 07/23] xen-netback: worse-case estimate in xenvif_rx_action is underestimating Greg Kroah-Hartman
2014-04-11 16:11 ` [PATCH 3.14 08/23] xen-netback: BUG_ON in xenvif_rx_action() not catching overflow Greg Kroah-Hartman
2014-04-11 16:11 ` [PATCH 3.14 09/23] ipv6: some ipv6 statistic counters failed to disable bh Greg Kroah-Hartman
2014-04-11 16:11 ` [PATCH 3.14 10/23] netlink: dont compare the nul-termination in nla_strcmp Greg Kroah-Hartman
2014-04-11 16:12 ` [PATCH 3.14 11/23] xen-netback: disable rogue vif in kthread context Greg Kroah-Hartman
2014-04-11 16:12 ` Greg Kroah-Hartman [this message]
2014-04-11 16:12 ` [PATCH 3.14 13/23] net: vxlan: fix crash when interface is created with no group Greg Kroah-Hartman
2014-04-11 16:12 ` [PATCH 3.14 14/23] isdnloop: Validate NUL-terminated strings from user Greg Kroah-Hartman
2014-04-11 16:12 ` [PATCH 3.14 15/23] isdnloop: several buffer overflows Greg Kroah-Hartman
2014-04-11 16:12 ` [PATCH 3.14 16/23] rds: prevent dereference of a NULL device in rds_iw_laddr_check Greg Kroah-Hartman
2014-04-11 16:12 ` [PATCH 3.14 17/23] net/at91_ether: avoid NULL pointer dereference Greg Kroah-Hartman
2014-04-11 16:12 ` [PATCH 3.14 18/23] iwlwifi: mvm: rs: fix search cycle rules Greg Kroah-Hartman
2014-04-11 16:12 ` [PATCH 3.14 19/23] ARC: [nsimosci] Change .dts to use generic 8250 UART Greg Kroah-Hartman
2014-04-11 16:12 ` [PATCH 3.14 20/23] ARC: [nsimosci] Unbork console Greg Kroah-Hartman
2014-04-11 16:12 ` [PATCH 3.14 21/23] futex: Allow architectures to skip futex_atomic_cmpxchg_inatomic() test Greg Kroah-Hartman
2014-04-11 16:12 ` [PATCH 3.14 22/23] m68k: Skip " Greg Kroah-Hartman
2014-04-11 16:12 ` [PATCH 3.14 23/23] crypto: ghash-clmulni-intel - use C implementation for setkey() Greg Kroah-Hartman
2014-04-11 21:49 ` [PATCH 3.14 00/23] 3.14.1-stable review Guenter Roeck
2014-04-12  1:58   ` Greg Kroah-Hartman
2014-04-11 23:46 ` Shuah Khan
2014-04-12  1:59   ` Greg Kroah-Hartman
2014-04-12  5:38   ` Satoru Takeuchi
2014-04-12 15:22     ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140411161201.929555705@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sshah@solarflare.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).