From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: John Fastabend <john.fastabend@gmail.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net, nhorman@tuxdriver.com
Subject: Re: [net-next PATCH 2/2] ixgbe: deleting dfwd stations out of order can cause null ptr deref
Date: Fri, 08 Nov 2013 04:36:34 -0800 [thread overview]
Message-ID: <1383914194.2365.31.camel@jtkirshe-mobl> (raw)
In-Reply-To: <20131108085109.6935.99661.stgit@nitbit.x32>
[-- Attachment #1: Type: text/plain, Size: 1483 bytes --]
On Fri, 2013-11-08 at 00:51 -0800, John Fastabend wrote:
> The number of stations in use is kept in the num_rx_pools counter
> in the ixgbe_adapter structure. This is in turn used by the queue
> allocation scheme to determine how many queues are needed to support
> the number of pools in use with the current feature set.
>
> This works as long as the pools are added and destroyed in order
> because (num_rx_pools * queues_per_pool) is equal to the last
> queue in use by a pool. But as soon as you delete a pool out of
> order this is no longer the case. So the above multiplication
> allocates to few queues and a pool may reference a ring that has
> not been allocated/initialized.
>
> To resolve use the bit mask of in use pools to determine the final
> pool being used and allocate enough queues so that we don't
> inadvertently remove its queues.
>
> # ip link add link eth2 \
> numtxqueues 4 numrxqueues 4 txqueuelen 50 type macvlan
> # ip link set dev macvlan0 up
> # ip link add link eth2 \
> numtxqueues 4 numrxqueues 4 txqueuelen 50 type macvlan
> # ip link set dev macvlan1 up
> # for i in {0..100}; do
> ip link set dev macvlan0 down; ip link set dev macvlan0 up;
> done;
>
> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
> ---
> drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
Acked-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-11-08 12:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-08 8:50 [net-next PATCH 0/2] ixgbe: macvlan fixes John Fastabend
2013-11-08 8:50 ` [net-next PATCH 1/2] ixgbe: fix build err, num_rx_queues is only available with CONFIG_RPS John Fastabend
2013-11-08 12:29 ` Neil Horman
2013-11-08 12:35 ` Jeff Kirsher
2013-11-08 8:51 ` [net-next PATCH 2/2] ixgbe: deleting dfwd stations out of order can cause null ptr deref John Fastabend
2013-11-08 12:31 ` Neil Horman
2013-11-08 12:36 ` Jeff Kirsher [this message]
2013-11-08 12:39 ` [net-next PATCH 0/2] ixgbe: macvlan fixes Jeff Kirsher
2013-11-08 20:21 ` David Miller
2013-11-08 20:40 ` kernel network panic stack traces on ubuntu 12.04 Templin, Fred L
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=1383914194.2365.31.camel@jtkirshe-mobl \
--to=jeffrey.t.kirsher@intel.com \
--cc=davem@davemloft.net \
--cc=john.fastabend@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.com \
/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).