From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH 1/6] ethdev: add a function to look up Rx offload names Date: Thu, 18 Jan 2018 10:24:55 +0100 Message-ID: <1563746.HlMJDYb8UE@xps> References: <1515658359-1041-1-git-send-email-arybchenko@solarflare.com> <49b1556b-b1ec-2264-1450-1887c3290c4f@solarflare.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev@dpdk.org, Ferruh Yigit , Shahaf Shuler To: Andrew Rybchenko , Ivan Malov 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) In-Reply-To: <49b1556b-b1ec-2264-1450-1887c3290c4f@solarflare.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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.