From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 775813208 for ; Tue, 26 Apr 2016 15:02:03 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP; 26 Apr 2016 06:01:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,536,1455004800"; d="scan'208";a="692478424" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.45]) by FMSMGA003.fm.intel.com with SMTP; 26 Apr 2016 06:01:41 -0700 Received: by (sSMTP sendmail emulation); Tue, 26 Apr 2016 14:01:40 +0025 Date: Tue, 26 Apr 2016 14:01:40 +0100 From: Bruce Richardson To: Rasesh Mody Cc: thomas.monjalon@6wind.com, dev@dpdk.org, ameen.rahman@qlogic.com, Harish Patil , Sony Chacko Message-ID: <20160426130140.GA6992@bricha3-MOBL3> References: <1461647586-22234-1-git-send-email-rasesh.mody@qlogic.com> <1461647586-22234-2-git-send-email-rasesh.mody@qlogic.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1461647586-22234-2-git-send-email-rasesh.mody@qlogic.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [dpdk-dev] [PATCH v6 2/8] qede: Add base driver 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, 26 Apr 2016 13:02:03 -0000 On Mon, Apr 25, 2016 at 10:13:00PM -0700, Rasesh Mody wrote: > The base driver is the backend module for the QLogic FastLinQ QL4xxxx > 25G/40G CNA family of adapters as well as their virtual functions (VF) > in SR-IOV context. > > The purpose of the base module is to: > - provide all the common code that will be shared between the various > drivers that would be used with said line of products. Flows such as > chip initialization and de-initialization fall under this category. > - abstract the protocol-specific HW & FW components, allowing the > protocol drivers to have clean APIs, which are detached in its > slowpath configuration from the actual Hardware Software Interface(HSI). > > This patch adds a base module without any protocol-specific bits. > I.e., this adds a basic implementation that almost entirely falls under > the first category. > > Signed-off-by: Harish Patil > Signed-off-by: Rasesh Mody > Signed-off-by: Sony Chacko > --- > +# > +# CLANG VERSION > +# > +IS_CLANG_GT_362 := $(shell \ > + CLANG_MAJOR=`echo | clang -dM -E - 2>/dev/null | grep clang_major | cut -d" " -f3`; \ > + CLANG_MINOR=`echo | clang -dM -E - 2>/dev/null | grep clang_minor | cut -d" " -f3`; \ > + CLANG_PATCH=`echo | clang -dM -E - 2>/dev/null | grep clang_patch | cut -d" " -f3`; \ > + if [ "0$$CLANG_MAJOR" -gt "03" ]; then \ > + echo 1; \ > + elif [ "0$$CLANG_MAJOR" -eq "03" -a "0$$CLANG_MINOR" -gt "06" ]; then \ > + echo 1; \ > + elif [ "0$$CLANG_MAJOR" -eq "03" -a "0$$CLANG_MINOR" -eq "06" -a "0$$CLANG_PATCH" -gt "02" ]; then \ > + echo 1; \ > + fi) > + While the clang version seems something that might be generally useful, this seems a long way of doing things just to see what compiler warning flag you need to set. How about just testing with clang to see if you get an error with the new flag or not. For example, on Fedora 23 (clang 3.7): bruce@Fedora:dpdk-next-net$ clang -Wno-shift-negative-value -Werror -E - < /dev/null > /dev/null 2>&1 bruce@Fedora:dpdk-next-net$ echo $? 0 While the same commands on FreeBSD 10.3 (clang 3.4): bruce@bsd10:~$ clang -Wno-shift-negative-value -Werror -E - < /dev/null > /dev/null 2>&1 bruce@bsd10:~$ echo $? 1 > +# > +# CFLAGS > +# > +CFLAGS_BASE_DRIVER = -Wno-unused-parameter > +CFLAGS_BASE_DRIVER += -Wno-unused-value > +CFLAGS_BASE_DRIVER += -Wno-sign-compare > +CFLAGS_BASE_DRIVER += -Wno-missing-prototypes > +CFLAGS_BASE_DRIVER += -Wno-cast-qual > +CFLAGS_BASE_DRIVER += -Wno-unused-function > +CFLAGS_BASE_DRIVER += -Wno-unused-variable > +CFLAGS_BASE_DRIVER += -Wno-strict-aliasing > +CFLAGS_BASE_DRIVER += -Wno-missing-prototypes > +CFLAGS_BASE_DRIVER += -Wno-format-nonliteral > +ifeq ($(OS_TYPE),Linux) > +ifeq ($(IS_CLANG_GT_362),1) > +CFLAGS_BASE_DRIVER += -Wno-shift-negative-value # Support added after clang 3.6 > +else > +CFLAGS_BASE_DRIVER += -Wno-shift-sign-overflow > +endif > +endif > +