X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=drivers%2Fnet%2Focteontx%2Focteontx_ethdev.c;h=5431b44dc01c403e1878f98fa4565d05b0ea6475;hb=ce44e50a5858241216fa1533b28a195c0f4a5fd2;hp=21e5e4fca9be739fcc0dea3db59e0196a18dbca9;hpb=179c7e893f64195c5b1f12fddf34b1921386837a;p=dpdk.git diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 21e5e4fca9..5431b44dc0 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -281,14 +281,6 @@ octeontx_dev_configure(struct rte_eth_dev *dev) return -EINVAL; } - /* KEEP_CRC offload flag is not supported by PMD - * can remove the below block when DEV_RX_OFFLOAD_CRC_STRIP removed - */ - if (rte_eth_dev_must_keep_crc(rxmode->offloads)) { - PMD_INIT_LOG(NOTICE, "can't disable hw crc strip"); - rxmode->offloads |= DEV_RX_OFFLOAD_CRC_STRIP; - } - if (!(txmode->offloads & DEV_TX_OFFLOAD_MT_LOCKFREE)) { PMD_INIT_LOG(NOTICE, "cant disable lockfree tx"); txmode->offloads |= DEV_TX_OFFLOAD_MT_LOCKFREE; @@ -353,6 +345,9 @@ octeontx_dev_close(struct rte_eth_dev *dev) rte_free(txq); } + + dev->tx_pkt_burst = NULL; + dev->rx_pkt_burst = NULL; } static int @@ -446,9 +441,6 @@ octeontx_dev_stop(struct rte_eth_dev *dev) ret); return; } - - dev->tx_pkt_burst = NULL; - dev->rx_pkt_burst = NULL; } static void @@ -1015,6 +1007,8 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, if (eth_dev == NULL) return -ENODEV; + eth_dev->dev_ops = &octeontx_dev_ops; + eth_dev->device = &dev->device; eth_dev->tx_pkt_burst = octeontx_xmit_pkts; eth_dev->rx_pkt_burst = octeontx_recv_pkts; rte_eth_dev_probing_finish(eth_dev); @@ -1139,6 +1133,11 @@ octeontx_remove(struct rte_vdev_device *dev) if (eth_dev == NULL) return -ENODEV; + if (rte_eal_process_type() != RTE_PROC_PRIMARY) { + rte_eth_dev_release_port_secondary(eth_dev); + continue; + } + nic = octeontx_pmd_priv(eth_dev); rte_event_dev_stop(nic->evdev); PMD_INIT_LOG(INFO, "Closing octeontx device %s", octtx_name); @@ -1149,6 +1148,9 @@ octeontx_remove(struct rte_vdev_device *dev) rte_event_dev_close(nic->evdev); } + if (rte_eal_process_type() != RTE_PROC_PRIMARY) + return 0; + /* Free FC resource */ octeontx_pko_fc_free(); @@ -1183,6 +1185,7 @@ octeontx_probe(struct rte_vdev_device *dev) } /* TODO: request info from primary to set up Rx and Tx */ eth_dev->dev_ops = &octeontx_dev_ops; + eth_dev->device = &dev->device; rte_eth_dev_probing_finish(eth_dev); return 0; }