]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
sfc: Avoid generating over-length MC_CMD_FLUSH_RX_QUEUES request
authorBen Hutchings <bhutchings@solarflare.com>
Wed, 19 Sep 2012 01:53:34 +0000 (02:53 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Mar 2013 19:11:55 +0000 (12:11 -0700)
commit2672f1c1e7d1e5132fc102fdcb98e44320c1e65b
treea00af1e90113ff4e0285454db3201e94dd002046
parentab2c550664153268b7500355dfeab7d7f9c2de98
sfc: Avoid generating over-length MC_CMD_FLUSH_RX_QUEUES request

[ Upstream commit 450783747f42dfa3883920acfad4acdd93ce69af ]

MCDI supports requests up to 252 bytes long, which is only enough to
pass 63 RX queue IDs to MC_CMD_FLUSH_RX_QUEUES.  However a VF may have
up to 64 RX queues, and if we try to flush them all we will generate
an over-length request and BUG() in efx_mcdi_copyin().  Currently
all VF drivers limit themselves to 32 RX queues, so reducing the
limit to 63 does no harm.

Also add a BUILD_BUG_ON in efx_mcdi_flush_rxqs() so we remember to
deal with the same problem there if EFX_MAX_CHANNELS is increased.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/sfc/mcdi.c
drivers/net/ethernet/sfc/siena_sriov.c