lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1466098806.17117.20.camel@intel.com>
Date:	Thu, 16 Jun 2016 17:40:06 +0000
From:	"Keller, Jacob E" <jacob.e.keller@...el.com>
To:	"venkateshs@...gle.com" <venkateshs@...gle.com>,
	"pabeni@...hat.com" <pabeni@...hat.com>
CC:	"hannes@...hat.com" <hannes@...hat.com>,
	"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
	"Kirsher, Jeffrey T" <jeffrey.t.kirsher@...el.com>,
	"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
	"davem@...emloft.net" <davem@...emloft.net>
Subject: Re: [PATCH net] ixgbe: napi_poll must return the work done

On Wed, 2016-06-15 at 09:34 -0700, Venkatesh Srinivas wrote:
> On Wed, Jun 15, 2016 at 6:37 AM, Paolo Abeni <pabeni@...hat.com>
> wrote:
> > 
> > Currently the function ixgbe_poll() returns 0 when it clean
> > completely
> > the rx rings, but this foul budget accounting in core code.
> > Fix this returning the actual work done, capped to weight - 1,
> > since
> > the core doesn't allow to return the full budget when the driver
> > modifies
> > the napi status
> > 
> > Signed-off-by: Paolo Abeni <pabeni@...hat.com>
> > ---
> >  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> > b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> > index 088c47c..8bebd86 100644
> > --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> > +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
> > @@ -2887,7 +2887,7 @@ int ixgbe_poll(struct napi_struct *napi, int
> > budget)
> >         if (!test_bit(__IXGBE_DOWN, &adapter->state))
> >                 ixgbe_irq_enable_queues(adapter, BIT_ULL(q_vector-
> > >v_idx));
> > 
> > -       return 0;
> > +       return min(work_done, budget - 1);
> >  }
> > 
> >  /**
> Reviewed-by: Venkatesh Srinivas <venkateshs@...gle.com>
> 
> The same bit of code appears in fm10k and i40e/i40evf. ixgb appears
> to
> correctly return work_done.
> 
> ixgbe_poll also appears to return an (minor) incorrect work_done in
> another case, BTW. It divides its
> budget between Rx rings associated with a vector. If any ring exceeds
> its share of the budget, ixgbe_poll
> claims to have consumed the full budget, even if a full budget of
> frames was not received in a single
> pass.
> 
> -- vs;

For the record, I couldn't find any documentation on this in
Documentatino/networking, or as a function header. Where would be the
best place to document the expectations of the napi core? I'd like to
submit a patch so that future it will be easier to determine what a new
driver should do (without just blindly copying from other drivers as
has caused these so far).

Thanks,
Jake

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ