From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 380664F91 for ; Sun, 28 Oct 2018 16:29:27 +0100 (CET) Received: by mail-pf1-f193.google.com with SMTP id a19-v6so2765119pfo.8 for ; Sun, 28 Oct 2018 08:29:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BHdvIrf6u+WLIyO1i+aHTjw0EX8HxhfIsdeA9FEvRvY=; b=obsKIJffJzbTRrQeXGxBP6qXB2HT7NvDT3q9P18OofF+7uY8N6+D01n5JpBotma16j Mlz6osgdt4c3akkaCVz0ZPKWaOH7DmJgoyMQDaFeHlQzKGoGT4uM+FKYTtzBdaVSZIIp hKo5fbQj+BLLaVRAECzJ0oBS/XDbb4lP8wwNELO0lSaTUVqSr/xYuL1cWZOa7p3CasTr C/GGGrVV7t4LykM+F5PxgqrA5nSw/ir17w+7Z4pDNQUZ/6G+8z692SiY8YYyYc68Q7QY CmIlm8VdBvP04f6oXr3IbAcAlZsubiWPJZL5jC+W9v5L5PjuyWQ1X6fW8nk/zPtqrTEb OXUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BHdvIrf6u+WLIyO1i+aHTjw0EX8HxhfIsdeA9FEvRvY=; b=dAEOhhzxkKeFUt2fCs7U2OdzYptdJyIcglgee/niMQGynEAA70S6aNCvYU2TXCubVP tevj6/Bd/4FUWcWnI+ajK6/i/jW3T26hMoJ1MLJz50QKp0iqbBKNmCj3c1zWcyhc2lqH DKbJRVoE0vrADHwWa2D2rOsKUN/72Jze3kdUbljlq07311okxxTQBTjT0gzQpdMYKh+P LIpDIqJ/C9slURhSapN6ZVfOIum5S9cQsnanq9qSuZRWHtBmvfzkL6YmYB2sP9UNRAkC /a0tpRiFch9fv75rBjGwCet61Ch+LBCJL22HazozjF5GH33Qsg6WjnPPgKkP4WGxU0Fz ODYQ== X-Gm-Message-State: AGRZ1gK7oxoeXkRkT5Iumzg2hMoj6QlDiO5qrfsm7RbSP8wpCR1VPxC7 IB3F73Lv2C2dKFUh2h983aM9bQ== X-Google-Smtp-Source: AJdET5du3deYcTd/cxi1IAdNggZ5vZCSR8JTQH+UZXSLfuWCm7o2EqSeUibcyw64uHHyFacTi4r6gA== X-Received: by 2002:a63:2109:: with SMTP id h9mr59749pgh.277.1540740566132; Sun, 28 Oct 2018 08:29:26 -0700 (PDT) Received: from xeon-e3 (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id f22-v6sm22820150pff.29.2018.10.28.08.29.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 28 Oct 2018 08:29:26 -0700 (PDT) Date: Sun, 28 Oct 2018 08:29:18 -0700 From: Stephen Hemminger To: "Varghese, Vipin" Cc: "Pattan, Reshma" , "dev@dpdk.org" , "Tahhan, Maryam" , "Patel, Amol" , "Tummala, Sivaprasad" , "Byrne, Stephen1" , "Glynn, Michael J" Message-ID: <20181028082918.2020a5c5@xeon-e3> In-Reply-To: <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2B4F8E@BGSMSX101.gar.corp.intel.com> References: <20181023135751.21536-1-vipin.varghese@intel.com> <20181024064805.23197-1-vipin.varghese@intel.com> <20181024064805.23197-6-vipin.varghese@intel.com> <3AEA2BF9852C6F48A459DA490692831F2A3BE6A5@irsmsx110.ger.corp.intel.com> <4C9E0AB70F954A408CC4ADDBF0F8FA7D4D2B4F8E@BGSMSX101.gar.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v2 6/9] app/procinfo: add code for debug crypto 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: Sun, 28 Oct 2018 15:29:27 -0000 On Sat, 27 Oct 2018 04:42:19 +0000 "Varghese, Vipin" wrote: > Hi, > > > > > --- > > + struct rte_cryptodev_info dev_info = {0}; > > + struct rte_cryptodev_stats stats = {0}; > > + > > > > Memset for initialization as mentioned in other patch. > > > > Yes, I will correct the same as certain compiler flag combination will treat this as incorrect use. > > > + > > +#define DSP_CRYPTO_FLAG(x) do { \ > > +printf(" - feature flags\n"); \ > > +printf("\t -- symmetric (%c) asymmetric (%c)" \ " symmetric operation > > +chaining (%c)\n", \ (x & RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO)?'y':'n', \ > > +(x & RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO)?'y':'n', \ (x & > > +RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING)?'y':'n'); \ printf("\t -- CPU > > +SSE (%c) AVX (%c) AVX2 (%c) AVX512 (%c)\n", \ (x & > > +RTE_CRYPTODEV_FF_CPU_SSE)?'y':'n', \ (x & > > +RTE_CRYPTODEV_FF_CPU_AVX)?'y':'n', \ (x & > > +RTE_CRYPTODEV_FF_CPU_AVX2)?'y':'n', \ (x & > > +RTE_CRYPTODEV_FF_CPU_AVX512)?'y':'n'); \ printf("\t -- Acclerate CPU > > +AESNI (%c) HW (%c)\n", \ (x & RTE_CRYPTODEV_FF_CPU_AESNI)?'y':'n', \ (x > > +& RTE_CRYPTODEV_FF_HW_ACCELERATED)?'y':'n'); \ printf("\t -- INLINE > > +(%c)\n", \ (x & RTE_CRYPTODEV_FF_SECURITY)?'y':'n'); \ printf("\t -- > > +ARM NEON (%c) CE (%c)\n", \ (x & RTE_CRYPTODEV_FF_CPU_NEON)?'y':'n', \ > > +(x & RTE_CRYPTODEV_FF_CPU_ARM_CE)?'y':'n'); \ printf(" - buffer > > +offload\n"); \ printf("\t -- IN_PLACE_SGL (%c)\n", \ (x & > > +RTE_CRYPTODEV_FF_IN_PLACE_SGL)?'y':'n'); \ printf("\t -- > > +OOP_SGL_IN_SGL_OUT (%c)\n", \ (x & > > +RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT)?'y':'n'); \ printf("\t -- > > +OOP_SGL_IN_LB_OUT (%c)\n", \ (x & > > +RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT)?'y':'n'); \ printf("\t -- > > +OOP_LB_IN_SGL_OUT (%c)\n", \ (x & > > +RTE_CRYPTODEV_FF_OOP_LB_IN_SGL_OUT)?'y':'n'); \ printf("\t -- > > +OOP_LB_IN_LB_OUT (%c)\n", \ (x & > > +RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT)?'y':'n'); \ } while (0) > > > > This is a very big macro, better have static function for this instead of macro. > > > > There are two thoughts in choosing MACRO over function. > 1. The information need to display in certain format within the same context. > 2. As the API are modified, co locating all at same scope is easier to clean up and correct in future. > > So I feel use of MACRO over function in this instance. I don't agree with your arguments. Macros, are ugly and error prone. This is not performance critical so it should be a function. The only reason to use macro's is if it is not possible to write it as a function (as in a template for code generation).