From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id B96ED1B1C3 for ; Thu, 18 Jan 2018 10:25:29 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 43F3520E19; Thu, 18 Jan 2018 04:25:29 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Thu, 18 Jan 2018 04:25:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=2/aEvyWh/cYZ4UNDB7txYM+i9e PlaxTauvjrgToDXyk=; b=dKpdpBept0OUz8t8mEX0yR/Lr4rf3ir1GsSd2RX8DN PGhW0Szs9hk7FIBTLQCwWK226jxbqbFed9mFdexBlq67S1h3Z/s93IbKxsxgtX8h Sx8lJ8KWzviyox5V5G5TTE/FEsUw+b3c58rhiL0FDfPI2fssCUbQ8UB318DzgrRe g= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=2/aEvy Wh/cYZ4UNDB7txYM+i9ePlaxTauvjrgToDXyk=; b=EWnpIBc+wil5AFRKcGV2Ct r39+dS+5J9TweOHxnv4fCY2PTEnScQQgbwZUcz6TfZQHK9+a5QsFfn9g1pdwXXlp Ajyw8b0wyAcE+HgdCyQo68aNAXAKTkFFVaWNag7dyyjWFzVNEVQN0K65h9kQZQhV 6GeSq+89UhWvuYs0oZvVsZkzmYr3DGQ//GngBRU/MzSuVmAKmZNiuIzAYi2eP3lx 4AZs+LY4ISP2274d4yOY6EhgYtcpnGXDkiJXct+vP/n46W/FvZ3EqXhhnSTs3cW2 XM3n+g/tnVYhr6xhVjbThIUmwJVRfH0yd/8iCQm2c7hVcXCFEirW7CcMCmKjJWYQ == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id E7BB47E2E5; Thu, 18 Jan 2018 04:25:28 -0500 (EST) From: Thomas Monjalon To: Andrew Rybchenko , Ivan Malov Cc: dev@dpdk.org, Ferruh Yigit , Shahaf Shuler Date: Thu, 18 Jan 2018 10:24:55 +0100 Message-ID: <1563746.HlMJDYb8UE@xps> In-Reply-To: <49b1556b-b1ec-2264-1450-1887c3290c4f@solarflare.com> References: <1515658359-1041-1-git-send-email-arybchenko@solarflare.com> <49b1556b-b1ec-2264-1450-1887c3290c4f@solarflare.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 1/6] ethdev: add a function to look up Rx offload names 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: , X-List-Received-Date: Thu, 18 Jan 2018 09:25:30 -0000 18/01/2018 08:52, Andrew Rybchenko: > On 01/18/2018 10:16 AM, Andrew Rybchenko wrote: > > On 01/17/2018 08:33 PM, Thomas Monjalon wrote: > >> Hi, 2 comments below > >> > >> 11/01/2018 09:12, Andrew Rybchenko: > >>> From: Ivan Malov > >>> > >>> +#define RTE_RX_OFFLOAD_BIT2STR(_name) \ > >>> + { DEV_RX_OFFLOAD_##_name, #_name } > >>> + > >>> +static const struct { > >>> + uint64_t offload; > >>> + const char *name; > >>> +} rte_rx_offload_names[] = { > >>> + RTE_RX_OFFLOAD_BIT2STR(VLAN_STRIP), > >>> + RTE_RX_OFFLOAD_BIT2STR(IPV4_CKSUM), > >>> + RTE_RX_OFFLOAD_BIT2STR(UDP_CKSUM), > >>> + RTE_RX_OFFLOAD_BIT2STR(TCP_CKSUM), > >>> + RTE_RX_OFFLOAD_BIT2STR(TCP_LRO), > >>> + RTE_RX_OFFLOAD_BIT2STR(QINQ_STRIP), > >>> + RTE_RX_OFFLOAD_BIT2STR(OUTER_IPV4_CKSUM), > >>> + RTE_RX_OFFLOAD_BIT2STR(MACSEC_STRIP), > >>> + RTE_RX_OFFLOAD_BIT2STR(HEADER_SPLIT), > >>> + RTE_RX_OFFLOAD_BIT2STR(VLAN_FILTER), > >>> + RTE_RX_OFFLOAD_BIT2STR(VLAN_EXTEND), > >>> + RTE_RX_OFFLOAD_BIT2STR(JUMBO_FRAME), > >>> + RTE_RX_OFFLOAD_BIT2STR(CRC_STRIP), > >>> + RTE_RX_OFFLOAD_BIT2STR(SCATTER), > >>> + RTE_RX_OFFLOAD_BIT2STR(TIMESTAMP), > >>> + RTE_RX_OFFLOAD_BIT2STR(SECURITY), > >>> +}; > >>> + > >>> +#undef RTE_RX_OFFLOAD_BIT2STR > >> Why this undef? > > > > It is a constant-local macro with assumption to be used as > > I mean context-local, sorry. > > > initializer of the corresponding structure. So, under is just to > > limit its context and be sure that it is will not clash or be reused > > most likely in a wrong way. We do not take this precaution usually in DPDK. No strong opinion however.