netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Michael Chan <michael.chan@broadcom.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org
Subject: Re: [PATCH net-next 2/8] bnxt_en: Add logical RSS indirection table structure.
Date: Mon, 29 Jun 2020 16:53:01 -0700	[thread overview]
Message-ID: <20200629165301.6adb5233@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> (raw)
In-Reply-To: <1593412464-503-3-git-send-email-michael.chan@broadcom.com>

On Mon, 29 Jun 2020 02:34:18 -0400 Michael Chan wrote:
> +	bp->rss_indir_tbl_entries = entries;
> +	bp->rss_indir_tbl = kcalloc(entries, sizeof(*bp->rss_indir_tbl),
> +				    GFP_KERNEL);

nit: kmalloc_array() ? I think you init all elements below.

> +	if (!bp->rss_indir_tbl)
> +		return -ENOMEM;
> +	return 0;
> +}
> +
> +static void bnxt_set_dflt_rss_indir_tbl(struct bnxt *bp)
> +{
> +	u16 max_rings, max_entries, pad, i;
> +
> +	if (!bp->rx_nr_rings)
> +		return;
> +
> +	if (BNXT_CHIP_TYPE_NITRO_A0(bp))
> +		max_rings = bp->rx_nr_rings - 1;
> +	else
> +		max_rings = bp->rx_nr_rings;
> +
> +	if (bp->flags & BNXT_FLAG_CHIP_P5)
> +		max_entries = (max_rings + BNXT_RSS_TABLE_ENTRIES_P5 - 1) &
> +			      ~(BNXT_RSS_TABLE_ENTRIES_P5 - 1);
> +	else
> +		max_entries = HW_HASH_INDEX_SIZE;
> +
> +	for (i = 0; i < max_entries; i++)
> +		bp->rss_indir_tbl[i] = i % max_rings;

nit: ethtool_rxfh_indir_default()

> +	pad = bp->rss_indir_tbl_entries - max_entries;
> +	if (pad)
> +		memset(&bp->rss_indir_tbl[i], 0, pad * sizeof(u16));

  reply	other threads:[~2020-06-29 23:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-29  6:34 [PATCH net-next 0/8] bnxt_en: Driver update for net-next Michael Chan
2020-06-29  6:34 ` [PATCH net-next 1/8] bnxt_en: Set up the chip specific RSS table size Michael Chan
2020-06-29  6:34 ` [PATCH net-next 2/8] bnxt_en: Add logical RSS indirection table structure Michael Chan
2020-06-29 23:53   ` Jakub Kicinski [this message]
2020-06-29  6:34 ` [PATCH net-next 3/8] bnxt_en: Add helper function to return the number of RSS contexts Michael Chan
2020-06-29  6:34 ` [PATCH net-next 4/8] bnxt_en: Fill HW RSS table from the RSS logical indirection table Michael Chan
2020-06-29 23:58   ` Jakub Kicinski
2020-06-30  0:42     ` Michael Chan
2020-06-29  6:34 ` [PATCH net-next 5/8] bnxt_en: Return correct RSS indirection table entries to ethtool -x Michael Chan
2020-06-29  6:34 ` [PATCH net-next 6/8] bnxt_en: Implement ethtool -X to set indirection table Michael Chan
2020-06-30  0:06   ` Jakub Kicinski
2020-06-30  0:38     ` Michael Chan
2020-06-30 19:05       ` Jakub Kicinski
2020-06-30 19:42         ` Michael Chan
2020-06-29  6:34 ` [PATCH net-next 7/8] bnxt_en: clean up VLAN feature bit handling Michael Chan
2020-06-29  6:34 ` [PATCH net-next 8/8] bnxt_en: allow firmware to disable VLAN offloads Michael Chan

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=20200629165301.6adb5233@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).