From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f52.google.com (mail-pa0-f52.google.com [209.85.220.52]) by dpdk.org (Postfix) with ESMTP id 64A73B674 for ; Tue, 17 Feb 2015 07:15:42 +0100 (CET) Received: by pabrd3 with SMTP id rd3so3923521pab.4 for ; Mon, 16 Feb 2015 22:15:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=ZVT9O00XkSSs6t6+70sLap6Ztx+OIAoUYm1RK2NLcuA=; b=Sy+VTVQAHAknt/kW+Ay1a1EPgeL4BHOPLHbStsTUEsOKNvnMa89tDi2sTI7OWWRxG1 xXVLKRKSMWtuacazUWMgwXWLdh1fp+Iq5aflxpkZJ5mUplutHJPS4qhlEU0M0gCJyxM0 5stu7Naeblrqqo5DIWDZAwkGQFOL40HrsAiIu0dgVh4WLOn9P4UrOXFHdG91Q3qOUyYI RrWm0A+Sy7Hp5p0MarptqzXiK1r4PBxC1oGwTQIVtOQOdnK1QXPHHpa/Vbcc55SySTD7 FDnSCVeUzZc6DYz1MtNe0vHzLu9HRTAZhAt8IzJOQ0UVUUMvZ5juiZRHW4Ws/9Yg1OIu X5Bw== X-Gm-Message-State: ALoCoQnDU84zPT3jSdUuHBQyX+KbBjF68q/bYTX98glqWpUvwp2ztR5RUomoHGwpTSJalb06QStQ X-Received: by 10.68.57.162 with SMTP id j2mr45415461pbq.120.1424153741846; Mon, 16 Feb 2015 22:15:41 -0800 (PST) Received: from [10.16.129.101] (napt.igel.co.jp. [219.106.231.132]) by mx.google.com with ESMTPSA id v14sm16474402pbs.11.2015.02.16.22.15.40 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 16 Feb 2015 22:15:41 -0800 (PST) Message-ID: <54E2DC8B.8030102@igel.co.jp> Date: Tue, 17 Feb 2015 15:15:39 +0900 From: Tetsuya Mukawa User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Thomas Monjalon 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> In-Reply-To: <2049023.kebHdKAVjA@xps13> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v8 10/14] eal/pci: Cleanup pci driver initialization code X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2015 06:15:42 -0000 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.=