From mboxrd@z Thu Jan 1 00:00:00 1970 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) Received: from uucp by smtp.tuxdriver.com with local-rmail (Exim 4.63) (envelope-from ) id 1aTZWm-0002Dg-A7; Wed, 10 Feb 2016 13:30:12 -0500 Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.15.2/8.14.6) with ESMTP id u1AIPEnb017679; Wed, 10 Feb 2016 13:25:14 -0500 Received: (from linville@localhost) by localhost.localdomain (8.15.2/8.15.2/Submit) id u1AIPDWN017678; Wed, 10 Feb 2016 13:25:13 -0500 Date: Wed, 10 Feb 2016 13:25:13 -0500 From: "John W. Linville" To: Wojciech =?utf-8?B?xbttdWRh?= 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] af_packet: make the device detachable 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: Wed, 10 Feb 2016 18:30:16 -0000 On Wed, Feb 10, 2016 at 04:42:53PM +0100, Wojciech Żmuda 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: > > /** > * For use by the EAL only. Called as part of EAL init to set up any dummy NICs > * configured on command line. > */ > int rte_pmd_af_packet_devinit(const char *name, const char *params); > > 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 -- John W. Linville Someday the world will need a hero, and you linville@tuxdriver.com might be all we have. Be ready.