net/mlx5: fix E-Switch DV flow disabling
[dpdk.git] / drivers / net / ark / ark_ethdev.c
index d2b1cb0..76b88c6 100644 (file)
@@ -94,6 +94,8 @@ static const struct rte_pci_id pci_id_ark_map[] = {
        {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1017)},
        {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1018)},
        {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x1019)},
+       {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101e)},
+       {RTE_PCI_DEVICE(AR_VENDOR_ID, 0x101f)},
        {.vendor_id = 0, /* sentinel */ },
 };
 
@@ -125,6 +127,8 @@ ark_device_caps[] = {
                     SET_DEV_CAPS(0x1017, true),
                     SET_DEV_CAPS(0x1018, true),
                     SET_DEV_CAPS(0x1019, true),
+                    SET_DEV_CAPS(0x101e, false),
+                    SET_DEV_CAPS(0x101f, false),
                     {.device_id = 0,}
 };
 
@@ -489,6 +493,7 @@ ark_config_device(struct rte_eth_dev *dev)
         * known state
         */
        ark->start_pg = 0;
+       ark->pg_running = 0;
        ark->pg = ark_pktgen_init(ark->pktgen.v, 0, 1);
        if (ark->pg == NULL)
                return -1;
@@ -523,14 +528,6 @@ ark_config_device(struct rte_eth_dev *dev)
                mpu = RTE_PTR_ADD(mpu, ARK_MPU_QOFFSET);
        }
 
-       ark_udm_stop(ark->udm.v, 0);
-       ark_udm_configure(ark->udm.v,
-                         RTE_PKTMBUF_HEADROOM,
-                         RTE_MBUF_DEFAULT_DATAROOM,
-                         ARK_RX_WRITE_TIME_NS);
-       ark_udm_stats_reset(ark->udm.v);
-       ark_udm_stop(ark->udm.v, 0);
-
        /* TX -- DDM */
        if (ark_ddm_stop(ark->ddm.v, 1))
                ARK_PMD_LOG(ERR, "Unable to stop DDM\n");
@@ -611,18 +608,23 @@ eth_ark_dev_start(struct rte_eth_dev *dev)
        if (ark->start_pg)
                ark_pktchkr_run(ark->pc);
 
-       if (ark->start_pg && (dev->data->port_id == 0)) {
+       if (ark->start_pg && !ark->pg_running) {
                pthread_t thread;
 
                /* Delay packet generatpr start allow the hardware to be ready
                 * This is only used for sanity checking with internal generator
                 */
-               if (rte_ctrl_thread_create(&thread, "ark-delay-pg", NULL,
+               char tname[32];
+               snprintf(tname, sizeof(tname), "ark-delay-pg-%d",
+                        dev->data->port_id);
+
+               if (rte_ctrl_thread_create(&thread, tname, NULL,
                                           ark_pktgen_delay_start, ark->pg)) {
                        ARK_PMD_LOG(ERR, "Could not create pktgen "
                                    "starter thread\n");
                        return -1;
                }
+               ark->pg_running = 1;
        }
 
        if (ark->user_ext.dev_start)
@@ -651,8 +653,10 @@ eth_ark_dev_stop(struct rte_eth_dev *dev)
                       ark->user_data[dev->data->port_id]);
 
        /* Stop the packet generator */
-       if (ark->start_pg)
+       if (ark->start_pg && ark->pg_running) {
                ark_pktgen_pause(ark->pg);
+               ark->pg_running = 0;
+       }
 
        dev->rx_pkt_burst = rte_eth_pkt_burst_dummy;
        dev->tx_pkt_burst = rte_eth_pkt_burst_dummy;