Show a patch.

GET /api/patches/73391/
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 73391,
    "url": "https://patches.dpdk.org/api/patches/73391/",
    "web_url": "https://patches.dpdk.org/patch/73391/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk"
    },
    "msgid": "<20200707092244.12791-12-hemant.agrawal@nxp.com>",
    "date": "2020-07-07T09:22:26",
    "name": "[v2,11/29] net/dpaa: update process specific device info",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "f2fd8e661e46af765a8c3612d8a072b3ae186284",
    "submitter": {
        "id": 477,
        "url": "https://patches.dpdk.org/api/people/477/",
        "name": "Hemant Agrawal",
        "email": "hemant.agrawal@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "https://patches.dpdk.org/patch/73391/mbox/",
    "series": [
        {
            "id": 10842,
            "url": "https://patches.dpdk.org/api/series/10842/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10842",
            "date": "2020-07-07T09:22:15",
            "name": "NXP DPAAx enhancements",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/10842/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73391/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/73391/checks/",
    "tags": {},
    "headers": {
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Message-Id": "<20200707092244.12791-12-hemant.agrawal@nxp.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "To": "dev@dpdk.org",
        "Cc": "ferruh.yigit@intel.com,\n\tNipun Gupta <nipun.gupta@nxp.com>",
        "X-BeenThere": "dev@dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 737EAA00BE;\n\tTue,  7 Jul 2020 11:29:00 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 08A101DD61;\n\tTue,  7 Jul 2020 11:27:17 +0200 (CEST)",
            "from inva021.nxp.com (inva021.nxp.com [92.121.34.21])\n by dpdk.org (Postfix) with ESMTP id 3BD321DCE5\n for <dev@dpdk.org>; Tue,  7 Jul 2020 11:27:06 +0200 (CEST)",
            "from inva021.nxp.com (localhost [127.0.0.1])\n by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 1EAE12008EB;\n Tue,  7 Jul 2020 11:27:06 +0200 (CEST)",
            "from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com\n [165.114.16.14])\n by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 09D302008DD;\n Tue,  7 Jul 2020 11:27:04 +0200 (CEST)",
            "from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net\n [10.232.133.63])\n by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 5291F402FC;\n Tue,  7 Jul 2020 17:27:01 +0800 (SGT)"
        ],
        "Subject": "[dpdk-dev] [PATCH v2 11/29] net/dpaa: update process specific\n\tdevice info",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "In-Reply-To": "<20200707092244.12791-1-hemant.agrawal@nxp.com>",
        "Precedence": "list",
        "From": "Hemant Agrawal <hemant.agrawal@nxp.com>",
        "References": "<20200527132326.1382-1-hemant.agrawal@nxp.com>\n <20200707092244.12791-1-hemant.agrawal@nxp.com>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Errors-To": "dev-bounces@dpdk.org",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Date": "Tue,  7 Jul 2020 14:52:26 +0530",
        "X-Mailman-Version": "2.1.15",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>"
    },
    "content": "From: Nipun Gupta <nipun.gupta@nxp.com>\n\nFor DPAA devices the memory maps stored in the FMAN interface\ninformation is per process. Store them in the device process specific\narea.\nThis is required to support multi-process apps.\n\nSigned-off-by: Nipun Gupta <nipun.gupta@nxp.com>\n---\n drivers/net/dpaa/dpaa_ethdev.c | 207 ++++++++++++++++-----------------\n drivers/net/dpaa/dpaa_ethdev.h |   1 -\n 2 files changed, 102 insertions(+), 106 deletions(-)",
    "diff": "diff --git a/drivers/net/dpaa/dpaa_ethdev.c b/drivers/net/dpaa/dpaa_ethdev.c\nindex c0ded9086..6c94fd396 100644\n--- a/drivers/net/dpaa/dpaa_ethdev.c\n+++ b/drivers/net/dpaa/dpaa_ethdev.c\n@@ -149,7 +149,6 @@ dpaa_poll_queue_default_config(struct qm_mcc_initfq *opts)\n static int\n dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)\n {\n-\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n \tuint32_t frame_size = mtu + RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN\n \t\t\t\t+ VLAN_TAG_SIZE;\n \tuint32_t buffsz = dev->data->min_rx_buf_size - RTE_PKTMBUF_HEADROOM;\n@@ -185,7 +184,7 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)\n \n \tdev->data->dev_conf.rxmode.max_rx_pkt_len = frame_size;\n \n-\tfman_if_set_maxfrm(dpaa_intf->fif, frame_size);\n+\tfman_if_set_maxfrm(dev->process_private, frame_size);\n \n \treturn 0;\n }\n@@ -193,7 +192,6 @@ dpaa_mtu_set(struct rte_eth_dev *dev, uint16_t mtu)\n static int\n dpaa_eth_dev_configure(struct rte_eth_dev *dev)\n {\n-\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n \tstruct rte_eth_conf *eth_conf = &dev->data->dev_conf;\n \tuint64_t rx_offloads = eth_conf->rxmode.offloads;\n \tuint64_t tx_offloads = eth_conf->txmode.offloads;\n@@ -232,14 +230,14 @@ dpaa_eth_dev_configure(struct rte_eth_dev *dev)\n \t\t\tmax_len = DPAA_MAX_RX_PKT_LEN;\n \t\t}\n \n-\t\tfman_if_set_maxfrm(dpaa_intf->fif, max_len);\n+\t\tfman_if_set_maxfrm(dev->process_private, max_len);\n \t\tdev->data->mtu = max_len\n \t\t\t- RTE_ETHER_HDR_LEN - RTE_ETHER_CRC_LEN - VLAN_TAG_SIZE;\n \t}\n \n \tif (rx_offloads & DEV_RX_OFFLOAD_SCATTER) {\n \t\tDPAA_PMD_DEBUG(\"enabling scatter mode\");\n-\t\tfman_if_set_sg(dpaa_intf->fif, 1);\n+\t\tfman_if_set_sg(dev->process_private, 1);\n \t\tdev->data->scattered_rx = 1;\n \t}\n \n@@ -283,18 +281,18 @@ static int dpaa_eth_dev_start(struct rte_eth_dev *dev)\n \telse\n \t\tdev->tx_pkt_burst = dpaa_eth_queue_tx;\n \n-\tfman_if_enable_rx(dpaa_intf->fif);\n+\tfman_if_enable_rx(dev->process_private);\n \n \treturn 0;\n }\n \n static void dpaa_eth_dev_stop(struct rte_eth_dev *dev)\n {\n-\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n+\tstruct fman_if *fif = dev->process_private;\n \n \tPMD_INIT_FUNC_TRACE();\n \n-\tfman_if_disable_rx(dpaa_intf->fif);\n+\tfman_if_disable_rx(fif);\n \tdev->tx_pkt_burst = dpaa_eth_tx_drop_all;\n }\n \n@@ -342,6 +340,7 @@ static int dpaa_eth_dev_info(struct rte_eth_dev *dev,\n \t\t\t     struct rte_eth_dev_info *dev_info)\n {\n \tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n+\tstruct fman_if *fif = dev->process_private;\n \n \tDPAA_PMD_DEBUG(\": %s\", dpaa_intf->name);\n \n@@ -354,18 +353,18 @@ static int dpaa_eth_dev_info(struct rte_eth_dev *dev,\n \tdev_info->max_vmdq_pools = ETH_16_POOLS;\n \tdev_info->flow_type_rss_offloads = DPAA_RSS_OFFLOAD_ALL;\n \n-\tif (dpaa_intf->fif->mac_type == fman_mac_1g) {\n+\tif (fif->mac_type == fman_mac_1g) {\n \t\tdev_info->speed_capa = ETH_LINK_SPEED_1G;\n-\t} else if (dpaa_intf->fif->mac_type == fman_mac_2_5g) {\n+\t} else if (fif->mac_type == fman_mac_2_5g) {\n \t\tdev_info->speed_capa = ETH_LINK_SPEED_1G\n \t\t\t\t\t| ETH_LINK_SPEED_2_5G;\n-\t} else if (dpaa_intf->fif->mac_type == fman_mac_10g) {\n+\t} else if (fif->mac_type == fman_mac_10g) {\n \t\tdev_info->speed_capa = ETH_LINK_SPEED_1G\n \t\t\t\t\t| ETH_LINK_SPEED_2_5G\n \t\t\t\t\t| ETH_LINK_SPEED_10G;\n \t} else {\n \t\tDPAA_PMD_ERR(\"invalid link_speed: %s, %d\",\n-\t\t\t     dpaa_intf->name, dpaa_intf->fif->mac_type);\n+\t\t\t     dpaa_intf->name, fif->mac_type);\n \t\treturn -EINVAL;\n \t}\n \n@@ -388,18 +387,19 @@ static int dpaa_eth_link_update(struct rte_eth_dev *dev,\n {\n \tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n \tstruct rte_eth_link *link = &dev->data->dev_link;\n+\tstruct fman_if *fif = dev->process_private;\n \n \tPMD_INIT_FUNC_TRACE();\n \n-\tif (dpaa_intf->fif->mac_type == fman_mac_1g)\n+\tif (fif->mac_type == fman_mac_1g)\n \t\tlink->link_speed = ETH_SPEED_NUM_1G;\n-\telse if (dpaa_intf->fif->mac_type == fman_mac_2_5g)\n+\telse if (fif->mac_type == fman_mac_2_5g)\n \t\tlink->link_speed = ETH_SPEED_NUM_2_5G;\n-\telse if (dpaa_intf->fif->mac_type == fman_mac_10g)\n+\telse if (fif->mac_type == fman_mac_10g)\n \t\tlink->link_speed = ETH_SPEED_NUM_10G;\n \telse\n \t\tDPAA_PMD_ERR(\"invalid link_speed: %s, %d\",\n-\t\t\t     dpaa_intf->name, dpaa_intf->fif->mac_type);\n+\t\t\t     dpaa_intf->name, fif->mac_type);\n \n \tlink->link_status = dpaa_intf->valid;\n \tlink->link_duplex = ETH_LINK_FULL_DUPLEX;\n@@ -410,21 +410,17 @@ static int dpaa_eth_link_update(struct rte_eth_dev *dev,\n static int dpaa_eth_stats_get(struct rte_eth_dev *dev,\n \t\t\t       struct rte_eth_stats *stats)\n {\n-\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n-\n \tPMD_INIT_FUNC_TRACE();\n \n-\tfman_if_stats_get(dpaa_intf->fif, stats);\n+\tfman_if_stats_get(dev->process_private, stats);\n \treturn 0;\n }\n \n static int dpaa_eth_stats_reset(struct rte_eth_dev *dev)\n {\n-\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n-\n \tPMD_INIT_FUNC_TRACE();\n \n-\tfman_if_stats_reset(dpaa_intf->fif);\n+\tfman_if_stats_reset(dev->process_private);\n \n \treturn 0;\n }\n@@ -433,7 +429,6 @@ static int\n dpaa_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,\n \t\t    unsigned int n)\n {\n-\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n \tunsigned int i = 0, num = RTE_DIM(dpaa_xstats_strings);\n \tuint64_t values[sizeof(struct dpaa_if_stats) / 8];\n \n@@ -443,7 +438,7 @@ dpaa_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,\n \tif (xstats == NULL)\n \t\treturn 0;\n \n-\tfman_if_stats_get_all(dpaa_intf->fif, values,\n+\tfman_if_stats_get_all(dev->process_private, values,\n \t\t\t      sizeof(struct dpaa_if_stats) / 8);\n \n \tfor (i = 0; i < num; i++) {\n@@ -480,15 +475,13 @@ dpaa_xstats_get_by_id(struct rte_eth_dev *dev, const uint64_t *ids,\n \tuint64_t values_copy[sizeof(struct dpaa_if_stats) / 8];\n \n \tif (!ids) {\n-\t\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n-\n \t\tif (n < stat_cnt)\n \t\t\treturn stat_cnt;\n \n \t\tif (!values)\n \t\t\treturn 0;\n \n-\t\tfman_if_stats_get_all(dpaa_intf->fif, values_copy,\n+\t\tfman_if_stats_get_all(dev->process_private, values_copy,\n \t\t\t\t      sizeof(struct dpaa_if_stats) / 8);\n \n \t\tfor (i = 0; i < stat_cnt; i++)\n@@ -537,44 +530,36 @@ dpaa_xstats_get_names_by_id(\n \n static int dpaa_eth_promiscuous_enable(struct rte_eth_dev *dev)\n {\n-\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n-\n \tPMD_INIT_FUNC_TRACE();\n \n-\tfman_if_promiscuous_enable(dpaa_intf->fif);\n+\tfman_if_promiscuous_enable(dev->process_private);\n \n \treturn 0;\n }\n \n static int dpaa_eth_promiscuous_disable(struct rte_eth_dev *dev)\n {\n-\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n-\n \tPMD_INIT_FUNC_TRACE();\n \n-\tfman_if_promiscuous_disable(dpaa_intf->fif);\n+\tfman_if_promiscuous_disable(dev->process_private);\n \n \treturn 0;\n }\n \n static int dpaa_eth_multicast_enable(struct rte_eth_dev *dev)\n {\n-\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n-\n \tPMD_INIT_FUNC_TRACE();\n \n-\tfman_if_set_mcast_filter_table(dpaa_intf->fif);\n+\tfman_if_set_mcast_filter_table(dev->process_private);\n \n \treturn 0;\n }\n \n static int dpaa_eth_multicast_disable(struct rte_eth_dev *dev)\n {\n-\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n-\n \tPMD_INIT_FUNC_TRACE();\n \n-\tfman_if_reset_mcast_filter_table(dpaa_intf->fif);\n+\tfman_if_reset_mcast_filter_table(dev->process_private);\n \n \treturn 0;\n }\n@@ -587,6 +572,7 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,\n \t\t\t    struct rte_mempool *mp)\n {\n \tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n+\tstruct fman_if *fif = dev->process_private;\n \tstruct qman_fq *rxq = &dpaa_intf->rx_queues[queue_idx];\n \tstruct qm_mcc_initfq opts = {0};\n \tu32 flags = 0;\n@@ -643,22 +629,22 @@ int dpaa_eth_rx_queue_setup(struct rte_eth_dev *dev, uint16_t queue_idx,\n \t\ticp.iciof = DEFAULT_ICIOF;\n \t\ticp.iceof = DEFAULT_RX_ICEOF;\n \t\ticp.icsz = DEFAULT_ICSZ;\n-\t\tfman_if_set_ic_params(dpaa_intf->fif, &icp);\n+\t\tfman_if_set_ic_params(fif, &icp);\n \n \t\tfd_offset = RTE_PKTMBUF_HEADROOM + DPAA_HW_BUF_RESERVE;\n-\t\tfman_if_set_fdoff(dpaa_intf->fif, fd_offset);\n+\t\tfman_if_set_fdoff(fif, fd_offset);\n \n \t\t/* Buffer pool size should be equal to Dataroom Size*/\n \t\tbp_size = rte_pktmbuf_data_room_size(mp);\n-\t\tfman_if_set_bp(dpaa_intf->fif, mp->size,\n+\t\tfman_if_set_bp(fif, mp->size,\n \t\t\t       dpaa_intf->bp_info->bpid, bp_size);\n \t\tdpaa_intf->valid = 1;\n \t\tDPAA_PMD_DEBUG(\"if:%s fd_offset = %d offset = %d\",\n \t\t\t\tdpaa_intf->name, fd_offset,\n-\t\t\t\tfman_if_get_fdoff(dpaa_intf->fif));\n+\t\t\t\tfman_if_get_fdoff(fif));\n \t}\n \tDPAA_PMD_DEBUG(\"if:%s sg_on = %d, max_frm =%d\", dpaa_intf->name,\n-\t\tfman_if_get_sg_enable(dpaa_intf->fif),\n+\t\tfman_if_get_sg_enable(fif),\n \t\tdev->data->dev_conf.rxmode.max_rx_pkt_len);\n \t/* checking if push mode only, no error check for now */\n \tif (!rxq->is_static &&\n@@ -950,11 +936,12 @@ dpaa_flow_ctrl_set(struct rte_eth_dev *dev,\n \t\treturn 0;\n \t} else if (fc_conf->mode == RTE_FC_TX_PAUSE ||\n \t\t fc_conf->mode == RTE_FC_FULL) {\n-\t\tfman_if_set_fc_threshold(dpaa_intf->fif, fc_conf->high_water,\n+\t\tfman_if_set_fc_threshold(dev->process_private,\n+\t\t\t\t\t fc_conf->high_water,\n \t\t\t\t\t fc_conf->low_water,\n-\t\t\t\tdpaa_intf->bp_info->bpid);\n+\t\t\t\t\t dpaa_intf->bp_info->bpid);\n \t\tif (fc_conf->pause_time)\n-\t\t\tfman_if_set_fc_quanta(dpaa_intf->fif,\n+\t\t\tfman_if_set_fc_quanta(dev->process_private,\n \t\t\t\t\t      fc_conf->pause_time);\n \t}\n \n@@ -990,10 +977,11 @@ dpaa_flow_ctrl_get(struct rte_eth_dev *dev,\n \t\tfc_conf->autoneg = net_fc->autoneg;\n \t\treturn 0;\n \t}\n-\tret = fman_if_get_fc_threshold(dpaa_intf->fif);\n+\tret = fman_if_get_fc_threshold(dev->process_private);\n \tif (ret) {\n \t\tfc_conf->mode = RTE_FC_TX_PAUSE;\n-\t\tfc_conf->pause_time = fman_if_get_fc_quanta(dpaa_intf->fif);\n+\t\tfc_conf->pause_time =\n+\t\t\tfman_if_get_fc_quanta(dev->process_private);\n \t} else {\n \t\tfc_conf->mode = RTE_FC_NONE;\n \t}\n@@ -1008,11 +996,11 @@ dpaa_dev_add_mac_addr(struct rte_eth_dev *dev,\n \t\t\t     __rte_unused uint32_t pool)\n {\n \tint ret;\n-\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n \n \tPMD_INIT_FUNC_TRACE();\n \n-\tret = fman_if_add_mac_addr(dpaa_intf->fif, addr->addr_bytes, index);\n+\tret = fman_if_add_mac_addr(dev->process_private,\n+\t\t\t\t   addr->addr_bytes, index);\n \n \tif (ret)\n \t\tDPAA_PMD_ERR(\"Adding the MAC ADDR failed: err = %d\", ret);\n@@ -1023,11 +1011,9 @@ static void\n dpaa_dev_remove_mac_addr(struct rte_eth_dev *dev,\n \t\t\t  uint32_t index)\n {\n-\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n-\n \tPMD_INIT_FUNC_TRACE();\n \n-\tfman_if_clear_mac_addr(dpaa_intf->fif, index);\n+\tfman_if_clear_mac_addr(dev->process_private, index);\n }\n \n static int\n@@ -1035,11 +1021,10 @@ dpaa_dev_set_mac_addr(struct rte_eth_dev *dev,\n \t\t       struct rte_ether_addr *addr)\n {\n \tint ret;\n-\tstruct dpaa_if *dpaa_intf = dev->data->dev_private;\n \n \tPMD_INIT_FUNC_TRACE();\n \n-\tret = fman_if_add_mac_addr(dpaa_intf->fif, addr->addr_bytes, 0);\n+\tret = fman_if_add_mac_addr(dev->process_private, addr->addr_bytes, 0);\n \tif (ret)\n \t\tDPAA_PMD_ERR(\"Setting the MAC ADDR failed %d\", ret);\n \n@@ -1142,7 +1127,6 @@ int\n rte_pmd_dpaa_set_tx_loopback(uint8_t port, uint8_t on)\n {\n \tstruct rte_eth_dev *dev;\n-\tstruct dpaa_if *dpaa_intf;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port, -ENODEV);\n \n@@ -1151,17 +1135,16 @@ rte_pmd_dpaa_set_tx_loopback(uint8_t port, uint8_t on)\n \tif (!is_dpaa_supported(dev))\n \t\treturn -ENOTSUP;\n \n-\tdpaa_intf = dev->data->dev_private;\n-\n \tif (on)\n-\t\tfman_if_loopback_enable(dpaa_intf->fif);\n+\t\tfman_if_loopback_enable(dev->process_private);\n \telse\n-\t\tfman_if_loopback_disable(dpaa_intf->fif);\n+\t\tfman_if_loopback_disable(dev->process_private);\n \n \treturn 0;\n }\n \n-static int dpaa_fc_set_default(struct dpaa_if *dpaa_intf)\n+static int dpaa_fc_set_default(struct dpaa_if *dpaa_intf,\n+\t\t\t       struct fman_if *fman_intf)\n {\n \tstruct rte_eth_fc_conf *fc_conf;\n \tint ret;\n@@ -1177,10 +1160,10 @@ static int dpaa_fc_set_default(struct dpaa_if *dpaa_intf)\n \t\t}\n \t}\n \tfc_conf = dpaa_intf->fc_conf;\n-\tret = fman_if_get_fc_threshold(dpaa_intf->fif);\n+\tret = fman_if_get_fc_threshold(fman_intf);\n \tif (ret) {\n \t\tfc_conf->mode = RTE_FC_TX_PAUSE;\n-\t\tfc_conf->pause_time = fman_if_get_fc_quanta(dpaa_intf->fif);\n+\t\tfc_conf->pause_time = fman_if_get_fc_quanta(fman_intf);\n \t} else {\n \t\tfc_conf->mode = RTE_FC_NONE;\n \t}\n@@ -1342,6 +1325,39 @@ static int dpaa_debug_queue_init(struct qman_fq *fq, uint32_t fqid)\n }\n #endif\n \n+/* Initialise a network interface */\n+static int\n+dpaa_dev_init_secondary(struct rte_eth_dev *eth_dev)\n+{\n+\tstruct rte_dpaa_device *dpaa_device;\n+\tstruct fm_eth_port_cfg *cfg;\n+\tstruct dpaa_if *dpaa_intf;\n+\tstruct fman_if *fman_intf;\n+\tint dev_id;\n+\n+\tPMD_INIT_FUNC_TRACE();\n+\n+\tdpaa_device = DEV_TO_DPAA_DEVICE(eth_dev->device);\n+\tdev_id = dpaa_device->id.dev_id;\n+\tcfg = dpaa_get_eth_port_cfg(dev_id);\n+\tfman_intf = cfg->fman_if;\n+\teth_dev->process_private = fman_intf;\n+\n+\t/* Plugging of UCODE burst API not supported in Secondary */\n+\tdpaa_intf = eth_dev->data->dev_private;\n+\teth_dev->rx_pkt_burst = dpaa_eth_queue_rx;\n+\tif (dpaa_intf->cgr_tx)\n+\t\teth_dev->tx_pkt_burst = dpaa_eth_queue_tx_slow;\n+\telse\n+\t\teth_dev->tx_pkt_burst = dpaa_eth_queue_tx;\n+#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP\n+\tqman_set_fq_lookup_table(\n+\t\tdpaa_intf->rx_queues->qman_fq_lookup_table);\n+#endif\n+\n+\treturn 0;\n+}\n+\n /* Initialise a network interface */\n static int\n dpaa_dev_init(struct rte_eth_dev *eth_dev)\n@@ -1360,23 +1376,6 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)\n \n \tPMD_INIT_FUNC_TRACE();\n \n-\tdpaa_intf = eth_dev->data->dev_private;\n-\t/* For secondary processes, the primary has done all the work */\n-\tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n-\t\teth_dev->dev_ops = &dpaa_devops;\n-\t\t/* Plugging of UCODE burst API not supported in Secondary */\n-\t\teth_dev->rx_pkt_burst = dpaa_eth_queue_rx;\n-\t\tif (dpaa_intf->cgr_tx)\n-\t\t\teth_dev->tx_pkt_burst = dpaa_eth_queue_tx_slow;\n-\t\telse\n-\t\t\teth_dev->tx_pkt_burst = dpaa_eth_queue_tx;\n-#ifdef CONFIG_FSL_QMAN_FQ_LOOKUP\n-\t\tqman_set_fq_lookup_table(\n-\t\t\t\tdpaa_intf->rx_queues->qman_fq_lookup_table);\n-#endif\n-\t\treturn 0;\n-\t}\n-\n \tdpaa_device = DEV_TO_DPAA_DEVICE(eth_dev->device);\n \tdev_id = dpaa_device->id.dev_id;\n \tdpaa_intf = eth_dev->data->dev_private;\n@@ -1386,7 +1385,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)\n \tdpaa_intf->name = dpaa_device->name;\n \n \t/* save fman_if & cfg in the interface struture */\n-\tdpaa_intf->fif = fman_intf;\n+\teth_dev->process_private = fman_intf;\n \tdpaa_intf->ifid = dev_id;\n \tdpaa_intf->cfg = cfg;\n \n@@ -1455,7 +1454,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)\n \t\tif (default_q)\n \t\t\tfqid = cfg->rx_def;\n \t\telse\n-\t\t\tfqid = DPAA_PCD_FQID_START + dpaa_intf->fif->mac_idx *\n+\t\t\tfqid = DPAA_PCD_FQID_START + fman_intf->mac_idx *\n \t\t\t\tDPAA_PCD_FQID_MULTIPLIER + loop;\n \n \t\tif (dpaa_intf->cgr_rx)\n@@ -1527,7 +1526,7 @@ dpaa_dev_init(struct rte_eth_dev *eth_dev)\n \tDPAA_PMD_DEBUG(\"All frame queues created\");\n \n \t/* Get the initial configuration for flow control */\n-\tdpaa_fc_set_default(dpaa_intf);\n+\tdpaa_fc_set_default(dpaa_intf, fman_intf);\n \n \t/* reset bpool list, initialize bpool dynamically */\n \tlist_for_each_entry_safe(bp, tmp_bp, &cfg->fman_if->bpool_list, node) {\n@@ -1674,6 +1673,13 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,\n \t\t\treturn -ENOMEM;\n \t\teth_dev->device = &dpaa_dev->device;\n \t\teth_dev->dev_ops = &dpaa_devops;\n+\n+\t\tret = dpaa_dev_init_secondary(eth_dev);\n+\t\tif (ret != 0) {\n+\t\t\tRTE_LOG(ERR, PMD, \"secondary dev init failed\\n\");\n+\t\t\treturn ret;\n+\t\t}\n+\n \t\trte_eth_dev_probing_finish(eth_dev);\n \t\treturn 0;\n \t}\n@@ -1709,29 +1715,20 @@ rte_dpaa_probe(struct rte_dpaa_driver *dpaa_drv __rte_unused,\n \t\t}\n \t}\n \n-\t/* In case of secondary process, the device is already configured\n-\t * and no further action is required, except portal initialization\n-\t * and verifying secondary attachment to port name.\n-\t */\n-\tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n-\t\teth_dev = rte_eth_dev_attach_secondary(dpaa_dev->name);\n-\t\tif (!eth_dev)\n-\t\t\treturn -ENOMEM;\n-\t} else {\n-\t\teth_dev = rte_eth_dev_allocate(dpaa_dev->name);\n-\t\tif (eth_dev == NULL)\n-\t\t\treturn -ENOMEM;\n+\teth_dev = rte_eth_dev_allocate(dpaa_dev->name);\n+\tif (!eth_dev)\n+\t\treturn -ENOMEM;\n \n-\t\teth_dev->data->dev_private = rte_zmalloc(\n-\t\t\t\t\t\t\"ethdev private structure\",\n-\t\t\t\t\t\tsizeof(struct dpaa_if),\n-\t\t\t\t\t\tRTE_CACHE_LINE_SIZE);\n-\t\tif (!eth_dev->data->dev_private) {\n-\t\t\tDPAA_PMD_ERR(\"Cannot allocate memzone for port data\");\n-\t\t\trte_eth_dev_release_port(eth_dev);\n-\t\t\treturn -ENOMEM;\n-\t\t}\n+\teth_dev->data->dev_private =\n+\t\t\trte_zmalloc(\"ethdev private structure\",\n+\t\t\t\t\tsizeof(struct dpaa_if),\n+\t\t\t\t\tRTE_CACHE_LINE_SIZE);\n+\tif (!eth_dev->data->dev_private) {\n+\t\tDPAA_PMD_ERR(\"Cannot allocate memzone for port data\");\n+\t\trte_eth_dev_release_port(eth_dev);\n+\t\treturn -ENOMEM;\n \t}\n+\n \teth_dev->device = &dpaa_dev->device;\n \tdpaa_dev->eth_dev = eth_dev;\n \ndiff --git a/drivers/net/dpaa/dpaa_ethdev.h b/drivers/net/dpaa/dpaa_ethdev.h\nindex d4261f885..4c40ff86a 100644\n--- a/drivers/net/dpaa/dpaa_ethdev.h\n+++ b/drivers/net/dpaa/dpaa_ethdev.h\n@@ -116,7 +116,6 @@ struct dpaa_if {\n \tuint16_t nb_rx_queues;\n \tuint16_t nb_tx_queues;\n \tuint32_t ifid;\n-\tstruct fman_if *fif;\n \tstruct dpaa_bp_info *bp_info;\n \tstruct rte_eth_fc_conf *fc_conf;\n };\n",
    "prefixes": [
        "v2",
        "11/29"
    ]
}