net/hns3: fix return value for unsupported tuple
[dpdk.git] / drivers / net / ipn3ke / ipn3ke_ethdev.c
index e83bd92..550a8b0 100644 (file)
@@ -469,7 +469,6 @@ static int ipn3ke_vswitch_probe(struct rte_afu_device *afu_dev)
        struct ipn3ke_hw *hw;
        struct rte_eth_dev *i40e_eth;
        struct ifpga_rawdev *ifpga_dev;
-       uint16_t port_id;
        int i, j, retval;
        char *fvl_bdf;
 
@@ -483,7 +482,7 @@ static int ipn3ke_vswitch_probe(struct rte_afu_device *afu_dev)
                                        RTE_CACHE_LINE_SIZE,
                                        afu_dev->device.numa_node);
                if (!hw) {
-                       IPN3KE_AFU_PMD_ERR("failed to allocate hardwart data");
+                       IPN3KE_AFU_PMD_ERR("failed to allocate hardware data");
                                retval = -ENOMEM;
                                return -ENOMEM;
                }
@@ -519,14 +518,12 @@ static int ipn3ke_vswitch_probe(struct rte_afu_device *afu_dev)
 
                for (; j < 8; j++) {
                        fvl_bdf = ifpga_dev->fvl_bdf[j];
-                       retval = rte_eth_dev_get_port_by_name(fvl_bdf,
-                               &port_id);
-                       if (retval) {
+                       i40e_eth = rte_eth_dev_get_by_name(fvl_bdf);
+                       if (!i40e_eth) {
                                continue;
                        } else {
-                               i40e_eth = &rte_eth_devices[port_id];
                                rpst.i40e_pf_eth = i40e_eth;
-                               rpst.i40e_pf_eth_port_id = port_id;
+                               rpst.i40e_pf_eth_port_id = i40e_eth->data->port_id;
 
                                j++;
                                break;
@@ -583,4 +580,4 @@ static struct rte_afu_driver afu_ipn3ke_driver = {
 };
 
 RTE_PMD_REGISTER_AFU(net_ipn3ke_afu, afu_ipn3ke_driver);
-RTE_LOG_REGISTER(ipn3ke_afu_logtype, pmd.net.ipn3ke, NOTICE);
+RTE_LOG_REGISTER_DEFAULT(ipn3ke_afu_logtype, NOTICE);