2013-03-05 17:27:08

by Ben Hutchings

[permalink] [raw]
Subject: Re: [RFC PATCH 3/5] ixgbe: Add support for ndo_ll_poll

On Wed, 2013-02-27 at 09:56 -0800, Eliezer Tamir wrote:
> Add the ixgbe driver code implementing ndo_ll_poll.
> It should be easy for other drivers to do something similar
> in order to enable support for CONFIG_INET_LL_RX_POLL

Yes... in fact I wonder whether the lock and state couldn't be added to
napi_struct instead of being driver-specific.

[...]
> --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
[...]
> static void ixgbe_napi_disable_all(struct ixgbe_adapter *adapter)
> {
> int q_idx;
>
> - for (q_idx = 0; q_idx < adapter->num_q_vectors; q_idx++)
> + local_bh_disable(); /* for ixgbe_qv_lock_napi() */
> + for (q_idx = 0; q_idx < adapter->num_q_vectors; q_idx++) {
> napi_disable(&adapter->q_vector[q_idx]->napi);
> + while (!ixgbe_qv_lock_napi(adapter->q_vector[q_idx])) {
> + pr_info("QV %d locked\n", q_idx);
> + msleep(1);
> + }
> + }
> + local_bh_enable();
> }

Sleeping with preemption disabled?

Ben.

--
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.


2013-03-05 17:28:46

by Ben Hutchings

[permalink] [raw]
Subject: Re: [RFC PATCH 3/5] ixgbe: Add support for ndo_ll_poll

On Tue, 2013-03-05 at 17:26 +0000, Ben Hutchings wrote:
> On Wed, 2013-02-27 at 09:56 -0800, Eliezer Tamir wrote:
> > Add the ixgbe driver code implementing ndo_ll_poll.
> > It should be easy for other drivers to do something similar
> > in order to enable support for CONFIG_INET_LL_RX_POLL
>
> Yes... in fact I wonder whether the lock and state couldn't be added to
> napi_struct instead of being driver-specific.
[...]

That would potentially allow GRO to detect that it's being called in
low-latency context...

Ben.

--
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.

2013-03-05 17:36:57

by Eric Dumazet

[permalink] [raw]
Subject: Re: [RFC PATCH 3/5] ixgbe: Add support for ndo_ll_poll

On Tue, 2013-03-05 at 17:28 +0000, Ben Hutchings wrote:
> On Tue, 2013-03-05 at 17:26 +0000, Ben Hutchings wrote:
> > On Wed, 2013-02-27 at 09:56 -0800, Eliezer Tamir wrote:
> > > Add the ixgbe driver code implementing ndo_ll_poll.
> > > It should be easy for other drivers to do something similar
> > > in order to enable support for CONFIG_INET_LL_RX_POLL
> >
> > Yes... in fact I wonder whether the lock and state couldn't be added to
> > napi_struct instead of being driver-specific.
> [...]
>
> That would potentially allow GRO to detect that it's being called in
> low-latency context...

Not sure we have to add another test in fast path.

Users wanting polling support should disable GRO (ethtool -K eth0 gro
off)

Doing this dynamically would be nice of course.