[dpdk-dev] [PATCH v2 19/25] drivers/net: check process type in close operation

Xu, Rosen rosen.xu at intel.com
Mon Sep 28 02:50:08 CEST 2020


Hi,

> -----Original Message-----
> From: Thomas Monjalon <thomas at monjalon.net>
> Sent: Monday, September 28, 2020 7:43
> To: dev at dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit at intel.com>; arybchenko at solarflare.com;
> Loftus, Ciara <ciara.loftus at intel.com>; Zhang, Qi Z <qi.z.zhang at intel.com>;
> Shepard Siegel <shepard.siegel at atomicrules.com>; Ed Czeck
> <ed.czeck at atomicrules.com>; John Miller <john.miller at atomicrules.com>;
> Steven Webster <steven.webster at windriver.com>; Matt Peters
> <matt.peters at windriver.com>; Ajit Khaparde
> <ajit.khaparde at broadcom.com>; Somnath Kotur
> <somnath.kotur at broadcom.com>; Rahul Lakkireddy
> <rahul.lakkireddy at chelsio.com>; Hemant Agrawal
> <hemant.agrawal at nxp.com>; Sachin Saxena <sachin.saxena at oss.nxp.com>;
> Guo, Jia <jia.guo at intel.com>; Wang, Haiyue <haiyue.wang at intel.com>;
> Marcin Wojtas <mw at semihalf.com>; Michal Krawczyk <mk at semihalf.com>;
> Guy Tzalik <gtzalik at amazon.com>; Evgeny Schemeilin
> <evgenys at amazon.com>; Igor Chauskin <igorch at amazon.com>;
> Gagandeep Singh <g.singh at nxp.com>; John Daley <johndale at cisco.com>;
> Hyong Youb Kim <hyonkim at cisco.com>; Wang, Xiao W
> <xiao.w.wang at intel.com>; Ziyang Xuan <xuanziyang2 at huawei.com>;
> Xiaoyun Wang <cloud.wangxiaoyun at huawei.com>; Guoyang Zhou
> <zhouguoyang at huawei.com>; Xing, Beilei <beilei.xing at intel.com>; Wu,
> Jingjing <jingjing.wu at intel.com>; Yang, Qiming <qiming.yang at intel.com>;
> Alfredo Cardigliano <cardigliano at ntop.org>; Xu, Rosen
> <rosen.xu at intel.com>; Shijith Thotton <sthotton at marvell.com>;
> Srisivasubramanian Srinivasan <srinivasan at marvell.com>; Matan Azrad
> <matan at nvidia.com>; Shahaf Shuler <shahafs at nvidia.com>; Zyta Szpak
> <zr at semihalf.com>; Liron Himi <lironh at marvell.com>; Stephen Hemminger
> <sthemmin at microsoft.com>; K. Y. Srinivasan <kys at microsoft.com>;
> Haiyang Zhang <haiyangz at microsoft.com>; Long Li <longli at microsoft.com>;
> Martin Spinler <spinler at cesnet.cz>; Heinrich Kuhn
> <heinrich.kuhn at netronome.com>; Harman Kalra <hkalra at marvell.com>;
> Akhil Goyal <akhil.goyal at nxp.com>; Jerin Jacob <jerinj at marvell.com>;
> Maciej Czekaj <mczekaj at marvell.com>; Maxime Coquelin
> <maxime.coquelin at redhat.com>; Xia, Chenbo <chenbo.xia at intel.com>;
> Wang, Zhihong <zhihong.wang at intel.com>; Yong Wang
> <yongwang at vmware.com>; Burakov, Anatoly <anatoly.burakov at intel.com>
> Subject: [PATCH v2 19/25] drivers/net: check process type in close operation
> 
> The secondary processes are not allowed to release shared resources.
> Only process-private ressources should be freed in a secondary process.
> Most of the time, there is no process-private ressource, so the close
> operation is just forbidden in a secondary process.
> 
> After adding proper check in the port close functions, some redundant
> checks in the device remove functions are dropped.
> 
> Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> ---
>  drivers/net/af_xdp/rte_eth_af_xdp.c     |  3 +++
>  drivers/net/ark/ark_ethdev.c            |  3 +++
>  drivers/net/avp/avp_ethdev.c            |  3 +++
>  drivers/net/bnxt/bnxt_ethdev.c          |  3 +++
>  drivers/net/bnxt/bnxt_reps.c            |  3 +++
>  drivers/net/cxgbe/cxgbe_ethdev.c        |  3 +++
>  drivers/net/dpaa/dpaa_ethdev.c          |  3 +++
>  drivers/net/dpaa2/dpaa2_ethdev.c        |  3 +++
>  drivers/net/e1000/em_ethdev.c           |  3 +++
>  drivers/net/e1000/igb_ethdev.c          |  6 +++++
>  drivers/net/ena/ena_ethdev.c            |  3 +++
>  drivers/net/enetc/enetc_ethdev.c        |  3 +++
>  drivers/net/enic/enic_ethdev.c          |  3 +++
>  drivers/net/fm10k/fm10k_ethdev.c        |  9 ++-----
>  drivers/net/hinic/hinic_pmd_ethdev.c    |  3 +++
>  drivers/net/i40e/i40e_ethdev.c          |  2 ++
>  drivers/net/i40e/i40e_ethdev_vf.c       |  3 +++
>  drivers/net/iavf/iavf_ethdev.c          |  3 +++
>  drivers/net/ice/ice_ethdev.c            |  3 +++
>  drivers/net/igc/igc_ethdev.c            |  6 ++---
>  drivers/net/ionic/ionic_ethdev.c        |  2 ++
>  drivers/net/ipn3ke/ipn3ke_representor.c |  3 +++
>  drivers/net/ixgbe/ixgbe_ethdev.c        |  4 ++++
>  drivers/net/kni/rte_eth_kni.c           |  3 +++
>  drivers/net/liquidio/lio_ethdev.c       |  3 +++
>  drivers/net/mlx4/mlx4.c                 |  2 ++
>  drivers/net/mvneta/mvneta_ethdev.c      |  3 +++
>  drivers/net/mvpp2/mrvl_ethdev.c         |  3 +++
>  drivers/net/netvsc/hn_ethdev.c          |  2 ++
>  drivers/net/nfb/nfb_ethdev.c            |  3 +++
>  drivers/net/nfp/nfp_net.c               |  3 +++
>  drivers/net/octeontx/octeontx_ethdev.c  |  2 ++
>  drivers/net/pfe/pfe_ethdev.c            |  3 +++
>  drivers/net/sfc/sfc_ethdev.c            | 32 ++++++++++++-------------
>  drivers/net/szedata2/rte_eth_szedata2.c |  3 +++
>  drivers/net/thunderx/nicvf_ethdev.c     |  7 +++---
>  drivers/net/vhost/rte_eth_vhost.c       |  7 +++---
>  drivers/net/virtio/virtio_ethdev.c      |  2 ++
>  drivers/net/vmxnet3/vmxnet3_ethdev.c    |  2 ++
>  39 files changed, 125 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/net/ipn3ke/ipn3ke_representor.c
> b/drivers/net/ipn3ke/ipn3ke_representor.c
> index d49abbf758..b9fb4d4e46 100644
> --- a/drivers/net/ipn3ke/ipn3ke_representor.c
> +++ b/drivers/net/ipn3ke/ipn3ke_representor.c
> @@ -214,6 +214,9 @@ ipn3ke_rpst_dev_close(struct rte_eth_dev *dev)
>  	struct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(dev);
>  	struct ipn3ke_rpst *rpst = IPN3KE_DEV_PRIVATE_TO_RPST(dev);
> 
> +	if (rte_eal_process_type() != RTE_PROC_PRIMARY)
> +		return 0;
> +
>  	if (hw->retimer.mac_type ==
> IFPGA_RAWDEV_RETIMER_MAC_TYPE_10GE_XFI) {
>  		/* Disable the TX path */
>  		ipn3ke_xmac_tx_disable(hw, rpst->port_id, 0); diff --git
> 2.28.0

For net/ipn3ke
Reviewed-by: Rosen Xu <rosen.xu at intel.com>


More information about the dev mailing list