From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from emea01-am1-obe.outbound.protection.outlook.com (mail-am1on0099.outbound.protection.outlook.com [157.56.112.99]) by dpdk.org (Postfix) with ESMTP id 8910E5A51 for ; Thu, 9 Jul 2015 06:21:01 +0200 (CEST) Authentication-Results: dpdk.org; dkim=none (message not signed) header.d=none; Received: from zhigangTHINK (124.207.145.166) by HE1PR02MB0810.eurprd02.prod.outlook.com (10.161.118.15) with Microsoft SMTP Server (TLS) id 15.1.213.14; Thu, 9 Jul 2015 04:20:57 +0000 From: Tony Lu To: 'Thomas Monjalon' References: <1436172698-21749-1-git-send-email-zlu@ezchip.com> <1436172698-21749-5-git-send-email-zlu@ezchip.com> <8813269.8bcvtOYP9E@xps13> In-Reply-To: <8813269.8bcvtOYP9E@xps13> Date: Thu, 9 Jul 2015 12:20:43 +0800 Message-ID: <001f01d0b9fe$a76ec2b0$f64c4810$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdC54NO9MN96mqZCSHq/bff+NvBr7wAHTRWQ Content-Language: zh-cn X-Originating-IP: [124.207.145.166] X-ClientProxiedBy: BN3PR0301CA0027.namprd03.prod.outlook.com (25.160.180.165) To HE1PR02MB0810.eurprd02.prod.outlook.com (25.161.118.15) X-Microsoft-Exchange-Diagnostics: 1; HE1PR02MB0810; 2:nvtj37lDooxje9BieGN/Spm21biwyDAQqrQb65uSyBAvczW5EXOmppmJgaRsvyKR; 3:629Ca9TXU1b1dy8HTjybNu67EF2haQHWbYtE96iffuJG4thL9JqJ+R/HvkBXJuikhGjweZW9Vdg+KiRtcOqrDnMI82+cpKqdLX5uJzbPlCPhUPB2WN2yB7A6uYCHeDJWdO7ibDEY/3YhKoD6O2+6Pg==; 25:qppkxzjgIB8MpCC93VKDd3Z/m3tDBA2DUX+yl4mjEq5PaUG0/Sw4RSCq7TykGaeqfliRVO82W8mGnB6i7hCbor2uhWEjacK8VKiDU8RpemRovNf6vqgpTT4tEZlxLiF3wt18NFKAMdlM0SiCx5zLnxpShPoZwM/4QL6vumhhWw4uwW3Wpzrcd8/kpB1pjphzzR9HuBMy7/BJiNWouZERe+QHXej6l/Nigyi303PobLSlJq+brHEUHp2u3gPbH2/ksTzSnglIrL/30/7z1rgyMg==; 20:qHMho+h/XEbqRBmr+Il65rQ8B4KV8K/+9u2oksJ0BS2vR1JAKYpXEP+k+L60c0JhQwTbxgR48dl4FD3N6w6frh1A6g9Z2fsu7ypx3K6uZanObs1qeb/a6GXQTbEIUjpgEzusmomtiDwpKmmeQZvfoMgXjni6j3weN53qaTMh+M0= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:HE1PR02MB0810; HE1PR02MB0810: X-MS-Exchange-Organization-RulesExecuted X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:HE1PR02MB0810; BCL:0; PCL:0; RULEID:; SRVR:HE1PR02MB0810; X-Microsoft-Exchange-Diagnostics: 1; HE1PR02MB0810; 4:c51zVFmGNf8HHWXcO1fX4IMPmo3u7cx9FjcV829l7NjjsA9j4IVqsZycyl9ZW9HSPriky8L5mlMJkPWbxg56bgVOf2mW7GNtAjPvAD1aE1l8HMccH93T9KJVLsSixRFR3bqZKYGJKkA0bqOMExTddzC43IgLibLGjnW814YddUhvE4z8ZCUGEiFD1/2RvwzgbuKkbgKyd7a5t9RZ6lNKvqWbvy/ZgqNM2s59cAinFOd7Cv4LMMhOylpomnelmTIdqZR9+zGdecvlueJ40PH0uLWWbL+hvpJP7HmY3JOj8uw= X-Forefront-PRVS: 0632519F33 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(51704005)(377424004)(377454003)(13464003)(33646002)(50466002)(42186005)(5001960100002)(122386002)(61296003)(77156002)(96836002)(62966003)(86362001)(14726001)(110136002)(189998001)(19580405001)(19580395003)(40100003)(2656002)(87976001)(46406003)(50226001)(102836002)(5001920100001)(23726002)(84116002)(59696002)(46102003)(76176999)(97756001)(2950100001)(66066001)(33716001)(50986999)(92566002)(47776003)(77096005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR02MB0810; H:zhigangTHINK; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR02MB0810; 23:nDlFBxv7dbN9JYpzS/TIaP+KWllkGPRRyUfI6EAcm?= =?us-ascii?Q?0RkwN0+6eh1sI2bkwQXYY11JoIe28GS++/O0/FBKxcJv0u87e7/0tchPM5w6?= =?us-ascii?Q?rRGapxkx2xsmlIqNpV8txAxrScUz0/jGI0UBkian+sCKfcENb5ugEb1j30SI?= =?us-ascii?Q?FlOJmFRuEmEj+GWBoUL1iF3BWmypJ0NrSnzFf7mg6T8yEja3yP6Wcm0XyAGc?= =?us-ascii?Q?xuh5EdRPZwdO5F0aeX87YLQX9OWhUwhkByU9rvFrxyUBZXhSk2upvARIQ8O0?= =?us-ascii?Q?s7d5kXBo58pE01MfHLYkbWtsEqFlj1C4SaowiFwfE/xuT9d8E+myDu20rGme?= =?us-ascii?Q?hFqjyKG5m8WhdIZE0QSJY1eC3NxGnwdSRfO9tDXjL+V1YrHSkKluCBRTo6jz?= =?us-ascii?Q?Mm6zFufuRdx+nRxYxkAzrE0HiVdSXuP0Wz6cjY89EdNrft+Z6WsUj22SYsU3?= =?us-ascii?Q?IZ5GfoI9EKZ/leA68grtpTVJ28OBLgSA31NxnAfoNMzvTDiWSu8Grx77f4bb?= =?us-ascii?Q?BK5Oy6x8BzW3WbhtGIxNqJU2082b3a3zNrkAxRJCpm03ab+5b94/O646ragT?= =?us-ascii?Q?AICe064fl81RZhP22q6H0FIkgpA3SZW/FOTu6NNBcsIoQARMr2UMBnIn/l/l?= =?us-ascii?Q?SfRf4DDLDylDiOiJeZo0v+OwVg14hjWiCjchMmYdRPddoN9ahksVCSrcsumx?= =?us-ascii?Q?Z25qYfbj1hx545TcoPz1EPwoucoIYDCH2SWqi5QouxrEAyzkVQ7FTuj6XL6w?= =?us-ascii?Q?qCpIlB3w9tbDqF5OfJj0U0hGo5oKTafyGc6uAxrFytgZZ3K0eMiZqFrT4ICQ?= =?us-ascii?Q?Ue0q+Y9uWEd6nTSY6/995JzcAFPwJUKZsXoUsNh2xg4azopAr7616aog0tKy?= =?us-ascii?Q?cTtvapgP9W3GK/7xFKMgktiRyLkemKjq3ToovvYnXIayBS6sSZ7wYkdJ9nSX?= =?us-ascii?Q?1Vlh5AZn1BTEy7ge06wd7GqP7u4/QnUdSQ9dk1aOgVD91CW4uSYXmPgSZJUY?= =?us-ascii?Q?94nUEFe9tKrKl/94Kbph2gJA1fez/pYESNepRhv9viSrB+oAJDQC9GhfgPsb?= =?us-ascii?Q?7raLKc=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR02MB0810; 5:y56balq5n9xYtmT2UkPEHzl/SazROFsNLgioiVgZ70fkav/mZrTiohB18itCWTCojro/+7GmdXWBNj959M/gVXHaIkeGFVG4NsYcvazkGSXCXvJll/d6JVcjO2NbGP2RoJouILEIMCBc9d2S90Uxzg==; 24:ExMDmHdtaEU2Afmn0wptWHYqputK5v6fkAavMe0VEv/Td+wOCBwNlMutgv9mB7F7U+k5f5kM/VMnSkSDUTOd10C9mRYuqd4UbavRWNdkjTE=; 20:NmufxElbxHWswWOD/RlRF4153/GL0piAR6wDC2HFAQ3/PYwi81AQdYWf74SRqagoUzIyqUazCFKfNIF0Jg+rrg== SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jul 2015 04:20:57.6649 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR02MB0810 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v3 04/12] eal: allow empty compile time flags X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Jul 2015 04:21:01 -0000 >-----Original Message----- >From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com] >Sent: Thursday, July 09, 2015 8:46 AM >To: Zhigang Lu >Cc: dev@dpdk.org >Subject: Re: [dpdk-dev] [PATCH v3 04/12] eal: allow empty compile time flags > >2015-07-06 16:51, Zhigang Lu: >> The rte_cpu_check_supported() code breaks with a "comparison is always >> false due to limited range of data type" when the compile_time_flags[] >> array is empty. Assigning the array dimension to a local variable >> apparently solves this. > >How is it related to the title "allow empty compile time flags"? Changed the title and commit log a little bit as follows. eal: allow empty compile time flags RTE_COMPILE_TIME_CPUFLAGS When RTE_COMPILE_TIME_CPUFLAGS is empty, the rte_cpu_check_supported() code breaks with a "comparison is always false due to limited range of data type". This is because the compile_time_flags[] array is empty. Assigning the array dimension to a local variable apparently solves this. > >> - unsigned i; >> + unsigned count = RTE_DIM(compile_time_flags), i; >> int ret; > >Please define a "const unsigned count =" here to improve readability. If define as a const unsigned count, we also get the following compiler warning. error: comparison of unsigned expression < 0 is always false > >> - for (i = 0; i < sizeof(compile_time_flags)/sizeof(compile_time_flags[0]); i++) >{ >> + for (i = 0; i < count; i++) { > >