From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B1C3C31E5B for ; Tue, 18 Jun 2019 21:18:36 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id AF61120863 for ; Tue, 18 Jun 2019 21:18:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF61120863 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 775171C26C; Tue, 18 Jun 2019 23:18:34 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by dpdk.org (Postfix) with ESMTP id 46C951C25F for ; Tue, 18 Jun 2019 23:18:32 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jun 2019 14:18:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,390,1557212400"; d="scan'208";a="164822127" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga006.jf.intel.com with ESMTP; 18 Jun 2019 14:18:31 -0700 Received: from fmsmsx125.amr.corp.intel.com (10.18.125.40) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 18 Jun 2019 14:18:31 -0700 Received: from fmsmsx117.amr.corp.intel.com ([169.254.3.210]) by FMSMSX125.amr.corp.intel.com ([169.254.2.239]) with mapi id 14.03.0439.000; Tue, 18 Jun 2019 14:18:31 -0700 From: "Wiles, Keith" To: Adam Drescher CC: "dev@dpdk.org" Thread-Topic: [PATCH] pktgen: fix clang compiler errors / warnings Thread-Index: AQHVJhian6Sy1JnpTEWCv6GWXq41EaaiX+gA Date: Tue, 18 Jun 2019 21:18:30 +0000 Message-ID: <81AA3BDC-5BF8-43E2-B383-4E8497054771@intel.com> References: <20190618205800.27441-1-adam.r.drescher@gmail.com> In-Reply-To: <20190618205800.27441-1-adam.r.drescher@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.38.83] Content-Type: text/plain; charset="us-ascii" Content-ID: <41A1B9D992D8CA45AE085397CA160259@intel.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] pktgen: fix clang compiler errors / warnings X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > On Jun 18, 2019, at 3:58 PM, Adam Drescher wr= ote: >=20 > Clang complains about the following issues: > (1) unclear meaning of =3D- in assignment of pktgen.verbose > (2) unused function sct(), which is also defined in cli_cmds.c > (3) typo in include guard for rte_lua_vec.h > (4) duplicate inline due to expansion of __rte_always_inline >=20 > Tested the patch on both clang and gcc. Not sure how strong > pktgen's backwards compatability guarantees are, but > __rte_always_inline is good back to DPDK v18.02 at least. Thanks, I will review the patch and commit or reply with comments. >=20 > Signed-off-by: Adam Drescher > --- > app/pktgen-main.c | 2 +- > lib/cli/cli_cmap.c | 23 ----------------------- > lib/lua/rte_lua_vec.h | 2 +- > lib/vec/rte_vec.h | 32 ++++++++++++++++---------------- > 4 files changed, 18 insertions(+), 41 deletions(-) >=20 > diff --git a/app/pktgen-main.c b/app/pktgen-main.c > index 6b9d90e..e87e2f5 100644 > --- a/app/pktgen-main.c > +++ b/app/pktgen-main.c > @@ -252,7 +252,7 @@ pktgen_parse_args(int argc, char **argv) > pktgen.flags |=3D ENABLE_THEME_FLAG; > break; > case 'v': > - pktgen.verbose =3D- 1; > + pktgen.verbose =3D 1; > break; >=20 > case 'h': /* print out the help message */ > diff --git a/lib/cli/cli_cmap.c b/lib/cli/cli_cmap.c > index 66638b7..1c932d6 100644 > --- a/lib/cli/cli_cmap.c > +++ b/lib/cli/cli_cmap.c > @@ -285,26 +285,3 @@ cmap_free(struct cmap *cmap) > { > free(cmap); > } > - > -/* Helper for building log strings. > - * The macro takes an existing string, a printf-like format string and o= ptional > - * arguments. It formats the string and appends it to the existing strin= g, > - * while avoiding possible buffer overruns. > - */ > -#define strncatf(dest, fmt, ...) do { \ > - char _buff[1024]; \ > - snprintf(_buff, sizeof(_buff), fmt, ## __VA_ARGS__); \ > - strncat(dest, _buff, sizeof(dest) - strlen(dest) - 1); \ > -} while (0) > - > -static __inline__ uint8_t > -sct(struct cmap *cm, uint8_t s, uint8_t c, uint8_t t) { > - lc_info_t *lc =3D cm->linfo; > - uint8_t i; > - > - for (i =3D 0; i < cm->num_cores; i++, lc++) > - if (lc->sid =3D=3D s && lc->cid =3D=3D c && lc->tid =3D=3D t) > - return lc->lid; > - > - return 0; > -} > diff --git a/lib/lua/rte_lua_vec.h b/lib/lua/rte_lua_vec.h > index b329f1a..8eaf83c 100644 > --- a/lib/lua/rte_lua_vec.h > +++ b/lib/lua/rte_lua_vec.h > @@ -4,7 +4,7 @@ > /* Created 2018 by Keith Wiles @ intel.com */ >=20 > #ifndef _RTE_LUA_VEC_H_ > -#define _RTE_LUAVEC_H_ > +#define _RTE_LUA_VEC_H_ >=20 > #include > #include > diff --git a/lib/vec/rte_vec.h b/lib/vec/rte_vec.h > index b465525..77dc706 100644 > --- a/lib/vec/rte_vec.h > +++ b/lib/vec/rte_vec.h > @@ -99,49 +99,49 @@ rte_vec_clr_dont_free(struct rte_vec *vec) > vec->flags &=3D ~VEC_DONT_FREE_FLAG; > } >=20 > -static inline __rte_always_inline uint16_t > +static __rte_always_inline uint16_t > rte_vec_len(struct rte_vec *v) > { > return v->len; > } >=20 > -static inline __rte_always_inline int > +static __rte_always_inline int > rte_vec_byte_len(struct rte_vec *v) > { > return v->len * sizeof(void *); > } >=20 > -static inline __rte_always_inline void > +static __rte_always_inline void > rte_vec_set_len(struct rte_vec *v, uint16_t n) > { > v->len =3D n; > } >=20 > -static inline __rte_always_inline void > +static __rte_always_inline void > rte_vec_set_max_len(struct rte_vec *v, uint16_t n) > { > v->tlen =3D n; > } >=20 > -static inline __rte_always_inline void > +static __rte_always_inline void > rte_vec_dec_len(struct rte_vec *v) > { > v->len--; > } >=20 > -static inline __rte_always_inline void > +static __rte_always_inline void > rte_vec_inc_len(struct rte_vec *v) > { > v->len++; > } >=20 > -static inline __rte_always_inline uint16_t > +static __rte_always_inline uint16_t > rte_vec_max_len(struct rte_vec *v) > { > return v->tlen; > } >=20 > -static inline __rte_always_inline struct rte_mbuf ** > +static __rte_always_inline struct rte_mbuf ** > rte_vec_list(struct rte_vec *v) > { > return (struct rte_mbuf * *)&v->list[0]; > @@ -151,7 +151,7 @@ rte_vec_list(struct rte_vec *v) > #pragma GCC diagnostic ignored "-Warray-bounds" >=20 > /* return -1 on full and index value if OK */ > -static inline __rte_always_inline int > +static __rte_always_inline int > rte_vec_add1(struct rte_vec *vec, void *val) > { > if (vec->len >=3D vec->tlen) > @@ -161,7 +161,7 @@ rte_vec_add1(struct rte_vec *vec, void *val) > return vec->len - 1; > } >=20 > -static inline __rte_always_inline int > +static __rte_always_inline int > rte_vec_add_at_index(struct rte_vec *vec, void *val, uint16_t n) > { > if (vec->len >=3D vec->tlen) > @@ -171,7 +171,7 @@ rte_vec_add_at_index(struct rte_vec *vec, void *val, = uint16_t n) > return 0; > } >=20 > -static inline __rte_always_inline void * > +static __rte_always_inline void * > rte_vec_at_index(struct rte_vec *vec, uint16_t n) > { > if (n >=3D vec->len) > @@ -179,32 +179,32 @@ rte_vec_at_index(struct rte_vec *vec, uint16_t n) > return vec->list[n]; > } >=20 > -static inline __rte_always_inline void > +static __rte_always_inline void > rte_vec_set_at_index(struct rte_vec *vec, uint16_t idx, void *val) > { > if (idx < vec->tlen) > vec->list[idx] =3D val; > } >=20 > -static inline __rte_always_inline struct rte_mbuf ** > +static __rte_always_inline struct rte_mbuf ** > rte_vec_addr(struct rte_vec *vec, uint16_t n) > { > return (struct rte_mbuf * *)&vec->list[n]; > } >=20 > -static inline __rte_always_inline struct rte_mbuf ** > +static __rte_always_inline struct rte_mbuf ** > rte_vec_end(struct rte_vec *vec) > { > return (struct rte_mbuf * *)&vec->list[vec->len]; > } >=20 > -static inline __rte_always_inline int > +static __rte_always_inline int > rte_vec_len_remaining(struct rte_vec *vec) > { > return vec->tlen - vec->len; > } >=20 > -static inline __rte_always_inline int > +static __rte_always_inline int > rte_vec_is_full(struct rte_vec *v) > { > return (v->len =3D=3D v->tlen); > --=20 > 2.20.1 >=20 Regards, Keith