net/mlx5: fix Tx metadata for multi-segment packet
[dpdk.git] / drivers / net / dpaa / dpaa_ethdev.c
index ff961e8..ba66aa2 100644 (file)
@@ -245,12 +245,15 @@ static const uint32_t *
 dpaa_supported_ptypes_get(struct rte_eth_dev *dev)
 {
        static const uint32_t ptypes[] = {
-               /*todo -= add more types */
                RTE_PTYPE_L2_ETHER,
-               RTE_PTYPE_L3_IPV4,
-               RTE_PTYPE_L3_IPV4_EXT,
-               RTE_PTYPE_L3_IPV6,
-               RTE_PTYPE_L3_IPV6_EXT,
+               RTE_PTYPE_L2_ETHER_VLAN,
+               RTE_PTYPE_L2_ETHER_ARP,
+               RTE_PTYPE_L3_IPV4_EXT_UNKNOWN,
+               RTE_PTYPE_L3_IPV6_EXT_UNKNOWN,
+               RTE_PTYPE_L4_ICMP,
+               RTE_PTYPE_L4_TCP,
+               RTE_PTYPE_L4_UDP,
+               RTE_PTYPE_L4_FRAG,
                RTE_PTYPE_L4_TCP,
                RTE_PTYPE_L4_UDP,
                RTE_PTYPE_L4_SCTP
@@ -341,8 +344,15 @@ static void dpaa_eth_dev_info(struct rte_eth_dev *dev,
        dev_info->max_vfs = 0;
        dev_info->max_vmdq_pools = ETH_16_POOLS;
        dev_info->flow_type_rss_offloads = DPAA_RSS_OFFLOAD_ALL;
-       dev_info->speed_capa = (ETH_LINK_SPEED_1G |
-                               ETH_LINK_SPEED_10G);
+
+       if (dpaa_intf->fif->mac_type == fman_mac_1g)
+               dev_info->speed_capa = ETH_LINK_SPEED_1G;
+       else if (dpaa_intf->fif->mac_type == fman_mac_10g)
+               dev_info->speed_capa = (ETH_LINK_SPEED_1G | ETH_LINK_SPEED_10G);
+       else
+               DPAA_PMD_ERR("invalid link_speed: %s, %d",
+                            dpaa_intf->name, dpaa_intf->fif->mac_type);
+
        dev_info->rx_offload_capa = dev_rx_offloads_sup |
                                        dev_rx_offloads_nodis;
        dev_info->tx_offload_capa = dev_tx_offloads_sup |
@@ -610,9 +620,9 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
                fman_if_set_bp(dpaa_intf->fif, mp->size,
                               dpaa_intf->bp_info->bpid, bp_size);
                dpaa_intf->valid = 1;
-               DPAA_PMD_INFO("if =%s - fd_offset = %d offset = %d",
-                           dpaa_intf->name, fd_offset,
-                       fman_if_get_fdoff(dpaa_intf->fif));
+               DPAA_PMD_DEBUG("if:%s fd_offset = %d offset = %d",
+                               dpaa_intf->name, fd_offset,
+                               fman_if_get_fdoff(dpaa_intf->fif));
        }
        DPAA_PMD_DEBUG("if:%s sg_on = %d, max_frm =%d", dpaa_intf->name,
                fman_if_get_sg_enable(dpaa_intf->fif),
@@ -654,8 +664,13 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,
                                "ret:%d(%s)", rxq->fqid, ret, strerror(ret));
                        return ret;
                }
-               rxq->cb.dqrr_dpdk_pull_cb = dpaa_rx_cb;
-               rxq->cb.dqrr_prepare = dpaa_rx_cb_prepare;
+               if (dpaa_svr_family == SVR_LS1043A_FAMILY) {
+                       rxq->cb.dqrr_dpdk_pull_cb = dpaa_rx_cb_no_prefetch;
+               } else {
+                       rxq->cb.dqrr_dpdk_pull_cb = dpaa_rx_cb;
+                       rxq->cb.dqrr_prepare = dpaa_rx_cb_prepare;
+               }
+
                rxq->is_static = true;
        }
        dev->data->rx_queues[queue_idx] = rxq;
@@ -690,7 +705,8 @@ dpaa_eth_eventq_attach(const struct rte_eth_dev *dev,
        struct qm_mcc_initfq opts = {0};
 
        if (dpaa_push_mode_max_queue)
-               DPAA_PMD_WARN("PUSH mode already enabled for first %d queues.\n"
+               DPAA_PMD_WARN("PUSH mode q and EVENTDEV are not compatible\n"
+                             "PUSH mode already enabled for first %d queues.\n"
                              "To disable set DPAA_PUSH_QUEUES_NUMBER to 0\n",
                              dpaa_push_mode_max_queue);
 
@@ -1210,8 +1226,12 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)
        PMD_INIT_FUNC_TRACE();
 
        /* For secondary processes, the primary has done all the work */
-       if (rte_eal_process_type() != RTE_PROC_PRIMARY)
+       if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
+               eth_dev->dev_ops = &dpaa_devops;
+               /* Plugging of UCODE burst API not supported in Secondary */
+               eth_dev->rx_pkt_burst = dpaa_eth_queue_rx;
                return 0;
+       }
 
        dpaa_device = DEV_TO_DPAA_DEVICE(eth_dev->device);
        dev_id = dpaa_device->id.dev_id;
@@ -1426,10 +1446,6 @@ dpaa_dev_uninit(struct rte_eth_dev *dev)
        rte_free(dpaa_intf->tx_queues);
        dpaa_intf->tx_queues = NULL;
 
-       /* free memory for storing MAC addresses */
-       rte_free(dev->data->mac_addrs);
-       dev->data->mac_addrs = NULL;
-
        dev->dev_ops = NULL;
        dev->rx_pkt_burst = NULL;
        dev->tx_pkt_burst = NULL;
@@ -1531,9 +1547,6 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,
                return 0;
        }
 
-       if (rte_eal_process_type() == RTE_PROC_PRIMARY)
-               rte_free(eth_dev->data->dev_private);
-
        rte_eth_dev_release_port(eth_dev);
        return diag;
 }
@@ -1548,9 +1561,6 @@ rte_dpaa_remove(struct rte_dpaa_device *dpaa_dev)
        eth_dev = dpaa_dev->eth_dev;
        dpaa_dev_uninit(eth_dev);
 
-       if (rte_eal_process_type() == RTE_PROC_PRIMARY)
-               rte_free(eth_dev->data->dev_private);
-
        rte_eth_dev_release_port(eth_dev);
 
        return 0;