Commit 1a49a23c authored by Jakub Kicinski's avatar Jakub Kicinski

eth: bnxt: remove rss_ctx_bmap

Core will allocate IDs for the driver, from the range
[1, BNXT_MAX_ETH_RSS_CTX], no need to track the allocations.
Reviewed-by: default avatarPavan Chebbi <pavan.chebbi@broadcom.com>
Link: https://patch.msgid.link/20240711220713.283778-6-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 5c466b4d
......@@ -10239,7 +10239,6 @@ void bnxt_del_one_rss_ctx(struct bnxt *bp, struct bnxt_rss_ctx *rss_ctx,
kfree(rss_ctx->rss_indir_tbl);
list_del(&rss_ctx->list);
bp->num_rss_ctx--;
clear_bit(rss_ctx->index, bp->rss_ctx_bmap);
kfree(rss_ctx);
}
......@@ -10281,20 +10280,12 @@ void bnxt_clear_rss_ctxs(struct bnxt *bp, bool all)
list_for_each_entry_safe(rss_ctx, tmp, &bp->rss_ctx_list, list)
bnxt_del_one_rss_ctx(bp, rss_ctx, all);
if (all)
bitmap_free(bp->rss_ctx_bmap);
}
static void bnxt_init_multi_rss_ctx(struct bnxt *bp)
{
bp->rss_ctx_bmap = bitmap_zalloc(BNXT_RSS_CTX_BMAP_LEN, GFP_KERNEL);
if (bp->rss_ctx_bmap) {
/* burn index 0 since we cannot have context 0 */
__set_bit(0, bp->rss_ctx_bmap);
INIT_LIST_HEAD(&bp->rss_ctx_list);
bp->rss_cap |= BNXT_RSS_CAP_MULTI_RSS_CTX;
}
}
/* Allow PF, trusted VFs and VFs with default VLAN to be in promiscuous mode */
......
......@@ -1298,7 +1298,6 @@ struct bnxt_rss_ctx {
};
#define BNXT_MAX_ETH_RSS_CTX 32
#define BNXT_RSS_CTX_BMAP_LEN (BNXT_MAX_ETH_RSS_CTX + 1)
#define BNXT_VNIC_ID_INVALID 0xffffffff
struct bnxt_hw_rings {
......@@ -2332,7 +2331,6 @@ struct bnxt {
struct bnxt_ring_grp_info *grp_info;
struct bnxt_vnic_info *vnic_info;
struct list_head rss_ctx_list;
unsigned long *rss_ctx_bmap;
u32 num_rss_ctx;
int nr_vnics;
u16 *rss_indir_tbl;
......
......@@ -1902,11 +1902,6 @@ static int bnxt_create_rxfh_context(struct net_device *dev,
return -EINVAL;
}
if (test_and_set_bit(rxfh->rss_context, bp->rss_ctx_bmap)) {
NL_SET_ERR_MSG_MOD(extack, "Context ID conflict");
return -EINVAL;
}
if (!bnxt_rfs_capable(bp, true)) {
NL_SET_ERR_MSG_MOD(extack, "Out hardware resources");
return -ENOMEM;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment