From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 0DB1741B86; Tue, 31 Jan 2023 03:05:55 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 82CC440EF0; Tue, 31 Jan 2023 03:05:54 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2040.outbound.protection.outlook.com [40.107.223.40]) by mails.dpdk.org (Postfix) with ESMTP id 2CEE140DFB for ; Tue, 31 Jan 2023 03:05:53 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WAC70BUHju/J7o36k2g/K0J7pvYRkb7STpb8r8vehlQxVuQ4hJsoKFtV0lcG8UOCc4gtX+EEEYS+71uXO5k6vRG6pqtYj3AXSup/HsQf0hHQT4E7Awh+JTzLkSChNxED5C82l8R4b5DILOh63mKUZuFYuZJIQgUt12Jf3Cc+sU8ngmruUVW2NCIlVzFGHRtQUW/mrKvo+hRJv2X9yJA9dC14JmyQ5v8IwZlODz7FSccnv2YV1VuOCttTSK5jGiWPLIBWHAbY5ZR86J41LQLr+H6M75iGewPLzKo6dO1DNfwJILXfzkVZLIaJ8nN/vbbJbimWz0O21JARGOc+tM6dTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=HBgoX5d9ZKqgPG3FkTO+7R8Tw2ywKiTguFiR89mP5TU=; b=RMYJMCA+Z4F0pBer9OACtTFPAHg9tkVb/uszRPs1niUwFRy/YrX039YRe4sn8YhAbwMXtQWvoZg0RdtdhGEGdqq68kD2WpmTsWIwctRVaUh1kcmq35jgNdXzabzoi+GDx4cOfNY3SzF/jbb+Xo1JDq3mzjN05mFC1emCdZeL1GHudlEAgIcJ0qeTO6ssVUtqYIz8YjKrsWWD9/bgayxked0PMWSkwoGMqjfszZvhp5x9Tl/T40wWpF+Rzh7V64PVOCiPMSMap4o83GB+5K1W98vkXfgqVObJKsHACNH8MY12CqX+y2xubGaaxJ7Sqf2PIbMaxVMrDjpWiPUfMPPcfw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=HBgoX5d9ZKqgPG3FkTO+7R8Tw2ywKiTguFiR89mP5TU=; b=cRI9zqv39pApbdmkYGLwII52EtHubwz/ZOw77zK2g3vsHr9sphCXKR0yJRMP8J32ZpL8VtekJwmC8q3Xlk2s0DZhDnteyBHcLm+swA1E7qK3DE83JfU7NY27BCmd0GvW0dKRVkTs9LMIfcc7jdZW4v3e6OBDG3X/vde9/aSckNKK7ZUxIXr7XotGKZOPxLRCKmNlbwVjAciWZ2O+LzOyfai5AsXgO5QSXbG7J6S+hbq8Pu1V0wlimp4G3xuqQpJ8K7EyHpvKurCRB8Qqz7zYK802CsV0vw3E1kfC5DGRLzbhgiFmt+kdryKOTUo7gzNo2idCW0HotITVCQli+uidtQ== Received: from BN9PR12MB5273.namprd12.prod.outlook.com (2603:10b6:408:11e::22) by CH0PR12MB5171.namprd12.prod.outlook.com (2603:10b6:610:ba::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.36; Tue, 31 Jan 2023 02:05:51 +0000 Received: from BN9PR12MB5273.namprd12.prod.outlook.com ([fe80::2296:10b9:2661:d795]) by BN9PR12MB5273.namprd12.prod.outlook.com ([fe80::2296:10b9:2661:d795%4]) with mapi id 15.20.6043.036; Tue, 31 Jan 2023 02:05:50 +0000 From: Rongwei Liu To: Stephen Hemminger CC: Matan Azrad , Slava Ovsiienko , Ori Kam , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , Aman Singh , Yuying Zhang , Ferruh Yigit , Andrew Rybchenko , Olivier Matz , "dev@dpdk.org" , Raslan Darawsheh Subject: RE: [PATCH v3 1/8] ethdev: add IPv6 routing extension header definition Thread-Topic: [PATCH v3 1/8] ethdev: add IPv6 routing extension header definition Thread-Index: AQHZNF9etRydylFxuESS1WiqhsKrHa63LRmAgACapaA= Date: Tue, 31 Jan 2023 02:05:50 +0000 Message-ID: References: <5da6632a-0976-dc1f-facb-f778c8aad8e6@oktetlabs.ru> <20230130035941.1495874-1-rongweil@nvidia.com> <20230130035941.1495874-2-rongweil@nvidia.com> <20230130085013.02e4faf8@hermes.local> In-Reply-To: <20230130085013.02e4faf8@hermes.local> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN9PR12MB5273:EE_|CH0PR12MB5171:EE_ x-ms-office365-filtering-correlation-id: 7f04539f-6018-41b5-7ad7-08db032fad43 x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: LqyyS9DMKz2PaR2axZU7aTfT4jBOu/CJ8CmkDlTZH3LhdFo2PwUvdZ9bqssNEpW6tQnnhJONBX7K5BjmoQoXe8Sn40HYvKzoNrfVuKTT1Y1PaHna4D7wXq+FFnC1yXuUH9ayVjszat76dWFTQJLfkw+Eg0SxOVYB+EU6MutxtaBxt4IE7cqcwAR0MjJVQyaXNEaiPUIs+s+TaBLqloQTSORVpctmDlgVlw3yEHsN4KW1vtVHP24doV7GFLKRWUSNcxC/iCIXFzOWN/eD/ZwK3vPNe4hfRWtfYq+AgJEf28CeQ+lY2etKvF0gjJmfAYcqQ5gQ618JOw7jopvbq5OJQ7AH+nDgbX8/Ia4q6iH/c6mTIlM/Qg/OCdYk0QXG+6BHtdIxv5loHzqugXbkLRZNQu5sUrw5eZ+wT+rxOaacmsnG4xv93b0AcnvMbO5Mr1q9k+thWLsm9B3XoNm7gTwfIrGBFNOo2HfWNPO0vnfV/oZHaLbicsrpqx4oRLFVKUtSo3TqQQkk/8UmdPL//Dfvoj4ElSb6R4lceSEmcImyz97MEGLkYGz45TzEZKf//B/Xl7L1yEU6AmsCkBD8qKNuQ6YTLDVgeKD7UbBN/DOXoxK3PG4bClgeDrVMPGTBQIcfIH79G02WTuFeJ7fVSrl/z+WUsolFEwZIfzcvUN/ZS3RbBIfDOj1hj6yCd/LZB5Ink1AvSUVYZeOmRXeGEAzmEw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR12MB5273.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(366004)(136003)(376002)(396003)(39860400002)(346002)(451199018)(54906003)(66476007)(8676002)(4326008)(64756008)(6916009)(76116006)(8936002)(66946007)(66446008)(5660300002)(52536014)(316002)(38100700002)(122000001)(86362001)(33656002)(38070700005)(66556008)(107886003)(53546011)(71200400001)(6506007)(26005)(9686003)(186003)(55016003)(2906002)(478600001)(7696005)(41300700001)(83380400001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?JsNrYLaU+8C3xd/nnUE4Gyi64y8cQ41vff2yPcKhgJq4Ls3WU9upCmfF7xZx?= =?us-ascii?Q?b18x9CTQ5NfwNiCNbY3UN/iK0J/If49NtvVAZmryfB9jgY7k5zSJN8/Ot5Dw?= =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At5aJYACNaskWtKDZg+kkwTBp?= =?us-ascii?Q?sfe4KTMOGD3UZ3ufbM2af3GB1Yi56TTcVUZKK3ASdXwGOHcRg5Viti3PGYqo?= =?us-ascii?Q?YbmcGnNd5XbSK1msRv+4lnFys/Elk7aNcWwRr4AgtOwzyyACW+BtGAL9/YH/?= =?us-ascii?Q?kMZ/4v/XtYV0nMvNOsNAcw1FFh799quY4Qkj0VHF+A7JMtEBRWlkCkz6/oRu?= =?us-ascii?Q?357r0HTY4X5yTAE3B1O6ThyGrDW9T7kW+SeJkq76ZUUKGQN1Ymc4CEcmSXVa?= =?us-ascii?Q?Wr379pOpHbb8MpTQi5i2sOoLme1A2lhy8/Y7TdxzbjbbhuTLmHdJ5neQhfOG?= =?us-ascii?Q?eVvcgkYw13iv/LOOU3rBH9AyzkyeQgqaJJ5qwLHJ3vdFRitu0In06ZbOdUCz?= =?us-ascii?Q?1HbbSuVNHc+uwLChZCrO9U2UCWQKaDsOoVmmJmtAIAFsSZwgj7A8/wcFiP01?= =?us-ascii?Q?ToqUVe2MGgi3SVXuBoi6vhzFuf1h4cqZJqEqRhkJy+9f0XCRqaMbAswhGu+R?= =?us-ascii?Q?shNLDRJvWHE7rI/2zA31ec7uS9/j/vWq08vU/qKb+mpSrMkTzV2s6XMIGCFY?= =?us-ascii?Q?YQUONdq0rP73R/n7o4WrxKnJr/nIEKpcY63iK3ao?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR12MB5273.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7f04539f-6018-41b5-7ad7-08db032fad43 X-MS-Exchange-CrossTenant-originalarrivaltime: 31 Jan 2023 02:05:50.7659 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: x0DK/O8mE2sfal3B1XMNSxrCxYHQe2i8kDa54gG/686Lvmfeund7RDPaBOSCI2ORflXdZ526KgcSZhnVWWCsaw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5171 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org HI Stephen: BR Rongwei > -----Original Message----- > From: Stephen Hemminger > Sent: Tuesday, January 31, 2023 00:50 > To: Rongwei Liu > Cc: Matan Azrad ; Slava Ovsiienko > ; Ori Kam ; NBU-Contact- > Thomas Monjalon (EXTERNAL) ; Aman Singh > ; Yuying Zhang ; > Ferruh Yigit ; Andrew Rybchenko > ; Olivier Matz ; > dev@dpdk.org; Raslan Darawsheh > Subject: Re: [PATCH v3 1/8] ethdev: add IPv6 routing extension header > definition >=20 > External email: Use caution opening links or attachments >=20 >=20 > On Mon, 30 Jan 2023 05:59:33 +0200 > Rongwei Liu wrote: >=20 > > +static size_t > > +rte_flow_item_ipv6_routing_ext_conv(void *buf, const void *data) >=20 > > +{ > > + struct rte_flow_item_ipv6_routing_ext *dst =3D buf; > > + const struct rte_flow_item_ipv6_routing_ext *src =3D data; > > + size_t len; > > + > > + if (src->hdr.hdr_len) > > + len =3D src->hdr.hdr_len << 3; > > + else > > + len =3D src->hdr.segments_left << 4; > > + if (dst =3D=3D NULL) > > + return 0; > > + rte_memcpy((void *)((uintptr_t)(dst->hdr.segments)), src->hdr.seg= ments, > len); > > + return len; >=20 > Why use rte_memcpy for such a small size? Please just use normal memcpy > which will cause more compiler and static scan checking. >=20 Following existing routine, rte_flow_item_***_conv(). Change to memcpy() in= the next version > That cast is unnecessary in C because "segments" is an array and any vali= d > pointer type can be passed as void *. Sure