net/i40e: remove virtual channel command for VLAN pvid
authorBeilei Xing <beilei.xing@intel.com>
Wed, 23 Aug 2017 08:44:34 +0000 (16:44 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 6 Oct 2017 00:49:47 +0000 (02:49 +0200)
Since there's no specific version number to distinguish
DPDK PF and Linux kernel PF, DPDK VF won't recognize if
host is DPDK PF or kernel PF. The specific virtual channel
commands for DPDK pf can be deleted.
This patch removes I40E_VIRTCHNL_OP_CFG_VLAN_PVID.

Signed-off-by: Beilei Xing <beilei.xing@intel.com>
drivers/net/i40e/i40e_ethdev_vf.c
drivers/net/i40e/i40e_pf.c
drivers/net/i40e/i40e_pf.h

index 73c315a..5bcf842 100644 (file)
@@ -119,8 +119,6 @@ static void i40evf_dev_xstats_reset(struct rte_eth_dev *dev);
 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);
@@ -209,7 +207,6 @@ static const struct eth_dev_ops i40evf_eth_dev_ops = {
        .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,
@@ -565,37 +562,6 @@ i40evf_disable_vlan_strip(struct rte_eth_dev *dev)
        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,
@@ -1632,16 +1598,10 @@ i40evf_dev_configure(struct rte_eth_dev *dev)
 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
@@ -1659,32 +1619,6 @@ 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)
-{
-       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)
 {
index fe89027..ae378ea 100644 (file)
@@ -1157,38 +1157,6 @@ i40e_pf_host_process_cmd_disable_vlan_strip(struct i40e_pf_vf *vf, bool b_op)
        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)
 {
@@ -1369,10 +1337,6 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,
                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.
         */
index 7afb7ea..8e1e9b0 100644 (file)
@@ -54,9 +54,8 @@ enum virtchnl_ops_dpdk {
         * 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. */
@@ -99,17 +98,6 @@ struct virtchnl_vlan_offload_info {
 #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,