summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/netronome/nfp/flower/main.c
diff options
context:
space:
mode:
authorJohn Hurley <john.hurley@netronome.com>2017-12-19 19:58:27 +0300
committerDavid S. Miller <davem@davemloft.net>2017-12-19 22:52:12 +0300
commit739973486f53a4c4145d41b21ec36fefb0983f68 (patch)
tree36dd2de70fdf6eb1398dcaf721ac94ef1d1c6667 /drivers/net/ethernet/netronome/nfp/flower/main.c
parent574f1e9cccba27001d4a2c3761b78bca24977052 (diff)
downloadlinux-739973486f53a4c4145d41b21ec36fefb0983f68.tar.xz
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 <john.hurley@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/flower/main.c')
-rw-r--r--drivers/net/ethernet/netronome/nfp/flower/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/flower/main.c b/drivers/net/ethernet/netronome/nfp/flower/main.c
index 8fcc90c0d2d3..63160e9754d4 100644
--- a/drivers/net/ethernet/netronome/nfp/flower/main.c
+++ b/drivers/net/ethernet/netronome/nfp/flower/main.c
@@ -381,7 +381,7 @@ static int nfp_flower_init(struct nfp_app *app)
{
const struct nfp_pf *pf = app->pf;
struct nfp_flower_priv *app_priv;
- u64 version;
+ u64 version, features;
int err;
if (!pf->eth_tbl) {
@@ -424,6 +424,14 @@ static int nfp_flower_init(struct nfp_app *app)
if (err)
goto err_free_app_priv;
+ /* Extract the extra features supported by the firmware. */
+ features = nfp_rtsym_read_le(app->pf->rtbl,
+ "_abi_flower_extra_features", &err);
+ if (err)
+ app_priv->flower_ext_feats = 0;
+ else
+ app_priv->flower_ext_feats = features;
+
return 0;
err_free_app_priv: