From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tetsuya Mukawa Subject: Re: [PATCH v8 10/14] eal/pci: Cleanup pci driver initialization code Date: Tue, 17 Feb 2015 15:15:39 +0900 Message-ID: <54E2DC8B.8030102@igel.co.jp> References: <1423470639-15744-2-git-send-email-mukawa@igel.co.jp> <1424060073-23484-1-git-send-email-mukawa@igel.co.jp> <1424060073-23484-11-git-send-email-mukawa@igel.co.jp> <2049023.kebHdKAVjA@xps13> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: dev-VfR2kkLFssw@public.gmane.org To: Thomas Monjalon Return-path: In-Reply-To: <2049023.kebHdKAVjA@xps13> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" On 2015/02/17 10:18, Thomas Monjalon wrote: > 2015-02-16 13:14, Tetsuya Mukawa: >> - Add rte_eal_pci_close_one_dirver() >> The function is used for closing the specified driver and device. >> - Add pci_invoke_all_drivers() >> The function is based on pci_probe_all_drivers. But it can not only >> probe but also close drivers. >> - Add pci_close_all_drivers() >> The function tries to find a driver for the specified device, and >> then close the driver. >> - Add rte_eal_pci_probe_one() and rte_eal_pci_close_one() >> The functions are used for probe and close a device. >> First the function tries to find a device that has the specified >> PCI address. Then, probe or close the device. >> >> v5: >> - Remove RTE_EAL_INVOKE_TYPE_UNKNOWN, because it's unused. >> v4: >> - Fix parameter checking. >> - Fix indent of 'if' statement. >> >> Signed-off-by: Tetsuya Mukawa >> --- >> lib/librte_eal/common/eal_common_pci.c | 90 ++++++++++++++++++++++++= +++++---- >> lib/librte_eal/common/eal_private.h | 24 +++++++++ >> lib/librte_eal/common/include/rte_pci.h | 33 ++++++++++++ >> lib/librte_eal/linuxapp/eal/eal_pci.c | 69 ++++++++++++++++++++++++= + >> 4 files changed, 206 insertions(+), 10 deletions(-) > 206 insertions and 10 deletions: it cannot really be a cleanup ;) > Maybe the title should be reworded. I will reword the tile. > > [...] >> - rc =3D rte_eal_pci_probe_one_driver(dr, dev); >> + switch (type) { >> + case RTE_EAL_INVOKE_TYPE_PROBE: >> + rc =3D rte_eal_pci_probe_one_driver(dr, dev); >> + break; >> + case RTE_EAL_INVOKE_TYPE_CLOSE: >> + rc =3D rte_eal_pci_close_one_driver(dr, dev); >> + break; > Honestly, I don't like this kind of functions with a switch to toggle > different actions. It makes code unclear. > Sure, I will remove such a toggle. Probably I will separate the function.=