Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Martin Habets <habetsm.xilinx@gmail.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "Íñigo Huguet" <ihuguet@redhat.com>,
	davem@davemloft.net, ecree.xilinx@gmail.com,
	netdev@vger.kernel.org, dinang@xilinx.com
Subject: Re: [PATCH net-next] sfc: The size of the RX recycle ring should be more flexible
Date: Wed, 12 Jan 2022 09:08:43 +0000	[thread overview]
Message-ID: <20220112090843.qm27ofgtdz7ouuxw@gmail.com> (raw)
In-Reply-To: <20220110092224.5a8ecddf@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>

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

  reply	other threads:[~2022-01-12  9:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-18 15:14 Bad performance in RX with sfc 40G Íñigo Huguet
2021-11-18 17:19 ` Eric Dumazet
2021-12-02 14:26   ` Íñigo Huguet
2021-11-20  8:31 ` Martin Habets
2021-12-09 12:06   ` Íñigo Huguet
2021-12-23 13:18     ` Íñigo Huguet
2022-01-02  9:22       ` Martin Habets
2022-01-10  8:58         ` [PATCH net-next] sfc: The size of the RX recycle ring should be more flexible Martin Habets
2022-01-10  9:31           ` Íñigo Huguet
2022-01-12  9:05             ` Martin Habets
2022-01-31 11:08             ` Martin Habets
2022-01-10 17:22           ` Jakub Kicinski
2022-01-12  9:08             ` Martin Habets [this message]
2022-01-31 11:10           ` [PATCH V2 " Martin Habets
2022-02-02  5:10             ` patchwork-bot+netdevbpf

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=20220112090843.qm27ofgtdz7ouuxw@gmail.com \
    --to=habetsm.xilinx@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dinang@xilinx.com \
    --cc=ecree.xilinx@gmail.com \
    --cc=ihuguet@redhat.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --subject='Re: [PATCH net-next] sfc: The size of the RX recycle ring should be more flexible' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).