X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Flibrte_ether%2Frte_ethdev.c;h=951fb1cc4ff769b8dc9c151f78b8d2360f3890aa;hb=b75abd8907731fd76e09baa1d10e1897561eba88;hp=c3eed498190ee29792ba7850275ef5f9af6e04d4;hpb=5142945b3a72b523bb1ab664c4049b5168c0f7e3;p=dpdk.git diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index c3eed49819..951fb1cc4f 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -220,9 +220,6 @@ rte_eth_dev_create_unique_device_name(char *name, size_t size, { int ret; - if ((name == NULL) || (pci_dev == NULL)) - return -EINVAL; - ret = snprintf(name, size, "%d:%d.%d", pci_dev->addr.bus, pci_dev->addr.devid, pci_dev->addr.function); @@ -505,9 +502,6 @@ rte_eth_dev_is_detachable(uint8_t port_id) static int rte_eth_dev_attach_pdev(struct rte_pci_addr *addr, uint8_t *port_id) { - if ((addr == NULL) || (port_id == NULL)) - goto err; - /* re-construct pci_device_list */ if (rte_eal_pci_scan()) goto err; @@ -531,9 +525,6 @@ rte_eth_dev_detach_pdev(uint8_t port_id, struct rte_pci_addr *addr) struct rte_pci_addr freed_addr; struct rte_pci_addr vp; - if (addr == NULL) - goto err; - /* check whether the driver supports detach feature, or not */ if (rte_eth_dev_is_detachable(port_id)) goto err; @@ -566,9 +557,6 @@ rte_eth_dev_attach_vdev(const char *vdevargs, uint8_t *port_id) char *name = NULL, *args = NULL; int ret = -1; - if ((vdevargs == NULL) || (port_id == NULL)) - goto end; - /* parse vdevargs, then retrieve device name and args */ if (rte_eal_parse_devargs_str(vdevargs, &name, &args)) goto end; @@ -586,10 +574,8 @@ rte_eth_dev_attach_vdev(const char *vdevargs, uint8_t *port_id) ret = 0; end: - if (name) - free(name); - if (args) - free(args); + free(name); + free(args); if (ret < 0) RTE_LOG(ERR, EAL, "Driver, cannot attach the device\n"); @@ -602,9 +588,6 @@ rte_eth_dev_detach_vdev(uint8_t port_id, char *vdevname) { char name[RTE_ETH_NAME_MAX_LEN]; - if (vdevname == NULL) - goto err; - /* check whether the driver supports detach feature, or not */ if (rte_eth_dev_is_detachable(port_id)) goto err; @@ -1456,6 +1439,7 @@ rte_eth_stats_reset(uint8_t port_id) RTE_FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset); (*dev->dev_ops->stats_reset)(dev); + dev->data->rx_mbuf_alloc_failed = 0; } /* retrieve ethdev extended statistics */