1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright 2020 Mellanox Technologies, Ltd
11 #include <rte_malloc.h>
12 #include <rte_common.h>
13 #include <rte_eal_paging.h>
15 #include <mlx5_glue.h>
16 #include <mlx5_devx_cmds.h>
17 #include <mlx5_malloc.h>
20 #include "mlx5_common_os.h"
21 #include "mlx5_rxtx.h"
22 #include "mlx5_utils.h"
23 #include "mlx5_devx.h"
26 * Modify RQ vlan stripping offload
31 * @return 0 on success, non-0 otherwise
34 mlx5_rxq_obj_modify_rq_vlan_strip(struct mlx5_rxq_obj *rxq_obj, int on)
36 struct mlx5_devx_modify_rq_attr rq_attr;
38 memset(&rq_attr, 0, sizeof(rq_attr));
39 rq_attr.rq_state = MLX5_RQC_STATE_RDY;
40 rq_attr.state = MLX5_RQC_STATE_RDY;
41 rq_attr.vsd = (on ? 0 : 1);
42 rq_attr.modify_bitmask = MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_VSD;
43 return mlx5_devx_cmd_modify_rq(rxq_obj->rq, &rq_attr);
46 struct mlx5_obj_ops devx_obj_ops = {
47 .rxq_obj_modify_vlan_strip = mlx5_rxq_obj_modify_rq_vlan_strip,