ethdev: refine API to query supported packet types
[dpdk.git] / lib / librte_ether / rte_ethdev.c
index 695b475..bd54e1f 100644 (file)
@@ -892,6 +892,8 @@ rte_eth_speed_bitflag(uint32_t speed, int duplex)
                return ETH_LINK_SPEED_50G;
        case ETH_SPEED_NUM_56G:
                return ETH_LINK_SPEED_56G;
+       case ETH_SPEED_NUM_100G:
+               return ETH_LINK_SPEED_100G;
        default:
                return 0;
        }
@@ -1534,7 +1536,7 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats,
                        return xcount;
        }
 
-       if (n < count + xcount)
+       if (n < count + xcount || xstats == NULL)
                return count + xcount;
 
        /* now fill the xstats structure */
@@ -1668,8 +1670,7 @@ rte_eth_dev_get_supported_ptypes(uint8_t port_id, uint32_t ptype_mask,
 
        RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
        dev = &rte_eth_devices[port_id];
-       RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get,
-                               -ENOTSUP);
+       RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_supported_ptypes_get, 0);
        all_ptypes = (*dev->dev_ops->dev_supported_ptypes_get)(dev);
 
        if (!all_ptypes)