net/mlx5: add runtime parameter to enable Direct Verbs

DV flow API is based on new kernel API and is
missing some functionality like counter but add other functionality
like encap.

In order not to affect current users even if the kernel supports
the new DV API it should be enabled only manually.

Signed-off-by: Ori Kam <orika@mellanox.com>
Acked-by: Yongseok Koh <yskoh@mellanox.com>
This commit is contained in:
Ori Kam 2018-09-24 23:17:54 +00:00 committed by Ferruh Yigit
parent c4d9b9f7f3
commit 51e72d386c
4 changed files with 21 additions and 2 deletions

View File

@ -397,6 +397,13 @@ Run-time configuration
Disabled by default.
- ``dv_flow_en`` parameter [int]
A nonzero value enables the DV flow steering assuming it is supported
by the driver.
Disabled by default.
- ``representor`` parameter [list]
This parameter can be used to instantiate DPDK Ethernet devices from

View File

@ -90,6 +90,9 @@
/* Allow L3 VXLAN flow creation. */
#define MLX5_L3_VXLAN_EN "l3_vxlan_en"
/* Activate DV flow steering. */
#define MLX5_DV_FLOW_EN "dv_flow_en"
/* Activate Netlink support in VF mode. */
#define MLX5_VF_NL_EN "vf_nl_en"
@ -491,6 +494,8 @@ mlx5_args_check(const char *key, const char *val, void *opaque)
config->l3_vxlan_en = !!tmp;
} else if (strcmp(MLX5_VF_NL_EN, key) == 0) {
config->vf_nl_en = !!tmp;
} else if (strcmp(MLX5_DV_FLOW_EN, key) == 0) {
config->dv_flow_en = !!tmp;
} else {
DRV_LOG(WARNING, "%s: unknown parameter", key);
rte_errno = EINVAL;
@ -528,6 +533,7 @@ mlx5_args(struct mlx5_dev_config *config, struct rte_devargs *devargs)
MLX5_RX_VEC_EN,
MLX5_L3_VXLAN_EN,
MLX5_VF_NL_EN,
MLX5_DV_FLOW_EN,
MLX5_REPRESENTOR,
NULL,
};

View File

@ -111,6 +111,7 @@ struct mlx5_dev_config {
unsigned int mpw_hdr_dseg:1; /* Enable DSEGs in the title WQEBB. */
unsigned int l3_vxlan_en:1; /* Enable L3 VXLAN flow creation. */
unsigned int vf_nl_en:1; /* Enable Netlink requests in VF mode. */
unsigned int dv_flow_en:1; /* Enable DV flow. */
unsigned int swp:1; /* Tx generic tunnel checksum and TSO offload. */
struct {
unsigned int enabled:1; /* Whether MPRQ is enabled. */

View File

@ -2490,10 +2490,15 @@ mlx5_dev_filter_ctrl(struct rte_eth_dev *dev,
* Pointer to Ethernet device structure.
*/
void
mlx5_flow_init_driver_ops(struct rte_eth_dev *dev __rte_unused)
mlx5_flow_init_driver_ops(struct rte_eth_dev *dev)
{
struct priv *priv __rte_unused = dev->data->dev_private;
#ifdef HAVE_IBV_FLOW_DV_SUPPORT
mlx5_flow_dv_get_driver_ops(&nic_ops);
if (priv->config.dv_flow_en)
mlx5_flow_dv_get_driver_ops(&nic_ops);
else
mlx5_flow_verbs_get_driver_ops(&nic_ops);
#else
mlx5_flow_verbs_get_driver_ops(&nic_ops);
#endif