[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200629165301.6adb5233@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Mon, 29 Jun 2020 16:53:01 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Michael Chan <michael.chan@...adcom.com>
Cc: davem@...emloft.net, netdev@...r.kernel.org
Subject: Re: [PATCH net-next 2/8] bnxt_en: Add logical RSS indirection table
structure.
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));
Powered by blists - more mailing lists