[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220112090843.qm27ofgtdz7ouuxw@gmail.com>
Date: Wed, 12 Jan 2022 09:08:43 +0000
From: Martin Habets <habetsm.xilinx@...il.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Íñigo Huguet <ihuguet@...hat.com>,
davem@...emloft.net, ecree.xilinx@...il.com,
netdev@...r.kernel.org, dinang@...inx.com
Subject: Re: [PATCH net-next] sfc: The size of the RX recycle ring should be
more flexible
On Mon, Jan 10, 2022 at 09:22:24AM -0800, Jakub Kicinski wrote:
> On Mon, 10 Jan 2022 08:58:21 +0000 Martin Habets wrote:
> > +static unsigned int efx_ef10_recycle_ring_size(const struct efx_nic *efx)
> > +{
> > + unsigned int ret;
> > +
> > + /* There is no difference between PFs and VFs. The side is based on
> > + * the maximum link speed of a given NIC.
> > + */
> > + switch (efx->pci_dev->device & 0xfff) {
> > + case 0x0903: /* Farmingdale can do up to 10G */
> > +#ifdef CONFIG_PPC64
> > + ret = 4 * EFX_RECYCLE_RING_SIZE_10G;
> > +#else
> > + ret = EFX_RECYCLE_RING_SIZE_10G;
> > +#endif
> > + break;
> > + case 0x0923: /* Greenport can do up to 40G */
> > + case 0x0a03: /* Medford can do up to 40G */
> > +#ifdef CONFIG_PPC64
> > + ret = 16 * EFX_RECYCLE_RING_SIZE_10G;
> > +#else
> > + ret = 4 * EFX_RECYCLE_RING_SIZE_10G;
> > +#endif
> > + break;
> > + default: /* Medford2 can do up to 100G */
> > + ret = 10 * EFX_RECYCLE_RING_SIZE_10G;
> > + }
> > + return ret;
> > +}
>
> Why not factor out the 4x scaling for powerpc outside of the switch?
>
> The callback could return the scaling factor but failing that:
>
> static unsigned int efx_ef10_recycle_ring_size(const struct efx_nic *efx)
> {
> unsigned int ret = EFX_RECYCLE_RING_SIZE_10G;;
>
> /* There is no difference between PFs and VFs. The side is based on
> * the maximum link speed of a given NIC.
> */
> switch (efx->pci_dev->device & 0xfff) {
> case 0x0903: /* Farmingdale can do up to 10G */
> break;
> case 0x0923: /* Greenport can do up to 40G */
> case 0x0a03: /* Medford can do up to 40G */
> ret *= 4;
> break;
> default: /* Medford2 can do up to 100G */
> ret *= 10;
> }
>
> if (IS_ENABLED(CONFIG_PPC64))
> ret *= 4;
>
> return ret;
> }
Thanks, will do.
> Other than that - net-next is closed, please switch to RFC postings
> until it opens back up once 5.17-rc1 is cut. Thanks!
I knew it had to be near closing, I even checked the weblink. ;)
Will repost when net-next is open again.
Martin
Powered by blists - more mailing lists