From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0AA72A0C52 for ; Mon, 16 Aug 2021 11:03:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 01ED14003C; Mon, 16 Aug 2021 11:03:03 +0200 (CEST) Received: from smtp-relay-canonical-0.canonical.com (smtp-relay-canonical-0.canonical.com [185.125.188.120]) by mails.dpdk.org (Postfix) with ESMTP id 7C8A94003C for ; Mon, 16 Aug 2021 11:03:01 +0200 (CEST) Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-0.canonical.com (Postfix) with ESMTPS id 44C8B3F0A2 for ; Mon, 16 Aug 2021 09:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1629104581; bh=XadbitfgBO2lL1sRXTTERY7rUg/HzvnpqPg24gmE/H4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=v6bImMo9zbqKEQznSv7cjHVtKCNbkPRTo1VIP3z3xCZ3nZoOTAQbsTcbqdXwOmNTo XRfTne6EW+tSj2b3YVL6KRTZlTKV64sRTV9QBRiPG8O4PhdAvTvUJkRxXm4O4USo6n rfanoUkcIGxnipECDVZksnzKAsBtuS9Lz8Z/MC7VxQmjoHJOz1CbINs0yFpBIS5At2 GBrPbnCIl25Y0XHdL8mDKmrckYaTJ7/Lbwgzjylzg7kOOyYmiYHpdrNSCmdtCNEC+C hL/gQQMAlJ+OTI5TFB+1w7tOR4+PltncWPKwhFXqFrSzPbdvbINY8M6UT4EUYl8bkt D9Wn2oIGb3qow== Received: by mail-qv1-f71.google.com with SMTP id l16-20020a0cc2100000b029035a3d6757b3so11507896qvh.14 for ; Mon, 16 Aug 2021 02:03:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XadbitfgBO2lL1sRXTTERY7rUg/HzvnpqPg24gmE/H4=; b=Wn5cuKELwAhea0JPQzocTwTrf88fZhfSJd4sESEnn3s9+CsNvau2jCrpp3xoQpYFLN F13sDM/bas3483G4o5IG7HsbwzBOrurvBK/Tu7Uc3SdrwNCwl3/2b1WTZ6yyxjqRcVc5 6lWd0TlOP8q7LmJYGepgmJgoIpTdKcg9ZRI2nZP4nV9fWKbFZNSMxhP6RFUN/mtMhxyJ DqmFi609BF+9tYUY2Lifkv4k3HYjqh/x9i0cGW+FQ5ZLCOaAVBfuPZ22piT0Akq4jdHW U+YdnIqodWL3whwNE6pcUW0ch3i5658QHzV+WO3SXiJtHV9rB7tSw69mkY7J0IfB3FzU 39aw== X-Gm-Message-State: AOAM531D1KeSEBasczC4JdnT9rtfo87ehgfGJ3C/MEkv6NWYe3l7ejrK YwOXmSMZKCZBfTYotNbsXlfUve+ICE0zjxjbQMpdAOAGpeffhOw+cxbcZi2UwjaVgNfsWTcA8w0 gruTvNew8DSlK7XXXwwz6lb3w7O89a0sWqKWk6CK/ X-Received: by 2002:ac8:4cc8:: with SMTP id l8mr12939453qtv.336.1629104580355; Mon, 16 Aug 2021 02:03:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypMJ3XaXnezXtmy7RNsWg3yvBs+1mOvOfbEuRNXO12DkFw/DPvUwHnQLaBxymSX7Cuf53COvuEu7KJnDf49ZA= X-Received: by 2002:ac8:4cc8:: with SMTP id l8mr12939431qtv.336.1629104580083; Mon, 16 Aug 2021 02:03:00 -0700 (PDT) MIME-Version: 1.0 References: <20210816063525.130016-1-dapengx.yu@intel.com> In-Reply-To: <20210816063525.130016-1-dapengx.yu@intel.com> From: Christian Ehrhardt Date: Mon, 16 Aug 2021 11:02:29 +0200 Message-ID: To: "Yu, DapengX" Cc: dpdk stable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-stable] [PATCH 19.11] net/i40e: fix multi-process shared data X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" On Mon, Aug 16, 2021 at 8:35 AM wrote: > > From: Dapeng Yu > > [ upstream commit e391a7b7f815795eacfae3240c4405353cf37a53 ] Thanks, applied > The rte_eth_devices array is not in share memory, it should not be > referenced by i40e_adapter which is shared by primary and secondary. > Any process set i40e_adapter->eth_dev will corrupt another process's > context. > > The patch removed the field "eth_dev" from i40e_adapter. > Now, when the data paths try to access the rte_eth_dev_data instance, > they should replace adapter->eth_dev->data with adapter->pf.dev_data. > > Fixes: 4861cde46116 ("i40e: new poll mode driver") > > Signed-off-by: Dapeng Yu > --- > drivers/net/i40e/i40e_ethdev.c | 40 +++++++++++++------------- > drivers/net/i40e/i40e_ethdev.h | 7 +++-- > drivers/net/i40e/i40e_fdir.c | 2 +- > drivers/net/i40e/i40e_flow.c | 2 +- > drivers/net/i40e/i40e_rxtx.c | 4 +-- > drivers/net/i40e/i40e_vf_representor.c | 37 +++++++++++++----------- > 6 files changed, 48 insertions(+), 44 deletions(-) > > diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c > index d825ef7296..33d0789930 100644 > --- a/drivers/net/i40e/i40e_ethdev.c > +++ b/drivers/net/i40e/i40e_ethdev.c > @@ -741,10 +741,11 @@ i40e_write_global_rx_ctl(struct i40e_hw *hw, uint32_t reg_addr, > uint32_t reg_val) > { > uint32_t ori_reg_val; > - struct rte_eth_dev *dev; > + struct rte_eth_dev_data *dev_data = > + ((struct i40e_adapter *)hw->back)->pf.dev_data; > + struct rte_eth_dev *dev = &rte_eth_devices[dev_data->port_id]; > > ori_reg_val = i40e_read_rx_ctl(hw, reg_addr); > - dev = ((struct i40e_adapter *)hw->back)->eth_dev; > i40e_write_rx_ctl(hw, reg_addr, reg_val); > if (ori_reg_val != reg_val) > PMD_DRV_LOG(WARNING, > @@ -1231,7 +1232,9 @@ i40e_aq_debug_write_global_register(struct i40e_hw *hw, > struct i40e_asq_cmd_details *cmd_details) > { > uint64_t ori_reg_val; > - struct rte_eth_dev *dev; > + struct rte_eth_dev_data *dev_data = > + ((struct i40e_adapter *)hw->back)->pf.dev_data; > + struct rte_eth_dev *dev = &rte_eth_devices[dev_data->port_id]; > int ret; > > ret = i40e_aq_debug_read_register(hw, reg_addr, &ori_reg_val, NULL); > @@ -1241,7 +1244,6 @@ i40e_aq_debug_write_global_register(struct i40e_hw *hw, > reg_addr); > return -EIO; > } > - dev = ((struct i40e_adapter *)hw->back)->eth_dev; > > if (ori_reg_val != reg_val) > PMD_DRV_LOG(WARNING, > @@ -1411,7 +1413,6 @@ eth_i40e_dev_init(struct rte_eth_dev *dev, void *init_params __rte_unused) > rte_eth_copy_pci_info(dev, pci_dev); > > pf->adapter = I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); > - pf->adapter->eth_dev = dev; > pf->dev_data = dev->data; > > hw->back = I40E_PF_TO_ADAPTER(pf); > @@ -1931,7 +1932,7 @@ i40e_dev_configure(struct rte_eth_dev *dev) > void > i40e_vsi_queues_unbind_intr(struct i40e_vsi *vsi) > { > - struct rte_eth_dev *dev = vsi->adapter->eth_dev; > + struct rte_eth_dev *dev = I40E_VSI_TO_ETH_DEV(vsi); > struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); > struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; > struct i40e_hw *hw = I40E_VSI_TO_HW(vsi); > @@ -2047,7 +2048,7 @@ __vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t msix_vect, > int > i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) > { > - struct rte_eth_dev *dev = vsi->adapter->eth_dev; > + struct rte_eth_dev *dev = I40E_VSI_TO_ETH_DEV(vsi); > struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); > struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; > struct i40e_hw *hw = I40E_VSI_TO_HW(vsi); > @@ -2123,7 +2124,7 @@ i40e_vsi_queues_bind_intr(struct i40e_vsi *vsi, uint16_t itr_idx) > void > i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi) > { > - struct rte_eth_dev *dev = vsi->adapter->eth_dev; > + struct rte_eth_dev *dev = I40E_VSI_TO_ETH_DEV(vsi); > struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); > struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; > struct i40e_hw *hw = I40E_VSI_TO_HW(vsi); > @@ -2150,7 +2151,7 @@ i40e_vsi_enable_queues_intr(struct i40e_vsi *vsi) > void > i40e_vsi_disable_queues_intr(struct i40e_vsi *vsi) > { > - struct rte_eth_dev *dev = vsi->adapter->eth_dev; > + struct rte_eth_dev *dev = I40E_VSI_TO_ETH_DEV(vsi); > struct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev); > struct rte_intr_handle *intr_handle = &pci_dev->intr_handle; > struct i40e_hw *hw = I40E_VSI_TO_HW(vsi); > @@ -6467,8 +6468,7 @@ i40e_dev_tx_init(struct i40e_pf *pf) > break; > } > if (ret == I40E_SUCCESS) > - i40e_set_tx_function(container_of(pf, struct i40e_adapter, pf) > - ->eth_dev); > + i40e_set_tx_function(&rte_eth_devices[pf->dev_data->port_id]); > > return ret; > } > @@ -6496,8 +6496,7 @@ i40e_dev_rx_init(struct i40e_pf *pf) > } > } > if (ret == I40E_SUCCESS) > - i40e_set_rx_function(container_of(pf, struct i40e_adapter, pf) > - ->eth_dev); > + i40e_set_rx_function(&rte_eth_devices[pf->dev_data->port_id]); > > return ret; > } > @@ -7978,7 +7977,7 @@ i40e_status_code i40e_replace_mpls_l1_filter(struct i40e_pf *pf) > struct i40e_aqc_replace_cloud_filters_cmd filter_replace; > struct i40e_aqc_replace_cloud_filters_cmd_buf filter_replace_buf; > struct i40e_hw *hw = I40E_PF_TO_HW(pf); > - struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev; > + struct rte_eth_dev *dev = &rte_eth_devices[pf->dev_data->port_id]; > enum i40e_status_code status = I40E_SUCCESS; > > if (pf->support_multi_driver) { > @@ -8039,7 +8038,7 @@ i40e_status_code i40e_replace_mpls_cloud_filter(struct i40e_pf *pf) > struct i40e_aqc_replace_cloud_filters_cmd filter_replace; > struct i40e_aqc_replace_cloud_filters_cmd_buf filter_replace_buf; > struct i40e_hw *hw = I40E_PF_TO_HW(pf); > - struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev; > + struct rte_eth_dev *dev = &rte_eth_devices[pf->dev_data->port_id]; > enum i40e_status_code status = I40E_SUCCESS; > > if (pf->support_multi_driver) { > @@ -8114,7 +8113,7 @@ i40e_replace_gtp_l1_filter(struct i40e_pf *pf) > struct i40e_aqc_replace_cloud_filters_cmd filter_replace; > struct i40e_aqc_replace_cloud_filters_cmd_buf filter_replace_buf; > struct i40e_hw *hw = I40E_PF_TO_HW(pf); > - struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev; > + struct rte_eth_dev *dev = &rte_eth_devices[pf->dev_data->port_id]; > enum i40e_status_code status = I40E_SUCCESS; > > if (pf->support_multi_driver) { > @@ -8202,7 +8201,7 @@ i40e_status_code i40e_replace_gtp_cloud_filter(struct i40e_pf *pf) > struct i40e_aqc_replace_cloud_filters_cmd filter_replace; > struct i40e_aqc_replace_cloud_filters_cmd_buf filter_replace_buf; > struct i40e_hw *hw = I40E_PF_TO_HW(pf); > - struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev; > + struct rte_eth_dev *dev = &rte_eth_devices[pf->dev_data->port_id]; > enum i40e_status_code status = I40E_SUCCESS; > > if (pf->support_multi_driver) { > @@ -9782,9 +9781,10 @@ void > i40e_check_write_global_reg(struct i40e_hw *hw, uint32_t addr, uint32_t val) > { > uint32_t reg = i40e_read_rx_ctl(hw, addr); > - struct rte_eth_dev *dev; > + struct rte_eth_dev_data *dev_data = > + ((struct i40e_adapter *)hw->back)->pf.dev_data; > + struct rte_eth_dev *dev = &rte_eth_devices[dev_data->port_id]; > > - dev = ((struct i40e_adapter *)hw->back)->eth_dev; > if (reg != val) { > i40e_write_rx_ctl(hw, addr, val); > PMD_DRV_LOG(WARNING, > @@ -12800,7 +12800,7 @@ i40e_cloud_filter_qinq_create(struct i40e_pf *pf) > struct i40e_aqc_replace_cloud_filters_cmd filter_replace; > struct i40e_aqc_replace_cloud_filters_cmd_buf filter_replace_buf; > struct i40e_hw *hw = I40E_PF_TO_HW(pf); > - struct rte_eth_dev *dev = ((struct i40e_adapter *)hw->back)->eth_dev; > + struct rte_eth_dev *dev = &rte_eth_devices[pf->dev_data->port_id]; > > if (pf->support_multi_driver) { > PMD_DRV_LOG(ERR, "Replace cloud filter is not supported."); > diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h > index 7c97c609f3..666babd8c5 100644 > --- a/drivers/net/i40e/i40e_ethdev.h > +++ b/drivers/net/i40e/i40e_ethdev.h > @@ -88,8 +88,10 @@ > do { \ > uint32_t ori_val; \ > struct rte_eth_dev *dev; \ > + struct rte_eth_dev_data *dev_data; \ > ori_val = I40E_READ_REG((hw), (reg)); \ > - dev = ((struct i40e_adapter *)hw->back)->eth_dev; \ > + dev_data = ((struct i40e_adapter *)hw->back)->pf.dev_data; \ > + dev = &rte_eth_devices[dev_data->port_id]; \ > I40E_PCI_REG_WRITE(I40E_PCI_REG_ADDR((hw), \ > (reg)), (value)); \ > if (ori_val != value) \ > @@ -1101,7 +1103,6 @@ struct i40e_vf { > struct i40e_adapter { > /* Common for both PF and VF */ > struct i40e_hw hw; > - struct rte_eth_dev *eth_dev; > > /* Specific for PF or VF */ > union { > @@ -1352,7 +1353,7 @@ i40e_get_vsi_from_adapter(struct i40e_adapter *adapter) > #define I40E_VSI_TO_DEV_DATA(vsi) \ > (((struct i40e_vsi *)vsi)->adapter->pf.dev_data) > #define I40E_VSI_TO_ETH_DEV(vsi) \ > - (((struct i40e_vsi *)vsi)->adapter->eth_dev) > + (&rte_eth_devices[((struct i40e_vsi *)vsi)->adapter->pf.dev_data->port_id]) > > /* I40E_PF_TO */ > #define I40E_PF_TO_HW(pf) \ > diff --git a/drivers/net/i40e/i40e_fdir.c b/drivers/net/i40e/i40e_fdir.c > index fb9f2c0fce..cf206e8274 100644 > --- a/drivers/net/i40e/i40e_fdir.c > +++ b/drivers/net/i40e/i40e_fdir.c > @@ -156,7 +156,7 @@ i40e_fdir_setup(struct i40e_pf *pf) > int err = I40E_SUCCESS; > char z_name[RTE_MEMZONE_NAMESIZE]; > const struct rte_memzone *mz = NULL; > - struct rte_eth_dev *eth_dev = pf->adapter->eth_dev; > + struct rte_eth_dev *eth_dev = &rte_eth_devices[pf->dev_data->port_id]; > > if ((pf->flags & I40E_FLAG_FDIR) == 0) { > PMD_INIT_LOG(ERR, "HW doesn't support FDIR"); > diff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c > index e8a52bdb76..b43f27d354 100644 > --- a/drivers/net/i40e/i40e_flow.c > +++ b/drivers/net/i40e/i40e_flow.c > @@ -4917,7 +4917,7 @@ i40e_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *error) > static int > i40e_flow_flush_fdir_filter(struct i40e_pf *pf) > { > - struct rte_eth_dev *dev = pf->adapter->eth_dev; > + struct rte_eth_dev *dev = &rte_eth_devices[pf->dev_data->port_id]; > struct i40e_fdir_info *fdir_info = &pf->fdir; > struct i40e_fdir_filter *fdir_filter; > enum i40e_filter_pctype pctype; > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c > index 4dc828357f..2c969013fd 100644 > --- a/drivers/net/i40e/i40e_rxtx.c > +++ b/drivers/net/i40e/i40e_rxtx.c > @@ -2845,7 +2845,7 @@ i40e_fdir_setup_tx_resources(struct i40e_pf *pf) > return I40E_ERR_BAD_PTR; > } > > - dev = pf->adapter->eth_dev; > + dev = &rte_eth_devices[pf->dev_data->port_id]; > > /* Allocate the TX queue data structure. */ > txq = rte_zmalloc_socket("i40e fdir tx queue", > @@ -2901,7 +2901,7 @@ i40e_fdir_setup_rx_resources(struct i40e_pf *pf) > return I40E_ERR_BAD_PTR; > } > > - dev = pf->adapter->eth_dev; > + dev = &rte_eth_devices[pf->dev_data->port_id]; > > /* Allocate the RX queue data structure. */ > rxq = rte_zmalloc_socket("i40e fdir rx queue", > diff --git a/drivers/net/i40e/i40e_vf_representor.c b/drivers/net/i40e/i40e_vf_representor.c > index 083bc1a5f3..40065e1524 100644 > --- a/drivers/net/i40e/i40e_vf_representor.c > +++ b/drivers/net/i40e/i40e_vf_representor.c > @@ -18,15 +18,18 @@ i40e_vf_representor_link_update(struct rte_eth_dev *ethdev, > int wait_to_complete) > { > struct i40e_vf_representor *representor = ethdev->data->dev_private; > + struct rte_eth_dev *dev = > + &rte_eth_devices[representor->adapter->pf.dev_data->port_id]; > > - return i40e_dev_link_update(representor->adapter->eth_dev, > - wait_to_complete); > + return i40e_dev_link_update(dev, wait_to_complete); > } > static int > i40e_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev, > struct rte_eth_dev_info *dev_info) > { > struct i40e_vf_representor *representor = ethdev->data->dev_private; > + struct rte_eth_dev_data *pf_dev_data = > + representor->adapter->pf.dev_data; > > /* get dev info for the vdev */ > dev_info->device = ethdev->device; > @@ -98,7 +101,7 @@ i40e_vf_representor_dev_infos_get(struct rte_eth_dev *ethdev, > }; > > dev_info->switch_info.name = > - representor->adapter->eth_dev->device->name; > + rte_eth_devices[pf_dev_data->port_id].device->name; > dev_info->switch_info.domain_id = representor->switch_domain_id; > dev_info->switch_info.port_id = representor->vf_id; > > @@ -211,7 +214,7 @@ i40e_vf_representor_stats_get(struct rte_eth_dev *ethdev, > int ret; > > ret = rte_pmd_i40e_get_vf_native_stats( > - representor->adapter->eth_dev->data->port_id, > + representor->adapter->pf.dev_data->port_id, > representor->vf_id, &native_stats); > if (ret == 0) { > i40evf_stat_update_48( > @@ -271,7 +274,7 @@ i40e_vf_representor_stats_reset(struct rte_eth_dev *ethdev) > struct i40e_vf_representor *representor = ethdev->data->dev_private; > > return rte_pmd_i40e_get_vf_native_stats( > - representor->adapter->eth_dev->data->port_id, > + representor->adapter->pf.dev_data->port_id, > representor->vf_id, &representor->stats_offset); > } > > @@ -281,7 +284,7 @@ i40e_vf_representor_promiscuous_enable(struct rte_eth_dev *ethdev) > struct i40e_vf_representor *representor = ethdev->data->dev_private; > > return rte_pmd_i40e_set_vf_unicast_promisc( > - representor->adapter->eth_dev->data->port_id, > + representor->adapter->pf.dev_data->port_id, > representor->vf_id, 1); > } > > @@ -291,7 +294,7 @@ i40e_vf_representor_promiscuous_disable(struct rte_eth_dev *ethdev) > struct i40e_vf_representor *representor = ethdev->data->dev_private; > > return rte_pmd_i40e_set_vf_unicast_promisc( > - representor->adapter->eth_dev->data->port_id, > + representor->adapter->pf.dev_data->port_id, > representor->vf_id, 0); > } > > @@ -301,7 +304,7 @@ i40e_vf_representor_allmulticast_enable(struct rte_eth_dev *ethdev) > struct i40e_vf_representor *representor = ethdev->data->dev_private; > > return rte_pmd_i40e_set_vf_multicast_promisc( > - representor->adapter->eth_dev->data->port_id, > + representor->adapter->pf.dev_data->port_id, > representor->vf_id, 1); > } > > @@ -311,7 +314,7 @@ i40e_vf_representor_allmulticast_disable(struct rte_eth_dev *ethdev) > struct i40e_vf_representor *representor = ethdev->data->dev_private; > > return rte_pmd_i40e_set_vf_multicast_promisc( > - representor->adapter->eth_dev->data->port_id, > + representor->adapter->pf.dev_data->port_id, > representor->vf_id, 0); > } > > @@ -321,7 +324,7 @@ i40e_vf_representor_mac_addr_remove(struct rte_eth_dev *ethdev, uint32_t index) > struct i40e_vf_representor *representor = ethdev->data->dev_private; > > rte_pmd_i40e_remove_vf_mac_addr( > - representor->adapter->eth_dev->data->port_id, > + representor->adapter->pf.dev_data->port_id, > representor->vf_id, ðdev->data->mac_addrs[index]); > } > > @@ -332,7 +335,7 @@ i40e_vf_representor_mac_addr_set(struct rte_eth_dev *ethdev, > struct i40e_vf_representor *representor = ethdev->data->dev_private; > > return rte_pmd_i40e_set_vf_mac_addr( > - representor->adapter->eth_dev->data->port_id, > + representor->adapter->pf.dev_data->port_id, > representor->vf_id, mac_addr); > } > > @@ -344,7 +347,7 @@ i40e_vf_representor_vlan_filter_set(struct rte_eth_dev *ethdev, > uint64_t vf_mask = 1ULL << representor->vf_id; > > return rte_pmd_i40e_set_vf_vlan_filter( > - representor->adapter->eth_dev->data->port_id, > + representor->adapter->pf.dev_data->port_id, > vlan_id, vf_mask, on); > } > > @@ -358,7 +361,7 @@ i40e_vf_representor_vlan_offload_set(struct rte_eth_dev *ethdev, int mask) > struct i40e_pf *pf; > uint32_t vfid; > > - pdev = representor->adapter->eth_dev; > + pdev = &rte_eth_devices[representor->adapter->pf.dev_data->port_id]; > vfid = representor->vf_id; > > if (!is_i40e_supported(pdev)) { > @@ -408,7 +411,7 @@ i40e_vf_representor_vlan_strip_queue_set(struct rte_eth_dev *ethdev, > struct i40e_vf_representor *representor = ethdev->data->dev_private; > > rte_pmd_i40e_set_vf_vlan_stripq( > - representor->adapter->eth_dev->data->port_id, > + representor->adapter->pf.dev_data->port_id, > representor->vf_id, on); > } > > @@ -419,7 +422,7 @@ i40e_vf_representor_vlan_pvid_set(struct rte_eth_dev *ethdev, uint16_t vlan_id, > struct i40e_vf_representor *representor = ethdev->data->dev_private; > > return rte_pmd_i40e_set_vf_vlan_insert( > - representor->adapter->eth_dev->data->port_id, > + representor->adapter->pf.dev_data->port_id, > representor->vf_id, vlan_id); > } > > @@ -485,7 +488,7 @@ i40e_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params) > ((struct i40e_vf_representor *)init_params)->adapter; > > pf = I40E_DEV_PRIVATE_TO_PF( > - representor->adapter->eth_dev->data->dev_private); > + representor->adapter->pf.dev_data->dev_private); > > if (representor->vf_id >= pf->vf_num) > return -ENODEV; > @@ -516,7 +519,7 @@ i40e_vf_representor_init(struct rte_eth_dev *ethdev, void *init_params) > ethdev->data->mac_addrs = &vf->mac_addr; > > /* Link state. Inherited from PF */ > - link = &representor->adapter->eth_dev->data->dev_link; > + link = &representor->adapter->pf.dev_data->dev_link; > > ethdev->data->dev_link.link_speed = link->link_speed; > ethdev->data->dev_link.link_duplex = link->link_duplex; > -- > 2.27.0 > -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd