From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by dpdk.org (Postfix) with ESMTP id 8442668BE for ; Thu, 17 Apr 2014 10:08:31 +0200 (CEST) Received: by mail-wg0-f46.google.com with SMTP id b13so106066wgh.17 for ; Thu, 17 Apr 2014 01:08:32 -0700 (PDT) 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=/4ywkzHiAm8IY06Cugef69F9E32+WBcAI8GlPizUr2s=; b=Jdi7s2Gvdmar/aFmeRIVzv+LkEZcaoYFyms4YTCK12Cnn6jmUbAyhxoYXFiYpquQh0 KFuEvKXhjdPQwJEpv9nYqMPAy6wudkyo9P8P19wyWgB6n3c8Zqt4akm3Mz6xEJfkefh3 JkQRPRPWTQcH1fX8M6jUwAA6LqnIOYGP/wm78qvcoOePydxnc2jJ0S+VVSu64tpkyv9R XlMklKmvQS8DsHhlGDZYx+l0l5kuldqPh/MUU9GrsLq1hANBkQvRaG0uGuHOm7Cjsrws jnbXTfAQRsnSjQmSGjn2fjJ6qi3WYgoQYtfYyEIx9P0Z7nrlw0h103QLyphqNfzlE5x4 lvEw== X-Gm-Message-State: ALoCoQnK0648rvW6iwlCvh+bDEI+EzBi+oFOfKN0MlSUjUThwvje526F+IDZbBf79w5bhv7YFvZg X-Received: by 10.180.92.69 with SMTP id ck5mr265821wib.15.1397722111967; Thu, 17 Apr 2014 01:08:31 -0700 (PDT) Received: from [10.16.0.195] (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id dr2sm3377671wid.2.2014.04.17.01.08.30 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Apr 2014 01:08:31 -0700 (PDT) Message-ID: <534F8BFD.6070701@6wind.com> Date: Thu, 17 Apr 2014 10:08:29 +0200 From: Olivier MATZ User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20131103 Icedove/17.0.10 MIME-Version: 1.0 To: Neil Horman References: <1397585169-14537-1-git-send-email-nhorman@tuxdriver.com> <1397585169-14537-4-git-send-email-nhorman@tuxdriver.com> <1462763.GWB5SR3fGh@xps13> <20140416130848.GC11887@localhost.localdomain> <534EABB4.9020301@6wind.com> <20140416172924.GE11887@localhost.localdomain> In-Reply-To: <20140416172924.GE11887@localhost.localdomain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH 03/15] pmd: Add PMD_REGISTER_DRIVER macro 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: Thu, 17 Apr 2014 08:08:31 -0000 Hi Neil, On 04/16/2014 07:29 PM, Neil Horman wrote: > Ok, so look it up. DPDK is open source and cscope is easy to use. A > module initilization macro is a common method for doing init time binding in > modular programming (the best examples are the module_init() and module_exit() > macros in the linux kernel). It wraps up what you need to do to tie a modular > piece of your software into the larger main component, without having to know > all the boilerplate behind it. > > Also, if you expose the use of the constructor, then you've > broken out the initalization phase to every pmd you implement, and as a result, > if you ever need to add code to the initilization step, you have to add it in > every pmd, instead of just updating the macro. > > The bottom line is, your method is 5 lines of boilerplate code thats going to > have to get repeated as nauseum for every pmd that gets written giving every PMD > author the opportunity to miscode the constructor, vs my one line that, if it > compiles, will be correct every time. OK, some of your arguments are legitimate and it's a detail point of your patches that are globally a nice improvement of the DPDK code. But I'd be happy to continue this discussion over a beer ;) Regards, Olivier