[dpdk-dev] [PATCH v3 21/29] ethdev: remove old close behaviour

Wang, Haiyue haiyue.wang at intel.com
Tue Sep 29 04:27:34 CEST 2020


> -----Original Message-----
> From: Thomas Monjalon <thomas at monjalon.net>
> Sent: Tuesday, September 29, 2020 07:14
> To: dev at dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit at intel.com>; arybchenko at solarflare.com; Shijith Thotton
> <sthotton at marvell.com>; Srisivasubramanian Srinivasan <srinivasan at marvell.com>; Heinrich Kuhn
> <heinrich.kuhn at netronome.com>; Alfredo Cardigliano <cardigliano at ntop.org>; Liron Himi
> <lironh at marvell.com>; Ray Kinsella <mdr at ashroe.eu>; Neil Horman <nhorman at tuxdriver.com>; John W.
> Linville <linville at tuxdriver.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>; Igor Russkikh
> <igor.russkikh at aquantia.com>; Pavel Belous <pavel.belous at aquantia.com>; Steven Webster
> <steven.webster at windriver.com>; Matt Peters <matt.peters at windriver.com>; Somalapuram Amaranath
> <asomalap at amd.com>; Rasesh Mody <rmody at marvell.com>; Shahed Shaikh <shshaikh at marvell.com>; Ajit
> Khaparde <ajit.khaparde at broadcom.com>; Somnath Kotur <somnath.kotur at broadcom.com>; Chas Williams
> <chas3 at att.com>; Wei Hu (Xavier) <xavier.huwei at huawei.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>; Gaetan Rivet
> <grive at u256.net>; 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>; Min Hu (Connor)
> <humin29 at huawei.com>; Yisen Zhuang <yisen.zhuang at huawei.com>; Xing, Beilei <beilei.xing at intel.com>; Wu,
> Jingjing <jingjing.wu at intel.com>; Yang, Qiming <qiming.yang at intel.com>; Jakub Grajciar
> <jgrajcia at cisco.com>; Matan Azrad <matan at nvidia.com>; Shahaf Shuler <shahafs at nvidia.com>; Viacheslav
> Ovsiienko <viacheslavo at nvidia.com>; Zyta Szpak <zr at semihalf.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>; Tetsuya Mukawa
> <mtetsuyah at gmail.com>; Harman Kalra <hkalra at marvell.com>; Jerin Jacob <jerinj at marvell.com>; Nithin
> Dabilpuram <ndabilpuram at marvell.com>; Kiran Kumar K <kirankumark at marvell.com>; Akhil Goyal
> <akhil.goyal at nxp.com>; Richardson, Bruce <bruce.richardson at intel.com>; Singh, Jasvinder
> <jasvinder.singh at intel.com>; Dumitrescu, Cristian <cristian.dumitrescu at intel.com>; Wiles, Keith
> <keith.wiles at intel.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>
> Subject: [PATCH v3 21/29] ethdev: remove old close behaviour
> 
> The temporary flag RTE_ETH_DEV_CLOSE_REMOVE is removed.
> It was introduced in DPDK 18.11 in order to give time for PMDs to migrate.
> 
> The old behaviour was to free only queues when closing a port.
> The new behaviour is calling rte_eth_dev_release_port() which does
> three more tasks:
> 	- trigger event callback
> 	- reset state and few pointers
> 	- free all generic port resources
> 
> The private port resources must be released in the .dev_close callback.
> 
> The .remove callback should:
> 	- call .dev_close callback
> 	- call rte_eth_dev_release_port()
> 	- free multi-port device shared resources
> 
> Despite waiting two years, some drivers have not migrated,
> so they may hit issues with the incompatible new behaviour.
> After sending emails, adding logs, and announcing the deprecation,
> the only last solution is to declare these drivers as unmaintained:
> 	ionic, liquidio, nfp
> Below is a summary of what to implement in those drivers.
> 
> * The freeing of private port resources must be moved
> from the ".remove(device)" function to the ".dev_close(port)" function.
> 
> * If a generic resource (.mac_addrs or .hash_mac_addrs) cannot be freed,
> it must be set to NULL in ".dev_close" function to protect from
> subsequent rte_eth_dev_release_port() freeing.
> 
> * Note 1:
> The generic resources are freed in rte_eth_dev_release_port(),
> after ".dev_close" is called in rte_eth_dev_close(), but not when
> calling ".dev_close" directly from the ".remove" PMD function.
> That's why rte_eth_dev_release_port() must still be called explicitly
> from ".remove(device)" after calling the ".dev_close" PMD function.
> 
> * Note 2:
> If a device can have multiple ports, the common resources must be freed
> only in the ".remove(device)" function.
> 
> * Note 3:
> The port is supposed to be in a stopped state when it is closed.
> If it is not the case, it is free to the PMD implementation
> how to react when trying to close a non-stopped port:
> either try to stop it automatically or just return an error.
> 
> Cc: Shijith Thotton <sthotton at marvell.com>
> Cc: Srisivasubramanian Srinivasan <srinivasan at marvell.com>
> Cc: Heinrich Kuhn <heinrich.kuhn at netronome.com>
> Cc: Alfredo Cardigliano <cardigliano at ntop.org>
> 
> Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> Reviewed-by: Liron Himi <lironh at marvell.com>
> ---

>  drivers/net/e1000/em_ethdev.c             |  5 -----
>  drivers/net/e1000/igb_ethdev.c            | 10 ----------
>  drivers/net/igc/igc_ethdev.c              |  5 -----
>  drivers/net/ixgbe/ixgbe_ethdev.c          | 10 ----------

For e1000/igc/ixgbe

Reviewed-by: Haiyue Wang <haiyue.wang at intel.com>

> 2.28.0



More information about the dev mailing list