X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=app%2Ftest-pmd%2Ftestpmd.c;h=3ed3523b791ea89061ca4860a1540622f0f59378;hb=6b7780bfebe4;hp=4e958bc44174a63bd3915ec8be8a27a192402111;hpb=163fbaafa29f0f5f968162700061f1009321625c;p=dpdk.git diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c index 4e958bc441..3ed3523b79 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -2383,7 +2383,7 @@ attach_port(char *identifier) return; } - if (rte_dev_probe(identifier) != 0) { + if (rte_dev_probe(identifier) < 0) { TESTPMD_LOG(ERR, "Failed to attach port %s\n", identifier); return; } @@ -2453,7 +2453,7 @@ detach_port_device(portid_t port_id) port_flow_flush(port_id); } - if (rte_dev_remove(dev) != 0) { + if (rte_dev_remove(dev) < 0) { TESTPMD_LOG(ERR, "Failed to detach device %s\n", dev->name); return; } @@ -2478,7 +2478,6 @@ detach_port_device(portid_t port_id) void pmd_test_exit(void) { - struct rte_device *device; portid_t pt_id; int ret; int i; @@ -2504,18 +2503,6 @@ pmd_test_exit(void) printf("\nShutting down port %d...\n", pt_id); fflush(stdout); close_port(pt_id); - - /* - * This is a workaround to fix a virtio-user issue that - * requires to call clean-up routine to remove existing - * socket. - * This workaround valid only for testpmd, needs a fix - * valid for all applications. - * TODO: Implement proper resource cleanup - */ - device = rte_eth_devices[pt_id].device; - if (device && !strcmp(device->driver->name, "net_virtio_user")) - detach_port_device(pt_id); } } @@ -2837,7 +2824,8 @@ rxtx_port_config(struct rte_port *port) for (qid = 0; qid < nb_rxq; qid++) { offloads = port->rx_conf[qid].offloads; port->rx_conf[qid] = port->dev_info.default_rxconf; - port->rx_conf[qid].offloads |= offloads; + if (offloads != 0) + port->rx_conf[qid].offloads = offloads; /* Check if any Rx parameters have been passed */ if (rx_pthresh != RTE_PMD_PARAM_UNSET) @@ -2861,7 +2849,8 @@ rxtx_port_config(struct rte_port *port) for (qid = 0; qid < nb_txq; qid++) { offloads = port->tx_conf[qid].offloads; port->tx_conf[qid] = port->dev_info.default_txconf; - port->tx_conf[qid].offloads |= offloads; + if (offloads != 0) + port->tx_conf[qid].offloads = offloads; /* Check if any Tx parameters have been passed */ if (tx_pthresh != RTE_PMD_PARAM_UNSET)