net/i40e: remove virtual channel command for VSI queue
authorBeilei Xing <beilei.xing@intel.com>
Wed, 23 Aug 2017 08:44:35 +0000 (16:44 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 6 Oct 2017 00:49:47 +0000 (02:49 +0200)
This patch removes specific virtual channel command
VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT.

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 5bcf842..7c2fc85 100644 (file)
@@ -597,7 +597,6 @@ i40evf_fill_virtchnl_vsi_rxq_info(struct virtchnl_rxq_info *rxq_info,
        }
 }
 
-/* It configures VSI queues to co-work with Linux PF host */
 static int
 i40evf_configure_vsi_queues(struct rte_eth_dev *dev)
 {
@@ -641,72 +640,6 @@ i40evf_configure_vsi_queues(struct rte_eth_dev *dev)
        return ret;
 }
 
-/* It configures VSI queues to co-work with DPDK PF host */
-static int
-i40evf_configure_vsi_queues_ext(struct rte_eth_dev *dev)
-{
-       struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
-       struct i40e_rx_queue **rxq =
-               (struct i40e_rx_queue **)dev->data->rx_queues;
-       struct i40e_tx_queue **txq =
-               (struct i40e_tx_queue **)dev->data->tx_queues;
-       struct virtchnl_vsi_queue_config_ext_info *vc_vqcei;
-       struct virtchnl_queue_pair_ext_info *vc_qpei;
-       struct vf_cmd_info args;
-       uint16_t i, nb_qp = vf->num_queue_pairs;
-       const uint32_t size =
-               I40E_VIRTCHNL_CONFIG_VSI_QUEUES_SIZE(vc_vqcei, nb_qp);
-       uint8_t buff[size];
-       int ret;
-
-       memset(buff, 0, sizeof(buff));
-       vc_vqcei = (struct virtchnl_vsi_queue_config_ext_info *)buff;
-       vc_vqcei->vsi_id = vf->vsi_res->vsi_id;
-       vc_vqcei->num_queue_pairs = nb_qp;
-       vc_qpei = vc_vqcei->qpair;
-       for (i = 0; i < nb_qp; i++, vc_qpei++) {
-               i40evf_fill_virtchnl_vsi_txq_info(&vc_qpei->txq,
-                       vc_vqcei->vsi_id, i, dev->data->nb_tx_queues, txq[i]);
-               i40evf_fill_virtchnl_vsi_rxq_info(&vc_qpei->rxq,
-                       vc_vqcei->vsi_id, i, dev->data->nb_rx_queues,
-                                       vf->max_pkt_len, rxq[i]);
-               if (i < dev->data->nb_rx_queues)
-                       /*
-                        * It adds extra info for configuring VSI queues, which
-                        * is needed to enable the configurable crc stripping
-                        * in VF.
-                        */
-                       vc_qpei->rxq_ext.crcstrip =
-                               dev->data->dev_conf.rxmode.hw_strip_crc;
-       }
-       memset(&args, 0, sizeof(args));
-       args.ops =
-               (enum virtchnl_ops)VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT;
-       args.in_args = (uint8_t *)vc_vqcei;
-       args.in_args_size = size;
-       args.out_buffer = vf->aq_resp;
-       args.out_size = I40E_AQ_BUF_SZ;
-       ret = i40evf_execute_vf_cmd(dev, &args);
-       if (ret)
-               PMD_DRV_LOG(ERR, "Failed to execute command of "
-                       "VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT");
-
-       return ret;
-}
-
-static int
-i40evf_configure_queues(struct rte_eth_dev *dev)
-{
-       struct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);
-
-       if (vf->version_major == I40E_DPDK_VERSION_MAJOR)
-               /* To support DPDK PF host */
-               return i40evf_configure_vsi_queues_ext(dev);
-       else
-               /* To support Linux PF host */
-               return i40evf_configure_vsi_queues(dev);
-}
-
 static int
 i40evf_config_irq_map(struct rte_eth_dev *dev)
 {
@@ -2060,7 +1993,7 @@ i40evf_dev_start(struct rte_eth_dev *dev)
 
        i40evf_tx_init(dev);
 
-       if (i40evf_configure_queues(dev) != 0) {
+       if (i40evf_configure_vsi_queues(dev) != 0) {
                PMD_DRV_LOG(ERR, "configure queues failed");
                goto err_queue;
        }
index ae378ea..cf8b094 100644 (file)
@@ -538,73 +538,6 @@ send_msg:
        return ret;
 }
 
-static int
-i40e_pf_host_process_cmd_config_vsi_queues_ext(struct i40e_pf_vf *vf,
-                                              uint8_t *msg,
-                                              uint16_t msglen,
-                                              bool b_op)
-{
-       struct i40e_hw *hw = I40E_PF_TO_HW(vf->pf);
-       struct i40e_vsi *vsi = vf->vsi;
-       struct virtchnl_vsi_queue_config_ext_info *vc_vqcei =
-               (struct virtchnl_vsi_queue_config_ext_info *)msg;
-       struct virtchnl_queue_pair_ext_info *vc_qpei;
-       int i, ret = I40E_SUCCESS;
-
-       if (!b_op) {
-               i40e_pf_host_send_msg_to_vf(
-                       vf,
-                       VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT,
-                       I40E_NOT_SUPPORTED, NULL, 0);
-               return ret;
-       }
-
-       if (!msg || vc_vqcei->num_queue_pairs > vsi->nb_qps ||
-               vc_vqcei->num_queue_pairs > I40E_MAX_VSI_QP ||
-               msglen < I40E_VIRTCHNL_CONFIG_VSI_QUEUES_SIZE(vc_vqcei,
-                                       vc_vqcei->num_queue_pairs)) {
-               PMD_DRV_LOG(ERR, "vsi_queue_config_ext_info argument wrong");
-               ret = I40E_ERR_PARAM;
-               goto send_msg;
-       }
-
-       vc_qpei = vc_vqcei->qpair;
-       for (i = 0; i < vc_vqcei->num_queue_pairs; i++) {
-               if (vc_qpei[i].rxq.queue_id > vsi->nb_qps - 1 ||
-                       vc_qpei[i].txq.queue_id > vsi->nb_qps - 1) {
-                       ret = I40E_ERR_PARAM;
-                       goto send_msg;
-               }
-               /*
-                * Apply VF RX queue setting to HMC.
-                * If the opcode is VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT,
-                * then the extra information of
-                * 'struct virtchnl_queue_pair_ext_info' is needed,
-                * otherwise set the last parameter to NULL.
-                */
-               if (i40e_pf_host_hmc_config_rxq(hw, vf, &vc_qpei[i].rxq,
-                       vc_qpei[i].rxq_ext.crcstrip) != I40E_SUCCESS) {
-                       PMD_DRV_LOG(ERR, "Configure RX queue HMC failed");
-                       ret = I40E_ERR_PARAM;
-                       goto send_msg;
-               }
-
-               /* Apply VF TX queue setting to HMC */
-               if (i40e_pf_host_hmc_config_txq(hw, vf, &vc_qpei[i].txq) !=
-                                                       I40E_SUCCESS) {
-                       PMD_DRV_LOG(ERR, "Configure TX queue HMC failed");
-                       ret = I40E_ERR_PARAM;
-                       goto send_msg;
-               }
-       }
-
-send_msg:
-       i40e_pf_host_send_msg_to_vf(vf, VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT,
-                                                               ret, NULL, 0);
-
-       return ret;
-}
-
 static void
 i40e_pf_config_irq_link_list(struct i40e_pf_vf *vf,
                              struct virtchnl_vector_map *vvm)
@@ -1278,11 +1211,6 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,
                i40e_pf_host_process_cmd_config_vsi_queues(vf, msg,
                                                           msglen, b_op);
                break;
-       case VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT:
-               PMD_DRV_LOG(INFO, "OP_CONFIG_VSI_QUEUES_EXT received");
-               i40e_pf_host_process_cmd_config_vsi_queues_ext(vf, msg,
-                                                              msglen, b_op);
-               break;
        case VIRTCHNL_OP_CONFIG_IRQ_MAP:
                PMD_DRV_LOG(INFO, "OP_CONFIG_IRQ_MAP received");
                i40e_pf_host_process_cmd_config_irq_map(vf, msg, msglen, b_op);
index 8e1e9b0..13e80f7 100644 (file)
 /* Default setting on number of VSIs that VF can contain */
 #define I40E_DEFAULT_VF_VSI_NUM 1
 
-#define I40E_DPDK_OFFSET  0x100
-
-/* DPDK pf driver specific command to VF */
-enum virtchnl_ops_dpdk {
-       /*
-        * Keep some gap between Linux PF commands and
-        * DPDK PF extended commands.
-        */
-       VIRTCHNL_OP_CONFIG_VSI_QUEUES_EXT = VIRTCHNL_OP_VERSION +
-                                           I40E_DPDK_OFFSET,
-};
-
-/* A structure to support extended info of a receive queue. */
-struct virtchnl_rxq_ext_info {
-       uint8_t crcstrip;
-};
-
-/*
- * A structure to support extended info of queue pairs, an additional field
- * is added, comparing to original 'struct virtchnl_queue_pair_info'.
- */
-struct virtchnl_queue_pair_ext_info {
-       /* vsi_id and queue_id should be identical for both rx and tx queues.*/
-       struct virtchnl_txq_info txq;
-       struct virtchnl_rxq_info rxq;
-       struct virtchnl_rxq_ext_info rxq_ext;
-};
-
-/*
- * A structure to support extended info of VSI queue pairs,
- * 'struct virtchnl_queue_pair_ext_info' is used, see its original
- * of 'struct virtchnl_queue_pair_info'.
- */
-struct virtchnl_vsi_queue_config_ext_info {
-       uint16_t vsi_id;
-       uint16_t num_queue_pairs;
-       struct virtchnl_queue_pair_ext_info qpair[0];
-};
-
 struct virtchnl_vlan_offload_info {
        uint16_t vsi_id;
        uint8_t enable_vlan_strip;