From mboxrd@z Thu Jan 1 00:00:00 1970 From: "John W. Linville" Subject: Re: [PATCH v2] af_packet: make the device detachable Date: Wed, 10 Feb 2016 13:25:13 -0500 Message-ID: <20160210182512.GF9266@tuxdriver.com> References: <1452002675-8919-1-git-send-email-woz@semihalf.com> <1455034146-24036-1-git-send-email-woz@semihalf.com> <20160209163731.GA4308@bricha3-MOBL3> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: dev@dpdk.org To: Wojciech =?utf-8?B?xbttdWRh?= Return-path: Received: from smtp.tuxdriver.com (charlotte.tuxdriver.com [70.61.120.58]) by dpdk.org (Postfix) with ESMTP id F24DC56A9 for ; Wed, 10 Feb 2016 19:30:15 +0100 (CET) Content-Disposition: inline In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Feb 10, 2016 at 04:42:53PM +0100, Wojciech =C5=BBmuda wrote: > Bernard, Bruce, I have a question, if I may. Do you know what is the > reason that rte_pmd_af_packet_devinit() is the only non-static device > initialization function among all the dpdk drivers? There's even a > comment in the rte_eth_af_packet.h: >=20 > /** > * For use by the EAL only. Called as part of EAL init to set up any du= mmy NICs > * configured on command line. > */ > int rte_pmd_af_packet_devinit(const char *name, const char *params); >=20 > Despite the comment above, I cannot see this function being called > directly anywhere. Is there any reason it is implemented this way? Or > should I change the definition to static, as it should be called via > proper API functions? The af_packet driver structure was essentially copied from the pcap driver. Way in the past there was the EAL initialization of the "virtual" drivers, and the original af_packet code hooked into that. Somewhere along the way the driver initialization code changed and I guess the EAL initialization bits disappeared. The comment above rte_pmd_af_packet_devinit was overlooked. Long story, short -- I think you can remove the comment and add the static modifier and everything will be fine. John --=20 John W. Linville Someday the world will need a hero, and you linville@tuxdriver.com might be all we have. Be ready.