static int i40evf_vlan_filter_set(struct rte_eth_dev *dev,
uint16_t vlan_id, int on);
static void i40evf_vlan_offload_set(struct rte_eth_dev *dev, int mask);
-static int i40evf_vlan_pvid_set(struct rte_eth_dev *dev, uint16_t pvid,
- int on);
static void i40evf_dev_close(struct rte_eth_dev *dev);
static int i40evf_dev_reset(struct rte_eth_dev *dev);
static void i40evf_dev_promiscuous_enable(struct rte_eth_dev *dev);
.dev_supported_ptypes_get = i40e_dev_supported_ptypes_get,
.vlan_filter_set = i40evf_vlan_filter_set,
.vlan_offload_set = i40evf_vlan_offload_set,
- .vlan_pvid_set = i40evf_vlan_pvid_set,
.rx_queue_start = i40evf_dev_rx_queue_start,
.rx_queue_stop = i40evf_dev_rx_queue_stop,
.tx_queue_start = i40evf_dev_tx_queue_start,
return ret;
}
-static int
-i40evf_config_vlan_pvid(struct rte_eth_dev *dev,
- struct i40e_vsi_vlan_pvid_info *info)
-{
- struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
- int err;
- struct vf_cmd_info args;
- struct virtchnl_pvid_info tpid_info;
-
- if (info == NULL) {
- PMD_DRV_LOG(ERR, "invalid parameters");
- return I40E_ERR_PARAM;
- }
-
- memset(&tpid_info, 0, sizeof(tpid_info));
- tpid_info.vsi_id = vf->vsi_res->vsi_id;
- (void)rte_memcpy(&tpid_info.info, info, sizeof(*info));
-
- args.ops = (enum virtchnl_ops)I40E_VIRTCHNL_OP_CFG_VLAN_PVID;
- args.in_args = (uint8_t *)&tpid_info;
- args.in_args_size = sizeof(tpid_info);
- args.out_buffer = vf->aq_resp;
- args.out_size = I40E_AQ_BUF_SZ;
-
- err = i40evf_execute_vf_cmd(dev, &args);
- if (err)
- PMD_DRV_LOG(ERR, "fail to execute command CFG_VLAN_PVID");
-
- return err;
-}
-
static void
i40evf_fill_virtchnl_vsi_txq_info(struct virtchnl_txq_info *txq_info,
uint16_t vsi_id,
static int
i40evf_init_vlan(struct rte_eth_dev *dev)
{
- struct rte_eth_dev_data *data = dev->data;
- int ret;
-
/* Apply vlan offload setting */
i40evf_vlan_offload_set(dev, ETH_VLAN_STRIP_MASK);
- /* Apply pvid setting */
- ret = i40evf_vlan_pvid_set(dev, data->dev_conf.txmode.pvid,
- data->dev_conf.txmode.hw_vlan_insert_pvid);
- return ret;
+ return I40E_SUCCESS;
}
static void
}
}
-static int
-i40evf_vlan_pvid_set(struct rte_eth_dev *dev, uint16_t pvid, int on)
-{
- struct rte_eth_conf *dev_conf = &dev->data->dev_conf;
- struct i40e_vsi_vlan_pvid_info info;
- struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
-
- memset(&info, 0, sizeof(info));
- info.on = on;
-
- /* Linux pf host don't support vlan offload yet */
- if (vf->version_major == I40E_DPDK_VERSION_MAJOR) {
- if (info.on)
- info.config.pvid = pvid;
- else {
- info.config.reject.tagged =
- dev_conf->txmode.hw_vlan_reject_tagged;
- info.config.reject.untagged =
- dev_conf->txmode.hw_vlan_reject_untagged;
- }
- return i40evf_config_vlan_pvid(dev, &info);
- }
-
- return 0;
-}
-
static int
i40evf_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)
{
return ret;
}
-static int
-i40e_pf_host_process_cmd_cfg_pvid(struct i40e_pf_vf *vf,
- uint8_t *msg,
- uint16_t msglen,
- bool b_op)
-{
- int ret = I40E_SUCCESS;
- struct virtchnl_pvid_info *tpid_info =
- (struct virtchnl_pvid_info *)msg;
-
- if (!b_op) {
- i40e_pf_host_send_msg_to_vf(
- vf,
- I40E_VIRTCHNL_OP_CFG_VLAN_PVID,
- I40E_NOT_SUPPORTED, NULL, 0);
- return ret;
- }
-
- if (msg == NULL || msglen != sizeof(*tpid_info)) {
- ret = I40E_ERR_PARAM;
- goto send_msg;
- }
-
- ret = i40e_vsi_vlan_pvid_set(vf->vsi, &tpid_info->info);
-
-send_msg:
- i40e_pf_host_send_msg_to_vf(vf, I40E_VIRTCHNL_OP_CFG_VLAN_PVID,
- ret, NULL, 0);
-
- return ret;
-}
-
void
i40e_notify_vf_link_status(struct rte_eth_dev *dev, struct i40e_pf_vf *vf)
{
PMD_DRV_LOG(INFO, "OP_DISABLE_VLAN_STRIPPING received");
i40e_pf_host_process_cmd_disable_vlan_strip(vf, b_op);
break;
- case I40E_VIRTCHNL_OP_CFG_VLAN_PVID:
- PMD_DRV_LOG(INFO, "OP_CFG_VLAN_PVID received");
- i40e_pf_host_process_cmd_cfg_pvid(vf, msg, msglen, b_op);
- break;
/* Don't add command supported below, which will
* return an error code.
*/
* Keep some gap between Linux PF commands and
* DPDK PF extended commands.
*/
- I40E_VIRTCHNL_OP_CFG_VLAN_PVID = VIRTCHNL_OP_VERSION +
- I40E_DPDK_OFFSET,
- VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT,
+ VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT = VIRTCHNL_OP_VERSION +
+ I40E_DPDK_OFFSET,
};
/* A structure to support extended info of a receive queue. */
#define I40E_VIRTCHNL_CONFIG_VSI_QUEUES_SIZE(x, n) \
(sizeof(*(x)) + sizeof((x)->qpair[0]) * (n))
-/*
- * I40E_VIRTCHNL_OP_CFG_VLAN_PVID
- * VF sends this message to enable/disable pvid. If it's
- * enable op, needs to specify the pvid. PF returns status
- * code in retval.
- */
-struct virtchnl_pvid_info {
- uint16_t vsi_id;
- struct i40e_vsi_vlan_pvid_info info;
-};
-
int i40e_pf_host_vf_reset(struct i40e_pf_vf *vf, bool do_hw_reset);
void i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,
uint16_t abs_vf_id, uint32_t opcode,