From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 15BEFA05D3 for ; Tue, 21 May 2019 10:03:48 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id DF92CA69; Tue, 21 May 2019 10:03:47 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id C7BD7A49; Tue, 21 May 2019 10:03:46 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4L7saZI007943; Tue, 21 May 2019 01:03:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=gYrxG3rI+KTRICmvzoRvg5cMnhbg6JFkYQQUDIz9VbA=; b=Jj0B5by1NDgOOpxC/Ah8gBTwfYXzSevMcyP2qdRzc1I5ArLIvpTTqquOjHAugMT1gopJ cGxOXhMpMfCC7rVwdKwS3/uDhgHnjMo7ENgF/6vC/ehtN9wROVs32uh33HIFViaQwgDy /fX798WoBOI9XgMyo9p/H5wuDSK4pI6YuBC+4z+FKRMLVZpupVCwtVwUd9VqjwDSWcNV 5TLZDB3Fk8UZ/SbV1UWa6O7jsTHKkjULo/d3Dy7ljcxW+9+/zZO9h2XmyR7tVaN7TFUB mOXzk/9jGZhf+/3aCiJqzApOrwwOJVOGCTvECYOm+w45n9wywHNzXVLWDvHIdVyUvwAv /g== Received: from sc-exch01.marvell.com ([199.233.58.181]) by mx0a-0016f401.pphosted.com with ESMTP id 2sm8r1186d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Tue, 21 May 2019 01:03:45 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Tue, 21 May 2019 01:03:45 -0700 Received: from NAM05-BY2-obe.outbound.protection.outlook.com (104.47.50.50) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Tue, 21 May 2019 01:03:45 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gYrxG3rI+KTRICmvzoRvg5cMnhbg6JFkYQQUDIz9VbA=; b=Ysx4bR0oHYVJM8TdVPXCYvfEqMlC98/IWGjD1/IXDICBTQh7aaCKfTlPpOLlwnCdJ8mq7FKs+VN+MsNcHStIuboMpOSBVMOqsm6W+2OADzuszF+XK0/6feY8xBjEeNQVrbtLcxNO83kHx8IkOe17RJygEJEtJCd/owDBDveBkrw= Received: from CY4PR1801MB2053.namprd18.prod.outlook.com (10.171.255.158) by CY4PR1801MB1814.namprd18.prod.outlook.com (10.165.88.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1900.17; Tue, 21 May 2019 08:03:42 +0000 Received: from CY4PR1801MB2053.namprd18.prod.outlook.com ([fe80::d1ea:e4ef:5fcc:1f42]) by CY4PR1801MB2053.namprd18.prod.outlook.com ([fe80::d1ea:e4ef:5fcc:1f42%5]) with mapi id 15.20.1900.020; Tue, 21 May 2019 08:03:42 +0000 From: Shally Verma To: "Jozwiak, TomaszX" , "Trahe, Fiona" , "dev@dpdk.org" , "stable@dpdk.org" CC: "Trybula, ArturX" Thread-Topic: [PATCH] app/test-compress-perf: fix reliance on integer endianness Thread-Index: AQHVDxVuwhlhcjj1yUi9K6Y9c9YDN6Z1JA+AgAAR+bA= Date: Tue, 21 May 2019 08:03:42 +0000 Message-ID: References: <1558358764-32053-1-git-send-email-tomaszx.jozwiak@intel.com> <1558358764-32053-2-git-send-email-tomaszx.jozwiak@intel.com> <348A99DA5F5B7549AA880327E580B4358976C60C@IRSMSX101.ger.corp.intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [115.113.156.2] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: bee58321-2769-46c3-4708-08d6ddc2d77c x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(7168020)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020); SRVR:CY4PR1801MB1814; x-ms-traffictypediagnostic: CY4PR1801MB1814: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-forefront-prvs: 0044C17179 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(136003)(396003)(366004)(346002)(376002)(13464003)(199004)(189003)(446003)(86362001)(476003)(11346002)(2201001)(316002)(73956011)(76116006)(478600001)(66476007)(64756008)(66446008)(66556008)(68736007)(14454004)(66946007)(52536014)(5660300002)(45080400002)(99286004)(305945005)(7736002)(55236004)(102836004)(25786009)(6506007)(74316002)(486006)(53546011)(81156014)(33656002)(7696005)(76176011)(6246003)(53936002)(81166006)(8676002)(8936002)(4326008)(9686003)(6436002)(2501003)(66066001)(71190400001)(71200400001)(186003)(26005)(6116002)(3846002)(55016002)(2906002)(256004)(14444005)(229853002)(110136005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1801MB1814; H:CY4PR1801MB2053.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: x/TEtgenpgAV/xHZx2ZWY2kj632xBzFXczKn1DBNna3fk1qvSBFyyMspWbuXg9o44aTkZurKYIZHfPXkQYMWyy4Oi5q6R8qzalKjwwPyv3Am5iqS1ZJtA9gH38Z5Riwsy+JuHPWezY9vQVUwOf7Y3RGZgrQmTt6lTNJmEJ6JwZPKtqBvuyAeQt2ZLVU65mnf8xO8FxWLdw0PVBKGzNzCt3/1rYr0JBkYZjlgoQsmDWBQ44zLo5EIqSgwSxSs2THrhLEOZMC3KA5NRk3yec1yt6HRKRSLRxgQLX9lmXsT6u1RzqdGFbRUb5jTHAynBH5uBvGV6L5oDDxTQaiXeUdLfDQao3B+GI2AY7OIy8BLAEwJ9a3/V92hwvdaBhPCkw5OG0vlhJ8ViA5Cy3vTQQ+/exgi7tScFNGrdvPMLJCL6os= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: bee58321-2769-46c3-4708-08d6ddc2d77c X-MS-Exchange-CrossTenant-originalarrivaltime: 21 May 2019 08:03:42.6065 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1801MB1814 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-05-21_01:, , signatures=0 Subject: Re: [dpdk-dev] [PATCH] app/test-compress-perf: fix reliance on integer endianness 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" HI Tomasz > -----Original Message----- > From: Jozwiak, TomaszX > Sent: Tuesday, May 21, 2019 12:18 PM > To: Trahe, Fiona ; dev@dpdk.org; Shally Verma > ; stable@dpdk.org > Cc: Trybula, ArturX > Subject: [EXT] RE: [PATCH] app/test-compress-perf: fix reliance on intege= r > endianness >=20 > External Email >=20 > ---------------------------------------------------------------------- > Hi Fiona, >=20 > Outlook issue :D , so once again >=20 > > -----Original Message----- > > From: Trahe, Fiona > > Sent: Monday, May 20, 2019 4:06 PM > > To: Jozwiak, TomaszX ; dev@dpdk.org; > > shallyv@marvell.com; stable@dpdk.org > > Cc: Trahe, Fiona ; Trybula, ArturX > > > > Subject: RE: [PATCH] app/test-compress-perf: fix reliance on integer > > endianness > > > > HI Tomasz, > > > > > -----Original Message----- > > > From: Jozwiak, TomaszX > > > Sent: Monday, May 20, 2019 2:26 PM > > > To: dev@dpdk.org; Trahe, Fiona ; Jozwiak, > > > TomaszX ; shallyv@marvell.com; > > > stable@dpdk.org > > > Subject: [PATCH] app/test-compress-perf: fix reliance on integer > > > endianness > > > > > > This patch fixes coverity issue: > > > Reliance on integer endianness (INCOMPATIBLE_CAST) in > > parse_window_sz > > > function. > > > > > > Coverity issue: 328524 > > > Fixes: e0b6287c035d ("app/compress-perf: add parser") > > > Cc: stable@dpdk.org > > > > > > Signed-off-by: Tomasz Jozwiak > > > --- > > > app/test-compress-perf/comp_perf_options_parse.c | 4 +++- > > > 1 file changed, 3 insertions(+), 1 deletion(-) > > > > > > diff --git a/app/test-compress-perf/comp_perf_options_parse.c > > > b/app/test-compress- perf/comp_perf_options_parse.c index > > > 2fb6fb4..56ca580 100644 > > > --- a/app/test-compress-perf/comp_perf_options_parse.c > > > +++ b/app/test-compress-perf/comp_perf_options_parse.c > > > @@ -364,13 +364,15 @@ parse_max_num_sgl_segs(struct > > comp_test_data > > > *test_data, const char *arg) static int parse_window_sz(struct > > > comp_test_data *test_data, const char *arg) { > > > - int ret =3D parse_uint16_t((uint16_t *)&test_data->window_sz, arg); > > > + uint16_t tmp; > > > + int ret =3D parse_uint16_t(&tmp, arg); > > > > > > if (ret) { > > > RTE_LOG(ERR, USER1, "Failed to parse window size\n"); > > > return -1; > > > } > > > > > > + test_data->window_sz =3D (int)tmp; > > > return 0; > > > } > > [Fiona] I expect this fixes this coverity issue - but will it result in= another one? > > window_sz on the xform is uint8_t - so this int will get truncated > > later, and there's no cast done at that point. > > Would it be better to add a new parse_uint8_t fn and change test-data- > > >window_sz to a unit8_t? > > Or add that cast? > [Tomek] I measn it's ok. There's a check inside comp_perf_check_capabilit= ies > function. > If the value from test_data->window_sz > cap->window_size we have a fail. > Also during parsing there's a check is value from command line between 0 = and > UINT16_MAX, so in my opinion all cases are tested. The point is there's o= nly > one place where we're parsing uint8_t value. parse_uint8_t function will= be > especially for that. [Shally] What is window_sz in test data ?is it base 2 log of (actual window= length) or actual window length in bytes? lib spec mention this as struct = rte_param_log2_range, so If test window size is actual window length in bytes then I assume test per= f should check for test_data->window_sz > 2 pow cap->window_size but that d= oesn't look like the case.=20 So if it is log value, then coding wise typecasting here doesn't look right= . Though it add need for extra function to parse_uint8, but that looks like= cleaner approach to use.