>  static int
>  cpfl_dev_vport_init(struct rte_eth_dev *dev, void *init_params)
>  {
> @@ -1306,6 +1414,8 @@ cpfl_dev_vport_init(struct rte_eth_dev *dev, void 
> *init_params)
>       struct cpfl_adapter_ext *adapter = param->adapter;
>       /* for sending create vport virtchnl msg prepare */
>       struct virtchnl2_create_vport create_vport_info;
> +     struct virtchnl2_add_queue_groups p2p_queue_grps_info;
> +     uint8_t p2p_q_vc_out_info[IDPF_DFLT_MBX_BUF_SIZE] = {0};
>       int ret = 0;
> 
>       dev->dev_ops = &cpfl_eth_dev_ops;
> @@ -1340,8 +1450,28 @@ cpfl_dev_vport_init(struct rte_eth_dev *dev, void
> *init_params)
>       rte_ether_addr_copy((struct rte_ether_addr *)vport->default_mac_addr,
>                           &dev->data->mac_addrs[0]);
> 
> +     if (!adapter->base.is_rx_singleq && !adapter->base.is_tx_singleq) {
> +             memset(&p2p_queue_grps_info, 0, sizeof(p2p_queue_grps_info));
> +             ret = cpfl_p2p_q_grps_add(vport, &p2p_queue_grps_info,
> p2p_q_vc_out_info);
> +             if (ret != 0) {
> +                     PMD_INIT_LOG(ERR, "Failed to add p2p queue group.");
> +                     goto err_q_grps_add;
> +             }
> +             ret = cpfl_p2p_queue_info_init(cpfl_vport,
> +                                    (struct virtchnl2_add_queue_groups
> *)p2p_q_vc_out_info);
> +             if (ret != 0) {
> +                     PMD_INIT_LOG(ERR, "Failed to init p2p queue info.");
> +                     goto err_p2p_qinfo_init;
If it is failed to add p2p queue group, the device init will quit?
I think it should be better to continue initialization just without p2p 
capability.
> +             }
> +     }
> +
>       return 0;
> 

Reply via email to