Skip to content

Commit 7399734

Browse files
jahurleydavem330
authored andcommitted
nfp: flower: read extra feature support from fw
Extract the _abi_flower_extra_features symbol from the fw which gives a 64 bit bitmap of new features (on top of the flower base support) that the fw can offload. Store this bitmap in the priv data associated with each app. If the symbol does not exist, set the bitmap to 0. Signed-off-by: John Hurley <[email protected]> Reviewed-by: Jakub Kicinski <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 574f1e9 commit 7399734

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

drivers/net/ethernet/netronome/nfp/flower/main.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ static int nfp_flower_init(struct nfp_app *app)
381381
{
382382
const struct nfp_pf *pf = app->pf;
383383
struct nfp_flower_priv *app_priv;
384-
u64 version;
384+
u64 version, features;
385385
int err;
386386

387387
if (!pf->eth_tbl) {
@@ -424,6 +424,14 @@ static int nfp_flower_init(struct nfp_app *app)
424424
if (err)
425425
goto err_free_app_priv;
426426

427+
/* Extract the extra features supported by the firmware. */
428+
features = nfp_rtsym_read_le(app->pf->rtbl,
429+
"_abi_flower_extra_features", &err);
430+
if (err)
431+
app_priv->flower_ext_feats = 0;
432+
else
433+
app_priv->flower_ext_feats = features;
434+
427435
return 0;
428436

429437
err_free_app_priv:

drivers/net/ethernet/netronome/nfp/flower/main.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ struct nfp_fl_stats_id {
7777
* @nn: Pointer to vNIC
7878
* @mask_id_seed: Seed used for mask hash table
7979
* @flower_version: HW version of flower
80+
* @flower_ext_feats: Bitmap of extra features the HW supports
8081
* @stats_ids: List of free stats ids
8182
* @mask_ids: List of free mask ids
8283
* @mask_table: Hash table used to store masks
@@ -101,6 +102,7 @@ struct nfp_flower_priv {
101102
struct nfp_net *nn;
102103
u32 mask_id_seed;
103104
u64 flower_version;
105+
u64 flower_ext_feats;
104106
struct nfp_fl_stats_id stats_ids;
105107
struct nfp_fl_mask_id mask_ids;
106108
DECLARE_HASHTABLE(mask_table, NFP_FLOWER_MASK_HASH_BITS);

0 commit comments

Comments
 (0)