All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: Jarek Poplawski <jarkao2@gmail.com>,
	netdev@vger.kernel.org, davem@davemloft.net
Subject: Re: [PATCH] netpoll: fix race on poll_list resulting in garbage entry
Date: Thu, 11 Dec 2008 16:03:07 -0800	[thread overview]
Message-ID: <20081211160307.20709435@s6510> (raw)
In-Reply-To: <20081211181528.GB10558@hmsendeavour.rdu.redhat.com>

On Thu, 11 Dec 2008 13:15:28 -0500
Neil Horman <nhorman@tuxdriver.com> wrote:

> On Thu, Dec 11, 2008 at 09:01:04AM -0800, Stephen Hemminger wrote:
> > On Thu, 11 Dec 2008 13:07:28 +0000
> > Jarek Poplawski <jarkao2@gmail.com> wrote:
> > 
> > > On 09-12-2008 22:06, Neil Horman wrote:
> > > ...
> > > > When executing napi->poll from the netpoll_path, this bit will
> > > > be set. When a driver calls netif_rx_complete, if that bit is set, it will not
> > > > remove the napi_struct from the poll_list.  That work will be saved for the next
> > > > iteration of net_rx_action.
> > > 
> > > This could be not enough: some drivers, e.g. sky2, call napi_complete()
> > > directly.
> > > 
> > 
> > There is good reason for this. Although most drivers only have one NAPI
> > instance per device, and multiqueue drivers have several NAPI structures
> > per device, a few devices like sky2 need to support multiple devices
> > running off one NAPI receive. The Marvell hardware has a common receive
> > interrupt for both ports on a dual port card.
> > 
> > This kind of hardware limits usage of netpoll. Only one port can be
> > used with netpoll because netpoll makes assumptions about NAPI
> > association.
> > 
> 
> There was previously good cause to use __netif_rx_complete instead of
> netif_rx_complete some time ago when multiqueue rx was implemented using a set
> of dummy netdevices.  But with the separation of the napi code, there is no
> longer any reason for this to be done.
> 
> I just took a quick look, and it appears that sky2 is the last remaining driver
> to use the underlying napi routines.
> 
> This patch maintains exactly the same functionality that it previously had, but
> allows for the netpoll patch to be safe with respect to the per-cpu poll_lists
> used by net_rx_action.
> 
> Regards
> Neil
> 
> 
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> 
> 
>  sky2.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> 
> diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
> index 3813d15..84bdc3c 100644
> --- a/drivers/net/sky2.c
> +++ b/drivers/net/sky2.c
> @@ -2694,7 +2694,7 @@ static int sky2_poll(struct napi_struct *napi, int work_limit)
>  		sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_STOP);
>  		sky2_write8(hw, STAT_TX_TIMER_CTRL, TIM_START);
>  	}
> -	napi_complete(napi);
> +	netif_rx_complete(napi->dev, napi);
>  	sky2_read32(hw, B0_Y2_SP_LISR);
>  done:

I would ask it the other way. Why is interface an argument to netif_rx_complete
if it is never used?  

  reply	other threads:[~2008-12-12  0:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-09 21:06 [PATCH] netpoll: fix race on poll_list resulting in garbage entry Neil Horman
2008-12-10  7:22 ` David Miller
2008-12-11 13:07 ` Jarek Poplawski
2008-12-11 14:29   ` Neil Horman
2008-12-11 17:01   ` Stephen Hemminger
2008-12-11 18:15     ` Neil Horman
2008-12-12  0:03       ` Stephen Hemminger [this message]
2008-12-12 12:18         ` Neil Horman
2008-12-16 23:55           ` David Miller
2008-12-17 21:16             ` Neil Horman
2008-12-17 21:31               ` Stephen Hemminger
2008-12-17 23:44                 ` Neil Horman
2008-12-18  1:13                 ` Neil Horman
2008-12-18  3:29                   ` David Miller
2008-12-18 14:47                     ` Neil Horman
2008-12-18 19:52                     ` Neil Horman
2008-12-18 22:40                       ` Ben Hutchings
2008-12-18 23:30                         ` Johannes Berg
2008-12-19  1:25                         ` Neil Horman
2008-12-19  6:42                           ` David Miller
2008-12-19 13:42                             ` Neil Horman
2008-12-23  4:43                               ` David Miller
2008-12-18  9:04                   ` Jarek Poplawski
2008-12-12  7:07       ` Jarek Poplawski
2008-12-12 13:31         ` Neil Horman

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=20081211160307.20709435@s6510 \
    --to=shemminger@vyatta.com \
    --cc=davem@davemloft.net \
    --cc=jarkao2@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 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.