get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 58031,
    "url": "http://patches.dpdk.org/api/patches/58031/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190827083306.5643-2-dirk.lenz@ng4t.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "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",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20190827083306.5643-2-dirk.lenz@ng4t.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190827083306.5643-2-dirk.lenz@ng4t.com",
    "date": "2019-08-27T08:33:06",
    "name": "[1/1] net/enic: enic driver doesn't work with 2nd process",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "79a08cb19dc7799181a10d582402d2920a097105",
    "submitter": {
        "id": 1410,
        "url": "http://patches.dpdk.org/api/people/1410/?format=api",
        "name": "dirk",
        "email": "dirk.lenz@ng4t.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190827083306.5643-2-dirk.lenz@ng4t.com/mbox/",
    "series": [
        {
            "id": 6133,
            "url": "http://patches.dpdk.org/api/series/6133/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6133",
            "date": "2019-08-27T08:33:05",
            "name": "net/enic: enic driver doesn't work with 2nd process",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/6133/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/58031/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/58031/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0967F1C0D0;\n\tTue, 27 Aug 2019 10:33:25 +0200 (CEST)",
            "from mail.ud15.udmedia.de (ud15.udmedia.de [194.117.254.55])\n\tby dpdk.org (Postfix) with ESMTP id 9FC8829CB\n\tfor <dev@dpdk.org>; Tue, 27 Aug 2019 10:33:23 +0200 (CEST)",
            "(qmail 17859 invoked from network); 27 Aug 2019 10:33:23 +0200",
            "by mail.ud15.udmedia.de with ESMTPSA (TLS_AES_256_GCM_SHA384\n\tencrypted, authenticated); 27 Aug 2019 10:33:23 +0200"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=simple; d=ng4t.com; h=from:to\n\t:subject:date:message-id:in-reply-to:references:mime-version\n\t:content-transfer-encoding; s=k1; bh=eYs2Jl5GvRltpacTRhyVKB492VW\n\t7wuM2DiQP0wq6ZHQ=; b=mDj6hc4lyKOHz+gtSVe8nbCHftCYCv5JQn20cQJR9v2\n\tDlstfW+xAQ+Kh+JYdVFa5lxQsabWfRvzc4tcca4lCBW+oZw8tFCVTfQD8QlyLxJN\n\tUyPKxAo9qMfCk9Qm2zGDry88TjOSM420L/uZZPuDuENnoCsMpnmZYh8acELjVjrY\n\t=",
        "X-UD-Smtp-Session": "ud15?2p5@Clq3HxWRusUqAoEGAAH5AALgTP/+aBWL",
        "From": "dirk <dirk.lenz@ng4t.com>",
        "To": "dev@dpdk.org",
        "Date": "Tue, 27 Aug 2019 10:33:06 +0200",
        "Message-Id": "<20190827083306.5643-2-dirk.lenz@ng4t.com>",
        "X-Mailer": "git-send-email 2.23.0",
        "In-Reply-To": "<20190827083306.5643-1-dirk.lenz@ng4t.com>",
        "References": "<20190827083306.5643-1-dirk.lenz@ng4t.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH 1/1] net/enic: enic driver doesn't work with 2nd\n\tprocess",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Signed-off-by: dirk <dirk.lenz@ng4t.com>\n---\n drivers/net/enic/enic.h               |  36 ++++---\n drivers/net/enic/enic_clsf.c          |   5 +-\n drivers/net/enic/enic_ethdev.c        |  79 ++++++---------\n drivers/net/enic/enic_main.c          | 177 +++++++++++++++++++---------------\n drivers/net/enic/enic_res.c           |   7 +-\n drivers/net/enic/enic_res.h           |   6 +-\n drivers/net/enic/enic_rxtx_vec_avx2.c |   5 +-\n 7 files changed, 156 insertions(+), 159 deletions(-)",
    "diff": "diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h\nindex 5a92508f0..87d799594 100644\n--- a/drivers/net/enic/enic.h\n+++ b/drivers/net/enic/enic.h\n@@ -97,7 +97,6 @@ struct rte_flow {\n /* Per-instance private data structure */\n struct enic {\n \tstruct enic *next;\n-\tstruct rte_pci_device *pdev;\n \tstruct vnic_enet_config config;\n \tstruct vnic_dev_bar bar0;\n \tstruct vnic_dev *vdev;\n@@ -109,7 +108,6 @@ struct enic {\n \tuint64_t mbuf_initializer;\n \tunsigned int port_id;\n \tbool overlay_offload;\n-\tstruct rte_eth_dev *rte_dev;\n \tstruct enic_fdir fdir;\n \tchar bdf_name[ENICPMD_BDF_LENGTH];\n \tint dev_fd;\n@@ -275,7 +273,7 @@ enic_ring_incr(uint32_t n_descriptors, uint32_t idx)\n \n void enic_fdir_stats_get(struct enic *enic,\n \t\t\t struct rte_eth_fdir_stats *stats);\n-int enic_fdir_add_fltr(struct enic *enic,\n+int enic_fdir_add_fltr(struct rte_eth_dev *eth_dev,\n \t\t       struct rte_eth_fdir_filter *params);\n int enic_fdir_del_fltr(struct enic *enic,\n \t\t       struct rte_eth_fdir_filter *params);\n@@ -284,30 +282,30 @@ int enic_alloc_intr_resources(struct enic *enic);\n int enic_setup_finish(struct enic *enic);\n int enic_alloc_wq(struct enic *enic, uint16_t queue_idx,\n \t\t  unsigned int socket_id, uint16_t nb_desc);\n-void enic_start_wq(struct enic *enic, uint16_t queue_idx);\n-int enic_stop_wq(struct enic *enic, uint16_t queue_idx);\n-void enic_start_rq(struct enic *enic, uint16_t queue_idx);\n-int enic_stop_rq(struct enic *enic, uint16_t queue_idx);\n+void enic_start_wq(struct rte_eth_dev *eth_dev, uint16_t queue_idx);\n+int enic_stop_wq(struct rte_eth_dev *eth_dev, uint16_t queue_idx);\n+void enic_start_rq(struct rte_eth_dev *eth_dev, uint16_t queue_idx);\n+int enic_stop_rq(struct rte_eth_dev *eth_dev, uint16_t queue_idx);\n void enic_free_rq(void *rxq);\n-int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,\n+int enic_alloc_rq(struct rte_eth_dev *eth_dev, uint16_t queue_idx,\n \t\t  unsigned int socket_id, struct rte_mempool *mp,\n \t\t  uint16_t nb_desc, uint16_t free_thresh);\n-int enic_set_vnic_res(struct enic *enic);\n-int enic_init_rss_nic_cfg(struct enic *enic);\n-int enic_set_rss_conf(struct enic *enic,\n+int enic_set_vnic_res(struct rte_eth_dev *eth_dev);\n+int enic_init_rss_nic_cfg(struct rte_eth_dev *eth_dev);\n+int enic_set_rss_conf(struct rte_eth_dev *eth_dev,\n \t\t      struct rte_eth_rss_conf *rss_conf);\n int enic_set_rss_reta(struct enic *enic, union vnic_rss_cpu *rss_cpu);\n int enic_set_vlan_strip(struct enic *enic);\n-int enic_enable(struct enic *enic);\n-int enic_disable(struct enic *enic);\n+int enic_enable(struct rte_eth_dev *eth_dev);\n+int enic_disable(struct rte_eth_dev *eth_dev);\n void enic_remove(struct enic *enic);\n int enic_get_link_status(struct enic *enic);\n int enic_dev_stats_get(struct enic *enic,\n \t\t       struct rte_eth_stats *r_stats);\n void enic_dev_stats_clear(struct enic *enic);\n void enic_add_packet_filter(struct enic *enic);\n-int enic_set_mac_address(struct enic *enic, uint8_t *mac_addr);\n-int enic_del_mac_address(struct enic *enic, int mac_index);\n+int enic_set_mac_address(struct rte_eth_dev *eth_dev, uint8_t *mac_addr);\n+int enic_del_mac_address(struct rte_eth_dev *eth_dev, int mac_index);\n unsigned int enic_cleanup_wq(struct enic *enic, struct vnic_wq *wq);\n void enic_send_pkt(struct enic *enic, struct vnic_wq *wq,\n \t\t   struct rte_mbuf *tx_pkt, unsigned short len,\n@@ -315,7 +313,7 @@ void enic_send_pkt(struct enic *enic, struct vnic_wq *wq,\n \t\t   uint16_t ol_flags, uint16_t vlan_tag);\n \n void enic_post_wq_index(struct vnic_wq *wq);\n-int enic_probe(struct enic *enic);\n+int enic_probe(struct rte_eth_dev *eth_dev);\n int enic_clsf_init(struct enic *enic);\n void enic_clsf_destroy(struct enic *enic);\n uint16_t enic_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\n@@ -331,9 +329,9 @@ uint16_t enic_simple_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\t\t       uint16_t nb_pkts);\n uint16_t enic_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts,\n \t\t\tuint16_t nb_pkts);\n-int enic_set_mtu(struct enic *enic, uint16_t new_mtu);\n-int enic_link_update(struct enic *enic);\n-bool enic_use_vector_rx_handler(struct enic *enic);\n+int enic_set_mtu(struct rte_eth_dev *eth_dev, uint16_t new_mtu);\n+int enic_link_update(struct rte_eth_dev *eth_dev);\n+bool enic_use_vector_rx_handler(struct rte_eth_dev *eth_dev);\n void enic_fdir_info(struct enic *enic);\n void enic_fdir_info_get(struct enic *enic, struct rte_eth_fdir_info *stats);\n extern const struct rte_flow_ops enic_flow_ops;\ndiff --git a/drivers/net/enic/enic_clsf.c b/drivers/net/enic/enic_clsf.c\nindex 080b642c8..ba68a42ad 100644\n--- a/drivers/net/enic/enic_clsf.c\n+++ b/drivers/net/enic/enic_clsf.c\n@@ -332,7 +332,7 @@ int enic_fdir_del_fltr(struct enic *enic, struct rte_eth_fdir_filter *params)\n \treturn 0;\n }\n \n-int enic_fdir_add_fltr(struct enic *enic, struct rte_eth_fdir_filter *params)\n+int enic_fdir_add_fltr(struct rte_eth_dev *eth_dev, struct rte_eth_fdir_filter *params)\n {\n \tstruct enic_fdir_node *key;\n \tstruct filter_v2 fltr;\n@@ -343,6 +343,7 @@ int enic_fdir_add_fltr(struct enic *enic, struct rte_eth_fdir_filter *params)\n \tu16 flex_bytes;\n \tu16 queue;\n \tstruct filter_action_v2 action;\n+  struct enic *enic = pmd_priv(eth_dev);\n \n \tmemset(&fltr, 0, sizeof(fltr));\n \tmemset(&action, 0, sizeof(action));\n@@ -429,7 +430,7 @@ int enic_fdir_add_fltr(struct enic *enic, struct rte_eth_fdir_filter *params)\n \tkey->rq_index = queue;\n \n \tenic->fdir.copy_fltr_fn(&fltr, &params->input,\n-\t\t\t\t&enic->rte_dev->data->dev_conf.fdir_conf.mask);\n+\t\t\t\t&eth_dev->data->dev_conf.fdir_conf.mask);\n \taction.type = FILTER_ACTION_RQ_STEERING;\n \taction.rq_idx = queue;\n \ndiff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c\nindex 06dc67122..1a90c5715 100644\n--- a/drivers/net/enic/enic_ethdev.c\n+++ b/drivers/net/enic/enic_ethdev.c\n@@ -93,7 +93,7 @@ enicpmd_fdir_ctrl_func(struct rte_eth_dev *eth_dev,\n \tswitch (filter_op) {\n \tcase RTE_ETH_FILTER_ADD:\n \tcase RTE_ETH_FILTER_UPDATE:\n-\t\tret = enic_fdir_add_fltr(enic,\n+\t\tret = enic_fdir_add_fltr(eth_dev,\n \t\t\t(struct rte_eth_fdir_filter *)arg);\n \t\tbreak;\n \n@@ -160,10 +160,11 @@ static void enicpmd_dev_tx_queue_release(void *txq)\n \tenic_free_wq(txq);\n }\n \n-static int enicpmd_dev_setup_intr(struct enic *enic)\n+static int enicpmd_dev_setup_intr(struct rte_eth_dev *eth_dev)\n {\n \tint ret;\n \tunsigned int index;\n+  struct enic *enic = pmd_priv(eth_dev);\n \n \tENICPMD_FUNC_TRACE();\n \n@@ -193,7 +194,7 @@ static int enicpmd_dev_setup_intr(struct enic *enic)\n \t\tdev_err(enic, \"alloc intr failed\\n\");\n \t\treturn ret;\n \t}\n-\tenic_init_vnic_resources(enic);\n+\tenic_init_vnic_resources(eth_dev);\n \n \tret = enic_setup_finish(enic);\n \tif (ret)\n@@ -228,17 +229,15 @@ static int enicpmd_dev_tx_queue_setup(struct rte_eth_dev *eth_dev,\n \t\treturn ret;\n \t}\n \n-\treturn enicpmd_dev_setup_intr(enic);\n+\treturn enicpmd_dev_setup_intr(eth_dev);\n }\n \n static int enicpmd_dev_tx_queue_start(struct rte_eth_dev *eth_dev,\n \tuint16_t queue_idx)\n {\n-\tstruct enic *enic = pmd_priv(eth_dev);\n-\n \tENICPMD_FUNC_TRACE();\n \n-\tenic_start_wq(enic, queue_idx);\n+\tenic_start_wq(eth_dev, queue_idx);\n \n \treturn 0;\n }\n@@ -247,12 +246,12 @@ static int enicpmd_dev_tx_queue_stop(struct rte_eth_dev *eth_dev,\n \tuint16_t queue_idx)\n {\n \tint ret;\n-\tstruct enic *enic = pmd_priv(eth_dev);\n \n \tENICPMD_FUNC_TRACE();\n \n-\tret = enic_stop_wq(enic, queue_idx);\n+\tret = enic_stop_wq(eth_dev, queue_idx);\n \tif (ret)\n+\t  //struct enic *enic = pmd_priv(eth_dev);\n \t\tdev_err(enic, \"error in stopping wq %d\\n\", queue_idx);\n \n \treturn ret;\n@@ -261,11 +260,9 @@ static int enicpmd_dev_tx_queue_stop(struct rte_eth_dev *eth_dev,\n static int enicpmd_dev_rx_queue_start(struct rte_eth_dev *eth_dev,\n \tuint16_t queue_idx)\n {\n-\tstruct enic *enic = pmd_priv(eth_dev);\n-\n \tENICPMD_FUNC_TRACE();\n \n-\tenic_start_rq(enic, queue_idx);\n+\tenic_start_rq(eth_dev, queue_idx);\n \n \treturn 0;\n }\n@@ -274,12 +271,12 @@ static int enicpmd_dev_rx_queue_stop(struct rte_eth_dev *eth_dev,\n \tuint16_t queue_idx)\n {\n \tint ret;\n-\tstruct enic *enic = pmd_priv(eth_dev);\n \n \tENICPMD_FUNC_TRACE();\n \n-\tret = enic_stop_rq(enic, queue_idx);\n+\tret = enic_stop_rq(eth_dev, queue_idx);\n \tif (ret)\n+\t  //struct enic *enic = pmd_priv(eth_dev);\n \t\tdev_err(enic, \"error in stopping rq %d\\n\", queue_idx);\n \n \treturn ret;\n@@ -337,14 +334,14 @@ static int enicpmd_dev_rx_queue_setup(struct rte_eth_dev *eth_dev,\n \teth_dev->data->rx_queues[queue_idx] =\n \t\t(void *)&enic->rq[enic_rte_rq_idx_to_sop_idx(queue_idx)];\n \n-\tret = enic_alloc_rq(enic, queue_idx, socket_id, mp, nb_desc,\n+\tret = enic_alloc_rq(eth_dev, queue_idx, socket_id, mp, nb_desc,\n \t\t\t    rx_conf->rx_free_thresh);\n \tif (ret) {\n \t\tdev_err(enic, \"error in allocating rq\\n\");\n \t\treturn ret;\n \t}\n \n-\treturn enicpmd_dev_setup_intr(enic);\n+\treturn enicpmd_dev_setup_intr(eth_dev);\n }\n \n static int enicpmd_vlan_offload_set(struct rte_eth_dev *eth_dev, int mask)\n@@ -387,7 +384,7 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)\n \t\treturn -E_RTE_SECONDARY;\n \n \tENICPMD_FUNC_TRACE();\n-\tret = enic_set_vnic_res(enic);\n+\tret = enic_set_vnic_res(eth_dev);\n \tif (ret) {\n \t\tdev_err(enic, \"Set vNIC resource num  failed, aborting\\n\");\n \t\treturn ret;\n@@ -410,7 +407,7 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)\n \t * given (rx_adv_conf.rss_conf.rss_key), will use that instead of the\n \t * default key.\n \t */\n-\treturn enic_init_rss_nic_cfg(enic);\n+\treturn enic_init_rss_nic_cfg(eth_dev);\n }\n \n /* Start the device.\n@@ -418,13 +415,11 @@ static int enicpmd_dev_configure(struct rte_eth_dev *eth_dev)\n  */\n static int enicpmd_dev_start(struct rte_eth_dev *eth_dev)\n {\n-\tstruct enic *enic = pmd_priv(eth_dev);\n-\n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n \t\treturn -E_RTE_SECONDARY;\n \n \tENICPMD_FUNC_TRACE();\n-\treturn enic_enable(enic);\n+\treturn enic_enable(eth_dev);\n }\n \n /*\n@@ -433,13 +428,12 @@ static int enicpmd_dev_start(struct rte_eth_dev *eth_dev)\n static void enicpmd_dev_stop(struct rte_eth_dev *eth_dev)\n {\n \tstruct rte_eth_link link;\n-\tstruct enic *enic = pmd_priv(eth_dev);\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n \t\treturn;\n \n \tENICPMD_FUNC_TRACE();\n-\tenic_disable(enic);\n+\tenic_disable(eth_dev);\n \n \tmemset(&link, 0, sizeof(link));\n \trte_eth_linkstatus_set(eth_dev, &link);\n@@ -459,10 +453,8 @@ static void enicpmd_dev_close(struct rte_eth_dev *eth_dev)\n static int enicpmd_dev_link_update(struct rte_eth_dev *eth_dev,\n \t__rte_unused int wait_to_complete)\n {\n-\tstruct enic *enic = pmd_priv(eth_dev);\n-\n \tENICPMD_FUNC_TRACE();\n-\treturn enic_link_update(enic);\n+\treturn enic_link_update(eth_dev);\n }\n \n static int enicpmd_dev_stats_get(struct rte_eth_dev *eth_dev,\n@@ -654,41 +646,36 @@ static int enicpmd_add_mac_addr(struct rte_eth_dev *eth_dev,\n \tstruct rte_ether_addr *mac_addr,\n \t__rte_unused uint32_t index, __rte_unused uint32_t pool)\n {\n-\tstruct enic *enic = pmd_priv(eth_dev);\n-\n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n \t\treturn -E_RTE_SECONDARY;\n \n \tENICPMD_FUNC_TRACE();\n-\treturn enic_set_mac_address(enic, mac_addr->addr_bytes);\n+\treturn enic_set_mac_address(eth_dev, mac_addr->addr_bytes);\n }\n \n static void enicpmd_remove_mac_addr(struct rte_eth_dev *eth_dev, uint32_t index)\n {\n-\tstruct enic *enic = pmd_priv(eth_dev);\n-\n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n \t\treturn;\n \n \tENICPMD_FUNC_TRACE();\n-\tif (enic_del_mac_address(enic, index))\n+\tif (enic_del_mac_address(eth_dev, index))\n \t\tdev_err(enic, \"del mac addr failed\\n\");\n }\n \n static int enicpmd_set_mac_addr(struct rte_eth_dev *eth_dev,\n \t\t\t\tstruct rte_ether_addr *addr)\n {\n-\tstruct enic *enic = pmd_priv(eth_dev);\n \tint ret;\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n \t\treturn -E_RTE_SECONDARY;\n \n \tENICPMD_FUNC_TRACE();\n-\tret = enic_del_mac_address(enic, 0);\n+\tret = enic_del_mac_address(eth_dev, 0);\n \tif (ret)\n \t\treturn ret;\n-\treturn enic_set_mac_address(enic, addr->addr_bytes);\n+\treturn enic_set_mac_address(eth_dev, addr->addr_bytes);\n }\n \n static void debug_log_add_del_addr(struct rte_ether_addr *addr, bool add)\n@@ -785,18 +772,16 @@ static int enicpmd_set_mc_addr_list(struct rte_eth_dev *eth_dev,\n \n static int enicpmd_mtu_set(struct rte_eth_dev *eth_dev, uint16_t mtu)\n {\n-\tstruct enic *enic = pmd_priv(eth_dev);\n-\n \tENICPMD_FUNC_TRACE();\n-\treturn enic_set_mtu(enic, mtu);\n+\treturn enic_set_mtu(eth_dev, mtu);\n }\n \n-static int enicpmd_dev_rss_reta_query(struct rte_eth_dev *dev,\n+static int enicpmd_dev_rss_reta_query(struct rte_eth_dev *eth_dev,\n \t\t\t\t      struct rte_eth_rss_reta_entry64\n \t\t\t\t      *reta_conf,\n \t\t\t\t      uint16_t reta_size)\n {\n-\tstruct enic *enic = pmd_priv(dev);\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \tuint16_t i, idx, shift;\n \n \tENICPMD_FUNC_TRACE();\n@@ -817,12 +802,12 @@ static int enicpmd_dev_rss_reta_query(struct rte_eth_dev *dev,\n \treturn 0;\n }\n \n-static int enicpmd_dev_rss_reta_update(struct rte_eth_dev *dev,\n+static int enicpmd_dev_rss_reta_update(struct rte_eth_dev *eth_dev,\n \t\t\t\t       struct rte_eth_rss_reta_entry64\n \t\t\t\t       *reta_conf,\n \t\t\t\t       uint16_t reta_size)\n {\n-\tstruct enic *enic = pmd_priv(dev);\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \tunion vnic_rss_cpu rss_cpu;\n \tuint16_t i, idx, shift;\n \n@@ -849,13 +834,11 @@ static int enicpmd_dev_rss_reta_update(struct rte_eth_dev *dev,\n \treturn enic_set_rss_reta(enic, &rss_cpu);\n }\n \n-static int enicpmd_dev_rss_hash_update(struct rte_eth_dev *dev,\n+static int enicpmd_dev_rss_hash_update(struct rte_eth_dev *eth_dev,\n \t\t\t\t       struct rte_eth_rss_conf *rss_conf)\n {\n-\tstruct enic *enic = pmd_priv(dev);\n-\n \tENICPMD_FUNC_TRACE();\n-\treturn enic_set_rss_conf(enic, rss_conf);\n+\treturn enic_set_rss_conf(eth_dev, rss_conf);\n }\n \n static int enicpmd_dev_rss_hash_conf_get(struct rte_eth_dev *dev,\n@@ -1205,7 +1188,6 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev *eth_dev)\n \tENICPMD_FUNC_TRACE();\n \n \tenic->port_id = eth_dev->data->port_id;\n-\tenic->rte_dev = eth_dev;\n \teth_dev->dev_ops = &enicpmd_eth_dev_ops;\n \teth_dev->rx_pkt_burst = &enic_recv_pkts;\n \teth_dev->tx_pkt_burst = &enic_xmit_pkts;\n@@ -1215,7 +1197,6 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev *eth_dev)\n \n \tpdev = RTE_ETH_DEV_TO_PCI(eth_dev);\n \trte_eth_copy_pci_info(eth_dev, pdev);\n-\tenic->pdev = pdev;\n \taddr = &pdev->addr;\n \n \tsnprintf(enic->bdf_name, ENICPMD_BDF_LENGTH, \"%04x:%02x:%02x.%x\",\n@@ -1224,7 +1205,7 @@ static int eth_enicpmd_dev_init(struct rte_eth_dev *eth_dev)\n \terr = enic_check_devargs(eth_dev);\n \tif (err)\n \t\treturn err;\n-\treturn enic_probe(enic);\n+\treturn enic_probe(eth_dev);\n }\n \n static int eth_enic_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\ndiff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c\nindex 40af3781b..e37c70a6e 100644\n--- a/drivers/net/enic/enic_main.c\n+++ b/drivers/net/enic/enic_main.c\n@@ -30,9 +30,11 @@\n #include \"vnic_intr.h\"\n #include \"vnic_nic.h\"\n \n-static inline int enic_is_sriov_vf(struct enic *enic)\n+static inline int enic_is_sriov_vf(struct rte_eth_dev *eth_dev)\n {\n-\treturn enic->pdev->id.device_id == PCI_DEVICE_ID_CISCO_VIC_ENET_VF;\n+  struct rte_pci_device *pdev = RTE_ETH_DEV_TO_PCI(eth_dev);\n+\n+  return pdev->id.device_id == PCI_DEVICE_ID_CISCO_VIC_ENET_VF;\n }\n \n static int is_zero_addr(uint8_t *addr)\n@@ -161,17 +163,18 @@ int enic_dev_stats_get(struct enic *enic, struct rte_eth_stats *r_stats)\n \treturn 0;\n }\n \n-int enic_del_mac_address(struct enic *enic, int mac_index)\n+int enic_del_mac_address(struct rte_eth_dev *eth_dev, int mac_index)\n {\n-\tstruct rte_eth_dev *eth_dev = enic->rte_dev;\n \tuint8_t *mac_addr = eth_dev->data->mac_addrs[mac_index].addr_bytes;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n \treturn vnic_dev_del_addr(enic->vdev, mac_addr);\n }\n \n-int enic_set_mac_address(struct enic *enic, uint8_t *mac_addr)\n+int enic_set_mac_address(struct rte_eth_dev *eth_dev, uint8_t *mac_addr)\n {\n \tint err;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n \tif (!is_eth_addr_valid(mac_addr)) {\n \t\tdev_err(enic, \"invalid mac address\\n\");\n@@ -194,7 +197,7 @@ enic_free_rq_buf(struct rte_mbuf **mbuf)\n \t*mbuf = NULL;\n }\n \n-void enic_init_vnic_resources(struct enic *enic)\n+void enic_init_vnic_resources(struct rte_eth_dev *eth_dev)\n {\n \tunsigned int error_interrupt_enable = 1;\n \tunsigned int error_interrupt_offset = 0;\n@@ -203,8 +206,9 @@ void enic_init_vnic_resources(struct enic *enic)\n \tunsigned int index = 0;\n \tunsigned int cq_idx;\n \tstruct vnic_rq *data_rq;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n-\tif (enic->rte_dev->data->dev_conf.intr_conf.rxq)\n+\tif (eth_dev->data->dev_conf.intr_conf.rxq)\n \t\trxq_interrupt_enable = 1;\n \n \tfor (index = 0; index < enic->rq_count; index++) {\n@@ -270,7 +274,7 @@ void enic_init_vnic_resources(struct enic *enic)\n \n \n static int\n-enic_alloc_rx_queue_mbufs(struct enic *enic, struct vnic_rq *rq)\n+enic_alloc_rx_queue_mbufs(struct rte_eth_dev *eth_dev, struct vnic_rq *rq)\n {\n \tstruct rte_mbuf *mb;\n \tstruct rq_enet_desc *rqd = rq->ring.descs;\n@@ -293,7 +297,7 @@ enic_alloc_rx_queue_mbufs(struct enic *enic, struct vnic_rq *rq)\n \t * drop in the rx handler. Not ideal, but better than returning\n \t * large packets when the user is not expecting them.\n \t */\n-\tmax_rx_pkt_len = enic->rte_dev->data->dev_conf.rxmode.max_rx_pkt_len;\n+\tmax_rx_pkt_len = eth_dev->data->dev_conf.rxmode.max_rx_pkt_len;\n \trq_buf_len = rte_pktmbuf_data_room_size(rq->mp) - RTE_PKTMBUF_HEADROOM;\n \tif (max_rx_pkt_len < rq_buf_len && !rq->data_queue_enable)\n \t\trq_buf_len = max_rx_pkt_len;\n@@ -417,10 +421,10 @@ enic_free_consistent(void *priv,\n \trte_free(mze);\n }\n \n-int enic_link_update(struct enic *enic)\n+int enic_link_update(struct rte_eth_dev *eth_dev)\n {\n-\tstruct rte_eth_dev *eth_dev = enic->rte_dev;\n \tstruct rte_eth_link link;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n \tmemset(&link, 0, sizeof(link));\n \tlink.link_status = enic_get_link_status(enic);\n@@ -433,24 +437,25 @@ int enic_link_update(struct enic *enic)\n static void\n enic_intr_handler(void *arg)\n {\n-\tstruct rte_eth_dev *dev = (struct rte_eth_dev *)arg;\n-\tstruct enic *enic = pmd_priv(dev);\n+\tstruct rte_eth_dev *eth_dev = (struct rte_eth_dev *)arg;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n \tvnic_intr_return_all_credits(&enic->intr[ENICPMD_LSC_INTR_OFFSET]);\n \n-\tenic_link_update(enic);\n-\t_rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC, NULL);\n+\tenic_link_update(eth_dev);\n+\t_rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL);\n \tenic_log_q_error(enic);\n }\n \n-static int enic_rxq_intr_init(struct enic *enic)\n+static int enic_rxq_intr_init(struct rte_eth_dev *eth_dev)\n {\n \tstruct rte_intr_handle *intr_handle;\n \tuint32_t rxq_intr_count, i;\n \tint err;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n-\tintr_handle = enic->rte_dev->intr_handle;\n-\tif (!enic->rte_dev->data->dev_conf.intr_conf.rxq)\n+\tintr_handle = eth_dev->intr_handle;\n+\tif (!eth_dev->data->dev_conf.intr_conf.rxq)\n \t\treturn 0;\n \t/*\n \t * Rx queue interrupts only work when we have MSI-X interrupts,\n@@ -480,11 +485,11 @@ static int enic_rxq_intr_init(struct enic *enic)\n \treturn 0;\n }\n \n-static void enic_rxq_intr_deinit(struct enic *enic)\n+static void enic_rxq_intr_deinit(struct rte_eth_dev *eth_dev)\n {\n \tstruct rte_intr_handle *intr_handle;\n \n-\tintr_handle = enic->rte_dev->intr_handle;\n+\tintr_handle = eth_dev->intr_handle;\n \trte_intr_efd_disable(intr_handle);\n \tif (intr_handle->intr_vec != NULL) {\n \t\trte_free(intr_handle->intr_vec);\n@@ -518,14 +523,14 @@ static void enic_prep_wq_for_simple_tx(struct enic *enic, uint16_t queue_idx)\n  * used when that file is not compiled.\n  */\n __rte_weak bool\n-enic_use_vector_rx_handler(__rte_unused struct enic *enic)\n+enic_use_vector_rx_handler(__rte_unused struct rte_eth_dev *eth_dev)\n {\n \treturn false;\n }\n \n-static void pick_rx_handler(struct enic *enic)\n+static void pick_rx_handler(struct rte_eth_dev *eth_dev)\n {\n-\tstruct rte_eth_dev *eth_dev;\n+  struct enic *enic = pmd_priv(eth_dev);\n \n \t/*\n \t * Preference order:\n@@ -533,8 +538,7 @@ static void pick_rx_handler(struct enic *enic)\n \t * 2. The non-scatter, simplified handler if scatter Rx is not used.\n \t * 3. The default handler as a fallback.\n \t */\n-\teth_dev = enic->rte_dev;\n-\tif (enic_use_vector_rx_handler(enic))\n+\tif (enic_use_vector_rx_handler(eth_dev))\n \t\treturn;\n \tif (enic->rq_count > 0 && enic->rq[0].data_queue_enable == 0) {\n \t\tENICPMD_LOG(DEBUG, \" use the non-scatter Rx handler\");\n@@ -545,13 +549,13 @@ static void pick_rx_handler(struct enic *enic)\n \t}\n }\n \n-int enic_enable(struct enic *enic)\n+int enic_enable(struct rte_eth_dev *eth_dev)\n {\n \tunsigned int index;\n \tint err;\n-\tstruct rte_eth_dev *eth_dev = enic->rte_dev;\n \tuint64_t simple_tx_offloads;\n \tuintptr_t p;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n \tif (enic->enable_avx2_rx) {\n \t\tstruct rte_mbuf mb_def = { .buf_addr = 0 };\n@@ -580,7 +584,7 @@ int enic_enable(struct enic *enic)\n \tif (eth_dev->data->dev_conf.intr_conf.lsc)\n \t\tvnic_dev_notify_set(enic->vdev, 0);\n \n-\terr = enic_rxq_intr_init(enic);\n+\terr = enic_rxq_intr_init(eth_dev);\n \tif (err)\n \t\treturn err;\n \tif (enic_clsf_init(enic))\n@@ -588,13 +592,13 @@ int enic_enable(struct enic *enic)\n \t\t\t\"Flow director feature will not work\\n\");\n \n \tfor (index = 0; index < enic->rq_count; index++) {\n-\t\terr = enic_alloc_rx_queue_mbufs(enic,\n+\t\terr = enic_alloc_rx_queue_mbufs(eth_dev,\n \t\t\t&enic->rq[enic_rte_rq_idx_to_sop_idx(index)]);\n \t\tif (err) {\n \t\t\tdev_err(enic, \"Failed to alloc sop RX queue mbufs\\n\");\n \t\t\treturn err;\n \t\t}\n-\t\terr = enic_alloc_rx_queue_mbufs(enic,\n+\t\terr = enic_alloc_rx_queue_mbufs(eth_dev,\n \t\t\t&enic->rq[enic_rte_rq_idx_to_data_idx(index)]);\n \t\tif (err) {\n \t\t\t/* release the allocated mbufs for the sop rq*/\n@@ -627,22 +631,26 @@ int enic_enable(struct enic *enic)\n \t\teth_dev->tx_pkt_burst = &enic_xmit_pkts;\n \t}\n \n-\tpick_rx_handler(enic);\n+\tpick_rx_handler(eth_dev);\n \n \tfor (index = 0; index < enic->wq_count; index++)\n-\t\tenic_start_wq(enic, index);\n+\t\tenic_start_wq(eth_dev, index);\n \tfor (index = 0; index < enic->rq_count; index++)\n-\t\tenic_start_rq(enic, index);\n+\t\tenic_start_rq(eth_dev, index);\n \n \tvnic_dev_add_addr(enic->vdev, enic->mac_addr);\n \n \tvnic_dev_enable_wait(enic->vdev);\n \n \t/* Register and enable error interrupt */\n-\trte_intr_callback_register(&(enic->pdev->intr_handle),\n-\t\tenic_intr_handler, (void *)enic->rte_dev);\n+\t{\n+\t  struct rte_pci_device *pdev = RTE_ETH_DEV_TO_PCI(eth_dev);\n+\n+\t  rte_intr_callback_register(&pdev->intr_handle,\n+\t                             enic_intr_handler, (void *)eth_dev);\n \n-\trte_intr_enable(&(enic->pdev->intr_handle));\n+\t  rte_intr_enable(&pdev->intr_handle);\n+\t}\n \t/* Unmask LSC interrupt */\n \tvnic_intr_unmask(&enic->intr[ENICPMD_LSC_INTR_OFFSET]);\n \n@@ -715,17 +723,18 @@ void enic_free_rq(void *rxq)\n \trq_data->in_use = 0;\n }\n \n-void enic_start_wq(struct enic *enic, uint16_t queue_idx)\n+void enic_start_wq(struct rte_eth_dev *eth_dev, uint16_t queue_idx)\n {\n-\tstruct rte_eth_dev *eth_dev = enic->rte_dev;\n-\tvnic_wq_enable(&enic->wq[queue_idx]);\n+  struct enic *enic = pmd_priv(eth_dev);\n+\n+  vnic_wq_enable(&enic->wq[queue_idx]);\n \teth_dev->data->tx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;\n }\n \n-int enic_stop_wq(struct enic *enic, uint16_t queue_idx)\n+int enic_stop_wq(struct rte_eth_dev *eth_dev, uint16_t queue_idx)\n {\n-\tstruct rte_eth_dev *eth_dev = enic->rte_dev;\n \tint ret;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n \tret = vnic_wq_disable(&enic->wq[queue_idx]);\n \tif (ret)\n@@ -735,13 +744,14 @@ int enic_stop_wq(struct enic *enic, uint16_t queue_idx)\n \treturn 0;\n }\n \n-void enic_start_rq(struct enic *enic, uint16_t queue_idx)\n+void enic_start_rq(struct rte_eth_dev *eth_dev, uint16_t queue_idx)\n {\n \tstruct vnic_rq *rq_sop;\n \tstruct vnic_rq *rq_data;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n+\n \trq_sop = &enic->rq[enic_rte_rq_idx_to_sop_idx(queue_idx)];\n \trq_data = &enic->rq[rq_sop->data_queue_idx];\n-\tstruct rte_eth_dev *eth_dev = enic->rte_dev;\n \n \tif (rq_data->in_use) {\n \t\tvnic_rq_enable(rq_data);\n@@ -753,12 +763,13 @@ void enic_start_rq(struct enic *enic, uint16_t queue_idx)\n \teth_dev->data->rx_queue_state[queue_idx] = RTE_ETH_QUEUE_STATE_STARTED;\n }\n \n-int enic_stop_rq(struct enic *enic, uint16_t queue_idx)\n+int enic_stop_rq(struct rte_eth_dev *eth_dev, uint16_t queue_idx)\n {\n \tint ret1 = 0, ret2 = 0;\n-\tstruct rte_eth_dev *eth_dev = enic->rte_dev;\n \tstruct vnic_rq *rq_sop;\n \tstruct vnic_rq *rq_data;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n+\n \trq_sop = &enic->rq[enic_rte_rq_idx_to_sop_idx(queue_idx)];\n \trq_data = &enic->rq[rq_sop->data_queue_idx];\n \n@@ -776,13 +787,14 @@ int enic_stop_rq(struct enic *enic, uint16_t queue_idx)\n \treturn 0;\n }\n \n-int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,\n+int enic_alloc_rq(struct rte_eth_dev *eth_dev, uint16_t queue_idx,\n \tunsigned int socket_id, struct rte_mempool *mp,\n \tuint16_t nb_desc, uint16_t free_thresh)\n {\n \tint rc;\n \tuint16_t sop_queue_idx = enic_rte_rq_idx_to_sop_idx(queue_idx);\n \tuint16_t data_queue_idx = enic_rte_rq_idx_to_data_idx(queue_idx);\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \tstruct vnic_rq *rq_sop = &enic->rq[sop_queue_idx];\n \tstruct vnic_rq *rq_data = &enic->rq[data_queue_idx];\n \tunsigned int mbuf_size, mbufs_per_pkt;\n@@ -807,9 +819,9 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx,\n \tmbuf_size = (uint16_t)(rte_pktmbuf_data_room_size(mp) -\n \t\t\t       RTE_PKTMBUF_HEADROOM);\n \t/* max_rx_pkt_len includes the ethernet header and CRC. */\n-\tmax_rx_pkt_len = enic->rte_dev->data->dev_conf.rxmode.max_rx_pkt_len;\n+\tmax_rx_pkt_len = eth_dev->data->dev_conf.rxmode.max_rx_pkt_len;\n \n-\tif (enic->rte_dev->data->dev_conf.rxmode.offloads &\n+\tif (eth_dev->data->dev_conf.rxmode.offloads &\n \t    DEV_RX_OFFLOAD_SCATTER) {\n \t\tdev_info(enic, \"Rq %u Scatter rx mode enabled\\n\", queue_idx);\n \t\t/* ceil((max pkt len)/mbuf_size) */\n@@ -1025,26 +1037,29 @@ int enic_alloc_wq(struct enic *enic, uint16_t queue_idx,\n \treturn err;\n }\n \n-int enic_disable(struct enic *enic)\n+int enic_disable(struct rte_eth_dev *eth_dev)\n {\n \tunsigned int i;\n \tint err;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n+\tstruct rte_pci_device *pdev = RTE_ETH_DEV_TO_PCI(eth_dev);\n \n \tfor (i = 0; i < enic->intr_count; i++) {\n \t\tvnic_intr_mask(&enic->intr[i]);\n \t\t(void)vnic_intr_masked(&enic->intr[i]); /* flush write */\n \t}\n-\tenic_rxq_intr_deinit(enic);\n-\trte_intr_disable(&enic->pdev->intr_handle);\n-\trte_intr_callback_unregister(&enic->pdev->intr_handle,\n+\tenic_rxq_intr_deinit(eth_dev);\n+\n+\trte_intr_disable(&pdev->intr_handle);\n+\trte_intr_callback_unregister(&pdev->intr_handle,\n \t\t\t\t     enic_intr_handler,\n-\t\t\t\t     (void *)enic->rte_dev);\n+\t\t\t\t     (void *)eth_dev);\n \n \tvnic_dev_disable(enic->vdev);\n \n \tenic_clsf_destroy(enic);\n \n-\tif (!enic_is_sriov_vf(enic))\n+\tif (!enic_is_sriov_vf(eth_dev))\n \t\tvnic_dev_del_addr(enic->vdev, enic->mac_addr);\n \n \tfor (i = 0; i < enic->wq_count; i++) {\n@@ -1064,7 +1079,7 @@ int enic_disable(struct enic *enic)\n \t * to disable interrupts.  We are not disabling link notifcations,\n \t * though, as we want the polling of link status to continue working.\n \t */\n-\tif (enic->rte_dev->data->dev_conf.intr_conf.lsc)\n+\tif (eth_dev->data->dev_conf.intr_conf.lsc)\n \t\tvnic_dev_notify_set(enic->vdev, -1);\n \n \tvnic_dev_set_reset_flag(enic->vdev, 1);\n@@ -1198,7 +1213,7 @@ static int enic_set_niccfg(struct enic *enic, u8 rss_default_cpu,\n }\n \n /* Initialize RSS with defaults, called from dev_configure */\n-int enic_init_rss_nic_cfg(struct enic *enic)\n+int enic_init_rss_nic_cfg(struct rte_eth_dev *eth_dev)\n {\n \tstatic uint8_t default_rss_key[] = {\n \t\t85, 67, 83, 97, 119, 101, 115, 111, 109, 101,\n@@ -1209,8 +1224,9 @@ int enic_init_rss_nic_cfg(struct enic *enic)\n \tstruct rte_eth_rss_conf rss_conf;\n \tunion vnic_rss_cpu rss_cpu;\n \tint ret, i;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n-\trss_conf = enic->rte_dev->data->dev_conf.rx_adv_conf.rss_conf;\n+\trss_conf = eth_dev->data->dev_conf.rx_adv_conf.rss_conf;\n \t/*\n \t * If setting key for the first time, and the user gives us none, then\n \t * push the default key to NIC.\n@@ -1219,7 +1235,7 @@ int enic_init_rss_nic_cfg(struct enic *enic)\n \t\trss_conf.rss_key = default_rss_key;\n \t\trss_conf.rss_key_len = ENIC_RSS_HASH_KEY_SIZE;\n \t}\n-\tret = enic_set_rss_conf(enic, &rss_conf);\n+\tret = enic_set_rss_conf(eth_dev, &rss_conf);\n \tif (ret) {\n \t\tdev_err(enic, \"Failed to configure RSS\\n\");\n \t\treturn ret;\n@@ -1277,13 +1293,13 @@ static int enic_rss_conf_valid(struct enic *enic,\n }\n \n /* Set hash type and key according to rss_conf */\n-int enic_set_rss_conf(struct enic *enic, struct rte_eth_rss_conf *rss_conf)\n+int enic_set_rss_conf(struct rte_eth_dev *eth_dev, struct rte_eth_rss_conf *rss_conf)\n {\n-\tstruct rte_eth_dev *eth_dev;\n \tuint64_t rss_hf;\n \tu8 rss_hash_type;\n \tu8 rss_enable;\n \tint ret;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n \tRTE_ASSERT(rss_conf != NULL);\n \tret = enic_rss_conf_valid(enic, rss_conf);\n@@ -1292,7 +1308,6 @@ int enic_set_rss_conf(struct enic *enic, struct rte_eth_rss_conf *rss_conf)\n \t\treturn ret;\n \t}\n \n-\teth_dev = enic->rte_dev;\n \trss_hash_type = 0;\n \trss_hf = rss_conf->rss_hf & enic->flow_type_rss_offloads;\n \tif (enic->rq_count > 1 &&\n@@ -1389,11 +1404,11 @@ static void enic_dev_deinit(struct enic *enic)\n }\n \n \n-int enic_set_vnic_res(struct enic *enic)\n+int enic_set_vnic_res(struct rte_eth_dev *eth_dev)\n {\n-\tstruct rte_eth_dev *eth_dev = enic->rte_dev;\n \tint rc = 0;\n \tunsigned int required_rq, required_wq, required_cq, required_intr;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n \t/* Always use two vNIC RQs per eth_dev RQ, regardless of Rx scatter. */\n \trequired_rq = eth_dev->data->nb_rx_queues * 2;\n@@ -1440,11 +1455,12 @@ int enic_set_vnic_res(struct enic *enic)\n \n /* Initialize the completion queue for an RQ */\n static int\n-enic_reinit_rq(struct enic *enic, unsigned int rq_idx)\n+enic_reinit_rq(struct rte_eth_dev *eth_dev, unsigned int rq_idx)\n {\n \tstruct vnic_rq *sop_rq, *data_rq;\n \tunsigned int cq_idx;\n \tint rc = 0;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n \tsop_rq = &enic->rq[enic_rte_rq_idx_to_sop_idx(rq_idx)];\n \tdata_rq = &enic->rq[enic_rte_rq_idx_to_data_idx(rq_idx)];\n@@ -1474,12 +1490,12 @@ enic_reinit_rq(struct enic *enic, unsigned int rq_idx)\n \t\t\t\t   data_rq->ring.desc_count - 1, 1, 0);\n \t}\n \n-\trc = enic_alloc_rx_queue_mbufs(enic, sop_rq);\n+\trc = enic_alloc_rx_queue_mbufs(eth_dev, sop_rq);\n \tif (rc)\n \t\treturn rc;\n \n \tif (data_rq->in_use) {\n-\t\trc = enic_alloc_rx_queue_mbufs(enic, data_rq);\n+\t\trc = enic_alloc_rx_queue_mbufs(eth_dev, data_rq);\n \t\tif (rc) {\n \t\t\tenic_rxmbuf_queue_release(enic, sop_rq);\n \t\t\treturn rc;\n@@ -1496,14 +1512,14 @@ enic_reinit_rq(struct enic *enic, unsigned int rq_idx)\n  * Depending on the network setup, doing so may cause packet drops\n  * and unexpected behavior.\n  */\n-int enic_set_mtu(struct enic *enic, uint16_t new_mtu)\n+int enic_set_mtu(struct rte_eth_dev *eth_dev, uint16_t new_mtu)\n {\n \tunsigned int rq_idx;\n \tstruct vnic_rq *rq;\n \tint rc = 0;\n \tuint16_t old_mtu;\t/* previous setting */\n \tuint16_t config_mtu;\t/* Value configured into NIC via CIMC/UCSM */\n-\tstruct rte_eth_dev *eth_dev = enic->rte_dev;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n \told_mtu = eth_dev->data->mtu;\n \tconfig_mtu = enic->config.mtu;\n@@ -1554,7 +1570,7 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)\n \tfor (rq_idx = 0; rq_idx < enic->rq_count * 2; rq_idx++) {\n \t\trq = &enic->rq[rq_idx];\n \t\tif (rq->is_sop && rq->in_use) {\n-\t\t\trc = enic_stop_rq(enic,\n+\t\t\trc = enic_stop_rq(eth_dev,\n \t\t\t\t\t  enic_sop_rq_idx_to_rte_idx(rq_idx));\n \t\t\tif (rc) {\n \t\t\t\tdev_err(enic, \"Failed to stop Rq %u\\n\", rq_idx);\n@@ -1580,7 +1596,7 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)\n \t\t\tcontinue;\n \n \t\tenic_free_rq(rq);\n-\t\trc = enic_alloc_rq(enic, rq_idx, rq->socket_id, rq->mp,\n+\t\trc = enic_alloc_rq(eth_dev, rq_idx, rq->socket_id, rq->mp,\n \t\t\t\t   rq->tot_nb_desc, rq->rx_free_thresh);\n \t\tif (rc) {\n \t\t\tdev_err(enic,\n@@ -1588,7 +1604,7 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)\n \t\t\tgoto set_mtu_done;\n \t\t}\n \n-\t\trc = enic_reinit_rq(enic, rq_idx);\n+\t\trc = enic_reinit_rq(eth_dev, rq_idx);\n \t\tif (rc) {\n \t\t\tdev_err(enic,\n \t\t\t\t\"Fatal MTU RQ reinit- No traffic will pass\\n\");\n@@ -1598,14 +1614,14 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)\n \n \t/* put back the real receive function */\n \trte_mb();\n-\tpick_rx_handler(enic);\n+\tpick_rx_handler(eth_dev);\n \trte_mb();\n \n \t/* restart Rx traffic */\n \tfor (rq_idx = 0; rq_idx < enic->rq_count; rq_idx++) {\n \t\trq = &enic->rq[enic_rte_rq_idx_to_sop_idx(rq_idx)];\n \t\tif (rq->is_sop && rq->in_use)\n-\t\t\tenic_start_rq(enic, rq_idx);\n+\t\t\tenic_start_rq(eth_dev, rq_idx);\n \t}\n \n set_mtu_done:\n@@ -1614,16 +1630,16 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu)\n \treturn rc;\n }\n \n-static int enic_dev_init(struct enic *enic)\n+static int enic_dev_init(struct rte_eth_dev *eth_dev)\n {\n \tint err;\n-\tstruct rte_eth_dev *eth_dev = enic->rte_dev;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n \tvnic_dev_intr_coal_timer_info_default(enic->vdev);\n \n \t/* Get vNIC configuration\n \t*/\n-\terr = enic_get_vnic_config(enic);\n+\terr = enic_get_vnic_config(eth_dev);\n \tif (err) {\n \t\tdev_err(dev, \"Get vNIC configuration failed, aborting\\n\");\n \t\treturn err;\n@@ -1737,9 +1753,10 @@ static int enic_dev_init(struct enic *enic)\n \n }\n \n-int enic_probe(struct enic *enic)\n+int enic_probe(struct rte_eth_dev *eth_dev)\n {\n-\tstruct rte_pci_device *pdev = enic->pdev;\n+  struct enic *enic = pmd_priv(eth_dev);\n+  struct rte_pci_device *pdev = RTE_ETH_DEV_TO_PCI(eth_dev);\n \tint err = -1;\n \n \tdev_debug(enic, \"Initializing ENIC PMD\\n\");\n@@ -1752,7 +1769,7 @@ int enic_probe(struct enic *enic)\n \tenic->bar0.len = pdev->mem_resource[0].len;\n \n \t/* Register vNIC device */\n-\tenic->vdev = vnic_dev_register(NULL, enic, enic->pdev, &enic->bar0, 1);\n+\tenic->vdev = vnic_dev_register(NULL, enic, pdev, &enic->bar0, 1);\n \tif (!enic->vdev) {\n \t\tdev_err(enic, \"vNIC registration failed, aborting\\n\");\n \t\tgoto err_out;\n@@ -1806,7 +1823,7 @@ int enic_probe(struct enic *enic)\n \t\tgoto err_out_dev_close;\n \t}\n \n-\terr = enic_dev_init(enic);\n+\terr = enic_dev_init(eth_dev);\n \tif (err) {\n \t\tdev_err(enic, \"Device initialization failed, aborting\\n\");\n \t\tgoto err_out_dev_close;\ndiff --git a/drivers/net/enic/enic_res.c b/drivers/net/enic/enic_res.c\nindex 9405e1933..3e2013598 100644\n--- a/drivers/net/enic/enic_res.c\n+++ b/drivers/net/enic/enic_res.c\n@@ -21,8 +21,9 @@\n #include \"enic_res.h\"\n #include \"enic.h\"\n \n-int enic_get_vnic_config(struct enic *enic)\n+int enic_get_vnic_config(struct rte_eth_dev *eth_dev)\n {\n+  struct enic *enic = pmd_priv(eth_dev);\n \tstruct vnic_enet_config *c = &enic->config;\n \tint err;\n \n@@ -68,7 +69,7 @@ int enic_get_vnic_config(struct enic *enic)\n \tif (c->mtu == 0)\n \t\tc->mtu = 1500;\n \n-\tenic->rte_dev->data->mtu = min_t(u16, enic->max_mtu,\n+\teth_dev->data->mtu = min_t(u16, enic->max_mtu,\n \t\t\t\t\t max_t(u16, ENIC_MIN_MTU, c->mtu));\n \n \tenic->adv_filters = vnic_dev_capable_adv_filters(enic->vdev);\n@@ -118,7 +119,7 @@ int enic_get_vnic_config(struct enic *enic)\n \t\tenic->mac_addr[0], enic->mac_addr[1], enic->mac_addr[2],\n \t\tenic->mac_addr[3], enic->mac_addr[4], enic->mac_addr[5],\n \t\tc->wq_desc_count, c->rq_desc_count,\n-\t\tenic->rte_dev->data->mtu, enic->max_mtu);\n+\t\teth_dev->data->mtu, enic->max_mtu);\n \tdev_info(enic_get_dev(enic), \"vNIC csum tx/rx %s/%s \"\n \t\t\"rss %s intr mode %s type %s timer %d usec \"\n \t\t\"loopback tag 0x%04x\\n\",\ndiff --git a/drivers/net/enic/enic_res.h b/drivers/net/enic/enic_res.h\nindex faaaad9bd..ffe918a32 100644\n--- a/drivers/net/enic/enic_res.h\n+++ b/drivers/net/enic/enic_res.h\n@@ -58,15 +58,15 @@\n \n struct enic;\n \n-int enic_get_vnic_config(struct enic *);\n+int enic_get_vnic_config(struct rte_eth_dev *eth_dev);\n int enic_set_nic_cfg(struct enic *enic, u8 rss_default_cpu, u8 rss_hash_type,\n \tu8 rss_hash_bits, u8 rss_base_cpu, u8 rss_enable, u8 tso_ipid_split_en,\n \tu8 ig_vlan_strip_en);\n int enic_set_rss_key(struct enic *enic, dma_addr_t key_pa, u64 len);\n int enic_set_rss_cpu(struct enic *enic, dma_addr_t cpu_pa, u64 len);\n void enic_get_res_counts(struct enic *enic);\n-void enic_init_vnic_resources(struct enic *enic);\n-int enic_alloc_vnic_resources(struct enic *);\n+void enic_init_vnic_resources(struct rte_eth_dev *eth_dev);\n+//int enic_alloc_vnic_resources(struct enic *);\n void enic_free_vnic_resources(struct enic *);\n \n #endif /* _ENIC_RES_H_ */\ndiff --git a/drivers/net/enic/enic_rxtx_vec_avx2.c b/drivers/net/enic/enic_rxtx_vec_avx2.c\nindex 517d4092f..fc31126e2 100644\n--- a/drivers/net/enic/enic_rxtx_vec_avx2.c\n+++ b/drivers/net/enic/enic_rxtx_vec_avx2.c\n@@ -806,12 +806,11 @@ enic_noscatter_vec_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts,\n }\n \n bool\n-enic_use_vector_rx_handler(struct enic *enic)\n+enic_use_vector_rx_handler(struct rte_eth_dev *eth_dev)\n {\n-\tstruct rte_eth_dev *eth_dev;\n \tstruct rte_fdir_conf *fconf;\n+\tstruct enic *enic = pmd_priv(eth_dev);\n \n-\teth_dev = enic->rte_dev;\n \t/* User needs to request for the avx2 handler */\n \tif (!enic->enable_avx2_rx)\n \t\treturn false;\n",
    "prefixes": [
        "1/1"
    ]
}