Re: [PATCH net-next 4/6] r8152: support new chips

From: Jakub Kicinski
Date: Tue Apr 20 2021 - 14:35:01 EST


On Tue, 20 Apr 2021 07:00:39 +0000 Hayes Wang wrote:
> > > @@ -6878,7 +8942,11 @@ static int rtl8152_probe(struct usb_interface *intf,
> > > set_ethernet_addr(tp);
> > >
> > > usb_set_intfdata(intf, tp);
> > > - netif_napi_add(netdev, &tp->napi, r8152_poll, RTL8152_NAPI_WEIGHT);
> > > +
> > > + if (tp->support_2500full)
> > > + netif_napi_add(netdev, &tp->napi, r8152_poll, 256);
> >
> > why 256? We have 100G+ drivers all using 64 what's special here?
> >
> > > + else
> > > + netif_napi_add(netdev, &tp->napi, r8152_poll, 64);
>
> We test 2.5G Ethernet on some embedded platform.
> And we find 64 is not large enough, and the performance
> couldn't reach 2.5 G bits/s.

Did you manage to identify what the cause is?

NAPI will keep calling your driver if the budget was exhausted, the
only difference between 64 and 256 should be the setup cost of the
driver's internal loop. And perhaps more frequent GRO flush - what's
the CONFIG_HZ set to?