From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 635842E81 for ; Fri, 26 Oct 2018 23:05:43 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Oct 2018 14:05:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,429,1534834800"; d="scan'208";a="95347731" Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by orsmga003.jf.intel.com with ESMTP; 26 Oct 2018 14:05:42 -0700 Received: from orsmsx105.amr.corp.intel.com ([169.254.2.110]) by ORSMSX102.amr.corp.intel.com ([169.254.3.38]) with mapi id 14.03.0319.002; Fri, 26 Oct 2018 14:05:42 -0700 From: "Wang, Yipeng1" To: Thomas Monjalon , Dharmik Thakkar CC: "Richardson, Bruce" , "De Lara Guarch, Pablo" , "dev@dpdk.org" , "honnappa.nagarahalli@arm.com" Thread-Topic: [dpdk-stable] [PATCH v2] test/hash: solve unit test hash compilation error Thread-Index: AQHUbWnvdaxlgXioTEu30jzZXTCk9KUyAXwQ Date: Fri, 26 Oct 2018 21:05:41 +0000 Message-ID: References: <1535379969-19642-1-git-send-email-dharmik.thakkar@arm.com> <1537298539-31403-1-git-send-email-dharmik.thakkar@arm.com> <3800213.8SZGDA9kEc@xps> In-Reply-To: <3800213.8SZGDA9kEc@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiY2I1YjgyYjktZGRiOS00NjBmLWI0YzItOWUwNTU4NmU5ZmRjIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiSDJybzliUmJXeVJzNmFGd20xUmZnSWNYXC91cTVtK1B0VnpTcVVqTEl1Skp2OUFBVUlTVGwwWkk4YnNpYXE0ajYifQ== x-originating-ip: [10.22.254.140] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v2] test/hash: solve unit test hash compilation error 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: Fri, 26 Oct 2018 21:05:44 -0000 >-----Original Message----- >From: Thomas Monjalon [mailto:thomas@monjalon.net] >Sent: Friday, October 26, 2018 1:25 PM >To: Dharmik Thakkar >Cc: Richardson, Bruce ; De Lara Guarch, Pablo = ; dev@dpdk.org; >honnappa.nagarahalli@arm.com; Wang, Yipeng1 >Subject: Re: [dpdk-stable] [PATCH v2] test/hash: solve unit test hash comp= ilation error > >+Cc Yipeng > >18/09/2018 21:22, Dharmik Thakkar: >> Enable print_key_info() function compilation always. > >Please see my first comment: you need to show the compilation error >in this message. Otherwise, we don't know what you are trying >to fix. > >> Fixes: af75078fece36 ("first public release") >> Cc: stable@dpdk.org >> >> Suggested-by: Honnappa Nagarahalli >> Signed-off-by: Dharmik Thakkar >> Reviewed-by: Honnappa Nagarahalli >> Reviewed-by: Gavin Hu >> --- >> v2: >> * Fix checkpatch coding style issue >> * Add "Fixes:" tag >> --- >> test/test/test_hash.c | 24 +++++++++--------------- >> 1 file changed, 9 insertions(+), 15 deletions(-) >> >> diff --git a/test/test/test_hash.c b/test/test/test_hash.c >> index b3db9fd10547..db6442a2b101 100644 >> --- a/test/test/test_hash.c >> +++ b/test/test/test_hash.c >> +#define UNIT_TEST_HASH_VERBOSE 0 >> /* >> * Print out result of unit test hash operation. >> */ >> -#if defined(UNIT_TEST_HASH_VERBOSE) >> static void print_key_info(const char *msg, const struct flow_key *key, >> int32_t pos) >> { >> - uint8_t *p =3D (uint8_t *)key; >> - unsigned i; >> - >> - printf("%s key:0x", msg); >> - for (i =3D 0; i < sizeof(struct flow_key); i++) { >> - printf("%02X", p[i]); >> + if (UNIT_TEST_HASH_VERBOSE) { > >This is very suspicious. >Why keeping this code if it is never called? [Wang, Yipeng] I assume this is for the convenience for debug. E.g. if the= unit test failed, developer can set the macro and print more information, but by default the = code is not used. A quick grep I found the test_timer_racecond and efd unit test has similar= macros. But could anyone let me know what is the best coding practice for such purpose in unit test? I also wonder what compilation error the original code causes as Thomas ind= icated.