Skip to content

Commit 2f2622f

Browse files
jahurleydavem330
authored andcommitted
nfp: flower: turn on recirc and merge hint support in firmware
Write to a FW symbol to indicate that the driver supports flow merging. If this symbol does not exist then flow merging and recirculation is not supported on the FW. If support is available, add a stub to deal with FW to kernel merge hint messages. Full flow merging requires the firmware to support of flow mods. If it does not, then do not attempt to 'turn on' flow merging. Signed-off-by: John Hurley <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 47a1a22 commit 2f2622f

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,10 @@ nfp_flower_cmsg_process_one_rx(struct nfp_app *app, struct sk_buff *skb)
222222
case NFP_FLOWER_CMSG_TYPE_PORT_MOD:
223223
nfp_flower_cmsg_portmod_rx(app, skb);
224224
break;
225+
case NFP_FLOWER_CMSG_TYPE_MERGE_HINT:
226+
if (app_priv->flower_ext_feats & NFP_FL_FEATS_FLOW_MERGE)
227+
break;
228+
goto err_default;
225229
case NFP_FLOWER_CMSG_TYPE_NO_NEIGH:
226230
nfp_tunnel_request_route(app, skb);
227231
break;
@@ -235,6 +239,7 @@ nfp_flower_cmsg_process_one_rx(struct nfp_app *app, struct sk_buff *skb)
235239
}
236240
/* fall through */
237241
default:
242+
err_default:
238243
nfp_flower_cmsg_warn(app, "Cannot handle invalid repr control type %u\n",
239244
type);
240245
goto out;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ enum nfp_flower_cmsg_type_port {
407407
NFP_FLOWER_CMSG_TYPE_PORT_REIFY = 6,
408408
NFP_FLOWER_CMSG_TYPE_MAC_REPR = 7,
409409
NFP_FLOWER_CMSG_TYPE_PORT_MOD = 8,
410+
NFP_FLOWER_CMSG_TYPE_MERGE_HINT = 9,
410411
NFP_FLOWER_CMSG_TYPE_NO_NEIGH = 10,
411412
NFP_FLOWER_CMSG_TYPE_TUN_MAC = 11,
412413
NFP_FLOWER_CMSG_TYPE_ACTIVE_TUNS = 12,

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,11 +641,28 @@ static int nfp_flower_init(struct nfp_app *app)
641641
goto err_cleanup_metadata;
642642
}
643643

644+
if (app_priv->flower_ext_feats & NFP_FL_FEATS_FLOW_MOD) {
645+
/* Tell the firmware that the driver supports flow merging. */
646+
err = nfp_rtsym_write_le(app->pf->rtbl,
647+
"_abi_flower_merge_hint_enable", 1);
648+
if (!err)
649+
app_priv->flower_ext_feats |= NFP_FL_FEATS_FLOW_MERGE;
650+
else if (err == -ENOENT)
651+
nfp_warn(app->cpp, "Flow merge not supported by FW.\n");
652+
else
653+
goto err_lag_clean;
654+
} else {
655+
nfp_warn(app->cpp, "Flow mod/merge not supported by FW.\n");
656+
}
657+
644658
INIT_LIST_HEAD(&app_priv->indr_block_cb_priv);
645659
INIT_LIST_HEAD(&app_priv->non_repr_priv);
646660

647661
return 0;
648662

663+
err_lag_clean:
664+
if (app_priv->flower_ext_feats & NFP_FL_FEATS_LAG)
665+
nfp_flower_lag_cleanup(&app_priv->nfp_lag);
649666
err_cleanup_metadata:
650667
nfp_flower_metadata_cleanup(app);
651668
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
@@ -39,6 +39,8 @@ struct nfp_app;
3939
#define NFP_FL_NBI_MTU_SETTING BIT(1)
4040
#define NFP_FL_FEATS_GENEVE_OPT BIT(2)
4141
#define NFP_FL_FEATS_VLAN_PCP BIT(3)
42+
#define NFP_FL_FEATS_FLOW_MOD BIT(5)
43+
#define NFP_FL_FEATS_FLOW_MERGE BIT(30)
4244
#define NFP_FL_FEATS_LAG BIT(31)
4345

4446
struct nfp_fl_mask_id {

0 commit comments

Comments
 (0)