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 79B1EA0579; Wed, 7 Apr 2021 17:09:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BF85A140F7A; Wed, 7 Apr 2021 17:09:06 +0200 (CEST) Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-eopbgr750050.outbound.protection.outlook.com [40.107.75.50]) by mails.dpdk.org (Postfix) with ESMTP id 62673406A3; Wed, 7 Apr 2021 17:09:03 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=odU1cwcwxzwKBwA8ZAIRnZuO55jIItkRQekJW3lmGKVcDMewlioeJLQkVtPWCk3Qfbzo7Df1aZkbCnPapJqRW4y1zu7gXt5D7lZg7+Q+4Iu7nD4nhRfQtkL+4xBE2HxPVO/bZAlfZMIvdfa63B9D0Rk91Hly9c0G25M//7rmT9k/kySFLe6AQHo3RsuLJgM+DUPrTl+BfhBFwOcrdY6NDojCju1KUBck9x6Vi2f22VWTGe3NggzbZZYNEX8c2Peo2ZjbSpuMPwUbyz3xLikHchrrhvivKmR1CAZ+7tgTgsG34ZH2w7EpLZKjZMIaA8AK8fodP/lk8m4xOPYPlIV5eA== 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-SenderADCheck; bh=rlQFJUOgXi/9kmqRy9ZS2feqqvG7N7GZVZkxBTuES5s=; b=Mn+vXUrgq2PXt70c4zse+GRjyHNFTzTfEjy9enBWAYrNHwRZ6kzPNRsilJrgrnOqdzeFOD/cTLcpHBJ9+Y33+6UKv1DgpUp95S6kWpvoGHUlLkDmGHddjaiXddwfOMM5bfA6mMdTQCHJLMV3O9Regck3Q1EtRvaSujp7vP5jPnzuFZMPKr0u0FzrbCoWTY9xammumLZVWxQrApuJmIbs0BOme5q0QZIjJ8FrH3CSMKsvKffFZlwq33GzP5/HzISL9/fjXEAvRm/H0JYtU+ero4GBkVbF/yF9XmcNDDFnnJ5vUhUFj9UfuN0YryhHUWE7F/+uF0TqZX5C4c5Tlsx97A== 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=rlQFJUOgXi/9kmqRy9ZS2feqqvG7N7GZVZkxBTuES5s=; b=WH/vuKuraHQ/75Qg+13AEChzd3fpqvVzO9gIWq3rT2bB7vqwxJFCX/+x/mWeVrEpcXCa4LHfW5+P/j+HJb8mtkPLtQjMb21j47nKtkSRlbfchuPi+Pl4S7krdQXrjqJAknb/PdMUq9zu2UM68gbafvwiYd+8bkH1BmO0sdjF9kxw1ouRTwXC1xi5b/zz0s96fCKJSit1cWjPEYqrUX/yweyYHey2kO9V/QkNlEHqzMAmqmviMAmmtxDPPpA9acIdTInYka5R+zAe/Hhr2spNonRjQ6s//yGP1N56OVjlChB9anD5ehi8G/Prx3DUvEAk+9pHXApEqv0eZXT5VGtezw== Received: from DM6PR12MB2748.namprd12.prod.outlook.com (2603:10b6:5:43::28) by DM6PR12MB4401.namprd12.prod.outlook.com (2603:10b6:5:2a9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.18; Wed, 7 Apr 2021 15:09:00 +0000 Received: from DM6PR12MB2748.namprd12.prod.outlook.com ([fe80::3d94:1f7f:178f:aba2]) by DM6PR12MB2748.namprd12.prod.outlook.com ([fe80::3d94:1f7f:178f:aba2%6]) with mapi id 15.20.3912.031; Wed, 7 Apr 2021 15:09:00 +0000 From: Raslan Darawsheh To: Alexander Kozyrev , "dev@dpdk.org" CC: "stable@dpdk.org" , Slava Ovsiienko Thread-Topic: [PATCH] net/mlx5: support 64-bit value for modify field action Thread-Index: AQHXK0tXW3fvh/7J7UCfUrWxjUH5/aqpKQ4A Date: Wed, 7 Apr 2021 15:09:00 +0000 Message-ID: References: <20210407011417.22675-1-akozyrev@nvidia.com> In-Reply-To: <20210407011417.22675-1-akozyrev@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [188.161.228.239] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 0803eaeb-1701-44d8-9a22-08d8f9d71315 x-ms-traffictypediagnostic: DM6PR12MB4401: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1775; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: y/rzRJsDocn3xh6zkH/CRs/6beZOibT30YA98QJLYxE5lC2QsOF8EbPIIBeHuIeAssalhcJbv4cTkOUfpdJ3+cNvFB7gq9U7+yqWFswA86UO/xIYSrccDsZXFoTs7uDI00ahFxNh+2EGLMgxjSDj0cPM2WM1sk4UJlme0ld994r2s2BjRviPKL4mue4mKYjaTBZhXdBvc7ljwtJ3oHSg28LVNx0kg4OnszVPxUOaJ8UkIIjxVlfImU3ZccQLJdpNUFOTEPua/Yp2Jg7/DM9lVV8PWCvltKDrWAOjTgN978CWmdjt3wML1AeblYY6SgL9KWohPKEZN6MYCUXclVGlbwI9b40+qWw23i76TIWXTj5bE6iJZCw7FwlX3cxbl2Ne2eqbOjpUlF1we3Jh6ecy0T6NHHUuvYXPJPdg4C/EuXpAbRt4SF5KCRUGE/5kxlbmz83feWp/CgUV7b7hD7ee+v/5V6PUr7pPb5XCrbqYS4uQTq/l1LCbqDm9sIhR0SI/sctVpDNGZdH8pJHQwhjHf9bijWD5Ctvl4g9jhVMoilskb/rMHHpqET2cJfMrXC65l0NDfzd+nwz5LU/LiMu9z0d/kUvEKUo4xWQaDX7hbsoBgEhO8aw/5bCnM2lPuQA5laOJ51hafwWw9xQ6UAcmXk5CFeJda888rruJCsrlkzE= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB2748.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(39860400002)(136003)(376002)(366004)(7696005)(38100700001)(83380400001)(4326008)(86362001)(54906003)(110136005)(316002)(64756008)(30864003)(55016002)(52536014)(66556008)(9686003)(8676002)(26005)(66476007)(66446008)(76116006)(66946007)(8936002)(478600001)(33656002)(2906002)(186003)(71200400001)(450100002)(6506007)(107886003)(53546011)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: =?us-ascii?Q?GN+9VmVlcz6tGy/beQfusfnte8hgUkiF4W40KW9R6BxAnEBbRNq+ZZ9H3Rsv?= =?us-ascii?Q?piHbOvcEKjrHneiFea5NO4lWKMIIwOx9hhtTO63WaPT9CpVHWr4FNpyMIJHG?= =?us-ascii?Q?3bXmhlbFvFuUP6oIHdIqqXa1p9w/XmaukVo0NOQxNSx+nB1ekOIbkWFkwAPz?= =?us-ascii?Q?W5ixduUY/PZoR1LpzhPbCMb4dlaWQrUJGkBpGB70zzzveyeF3MD7Sc5vFj5w?= =?us-ascii?Q?q7SH1XNA9FI1NxpsJgsPZHE4RP9QxpjkY42NwL5i9hRi/vrKGlqTMUsU+r2Q?= =?us-ascii?Q?NZPT8ltKnfYZXBwsOc4sXc2s5Za3sQt+2ofh8x1WDJvT3gckMovw3TvoT2HX?= =?us-ascii?Q?Xm//Ll4uOsKzriIiLaT1gcamZg736Pv5wzt2TiwuqVWD3hXuxx0roy6+2zMt?= =?us-ascii?Q?pK+kwOLzOVvSSdUs4ziMeCqVteQOVWSVrAZRVWdfQiIq3m4jmFjSxakT1Zb9?= =?us-ascii?Q?E20YymwWuM39wHjL+7AUCV2iwp0qRT2Z3V2OpaQFSvCoahn3Crw9y96JUA8A?= =?us-ascii?Q?Boc/nNpFCUdxgYrnblggpHbou2e04tQYyZaZENeLTOt0R5yuutQApOUnWlST?= =?us-ascii?Q?QNUZpfmNJHDKCY16DXPkVI8JGsb1BtUCtPOCDDzF7l3vTJz0nY99cegLY1k/?= =?us-ascii?Q?bYe7yJ6EnuULk/TapNVinqcfhQqewBA4gfyAx0iJqx2OCOKfOMZXqNvlb7dl?= =?us-ascii?Q?gkO5uolCSDJ5wwt8sURbeW9k0EJyeSiqKBZrvZJ0xzLpAWEcHWbxXMmmx8Zr?= =?us-ascii?Q?pavm5czpWAtaNtjQLPnqnTJ/2jIVYGcLn9vutse7G8VwbY/o5EqwClFD8aDO?= =?us-ascii?Q?bSw05dSBDlIXDLAMRtbPrRikp3Cish0CTsZwGaiXNwlpYE8mVn0Trj7I6i9Z?= =?us-ascii?Q?AWfu0ZC/uEucmh9TOfzTzllmisRx+QvXvQYledYJTdJ9V9C4RsE2PmHXTV41?= =?us-ascii?Q?Nn8TjqqByEfUpApDgh2tI4yQYkqYAygN1MkEjne9bzFh3mkIwEnZArpw7ylu?= =?us-ascii?Q?igdqywzmid3n4mFioI0flsmxYvr3g0BFiInGoQVRoGg3Ezd6f8m+Fo+UIwg/?= =?us-ascii?Q?IkinqRQhbLZn2dgMv8bqNGDdtj0Z4j68L45L+sLO/Y6lG+GnVAq66+Davwts?= =?us-ascii?Q?2rUNowuUbhJI/OimPlmANR7BYSOze671ObhC68v6tqk31d+gZTGTaYk97ye6?= =?us-ascii?Q?12S1dKa2/VjUPFwCVq+pjapZgkkhK2wHR/YJ63zrZN9i3TdP1nh8v/uNnUvQ?= =?us-ascii?Q?KBHYmcnbRwxaANy4zHF3qqlhjaFfrvgtFg7oh5DRMHKRX9m1jod9PZZEtCFV?= =?us-ascii?Q?KJ2Ki/GKu7APwRe9aKeD0FJG?= 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: DM6PR12MB2748.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0803eaeb-1701-44d8-9a22-08d8f9d71315 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Apr 2021 15:09:00.5703 (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: xKq7UNXVT/aq3dTaaFyBKz+CNOi3CKsLkHJydKQo2rr5hP+MwBOeFdA7585Qnt+q8CIAr8wuXUD6AbDCUs9PjQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4401 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: support 64-bit value for modify field action 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 Sender: "dev" Hi Alex, This patch is causing a compilation failure as following: [1857/3005] Compiling C object drivers/libtmp_rte_net_mlx5.a.p/net_mlx5_mlx= 5_flow_dv.c.o FAILED: drivers/libtmp_rte_net_mlx5.a.p/net_mlx5_mlx5_flow_dv.c.o gcc -Idrivers/libtmp_rte_net_mlx5.a.p -Idrivers -I../../root/dpdk/drivers -= Idrivers/net/mlx5 -I../../root/dpdk/drivers/net/mlx5 -Idrivers/net/mlx5/lin= ux -I../../root/dpdk/drivers/net/mlx5/linux -Ilib/librte_ethdev -I../../roo= t/dpdk/lib/librte_ethdev -I. -I../../root/dpdk -Iconfig -I../../root/dpdk/c= onfig -Ilib/librte_eal/include -I../../root/dpdk/lib/librte_eal/include -Il= ib/librte_eal/linux/include -I../../root/dpdk/lib/librte_eal/linux/include = -Ilib/librte_eal/x86/include -I../../root/dpdk/lib/librte_eal/x86/include -= Ilib/librte_eal/common -I../../root/dpdk/lib/librte_eal/common -Ilib/librte= _eal -I../../root/dpdk/lib/librte_eal -Ilib/librte_kvargs -I../../root/dpdk= /lib/librte_kvargs -Ilib/librte_metrics -I../../root/dpdk/lib/librte_metric= s -Ilib/librte_telemetry -I../../root/dpdk/lib/librte_telemetry -Ilib/librt= e_net -I../../root/dpdk/lib/librte_net -Ilib/librte_mbuf -I../../root/dpdk/= lib/librte_mbuf -Ilib/librte_mempool -I../../root/dpdk/lib/librte_mempool -= Ilib/librte_ring -I../../root/dpdk/lib/librte_ring -Ilib/librte_meter -I../= ../root/dpdk/lib/librte_meter -Idrivers/bus/pci -I../../root/dpdk/drivers/b= us/pci -I../../root/dpdk/drivers/bus/pci/linux -Ilib/librte_pci -I../../roo= t/dpdk/lib/librte_pci -Idrivers/bus/vdev -I../../root/dpdk/drivers/bus/vdev= -Ilib/librte_hash -I../../root/dpdk/lib/librte_hash -Ilib/librte_rcu -I../= ../root/dpdk/lib/librte_rcu -Idrivers/common/mlx5 -I../../root/dpdk/drivers= /common/mlx5 -Idrivers/common/mlx5/linux -I../../root/dpdk/drivers/common/m= lx5/linux -I/usr/usr/include -fdiagnostics-color=3Dalways -pipe -D_FILE_OFF= SET_BITS=3D64 -Wall -Winvalid-pch -Werror -O2 -g -include rte_config.h -Wex= tra -Wcast-qual -Wdeprecated -Wformat -Wformat-nonliteral -Wformat-security= -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wold-style-d= efinition -Wpointer-arith -Wsign-compare -Wstrict-prototypes -Wundef -Wwrit= e-strings -Wno-address-of-packed-member -Wno-packed-not-aligned -Wno-missin= g-field-initializers -Wno-zero-length-bounds -D_GNU_SOURCE -fPIC -march=3Dn= ative -DALLOW_EXPERIMENTAL_API -DALLOW_INTERNAL_API -Wno-format-truncation = -std=3Dc11 -Wno-strict-prototypes -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_XOPEN_= SOURCE=3D600 -pedantic -DPEDANTIC -MD -MQ drivers/libtmp_rte_net_mlx5.a.p/n= et_mlx5_mlx5_flow_dv.c.o -MF drivers/libtmp_rte_net_mlx5.a.p/net_mlx5_mlx5_= flow_dv.c.o.d -o drivers/libtmp_rte_net_mlx5.a.p/net_mlx5_mlx5_flow_dv.c.o = -c ../../root/dpdk/drivers/net/mlx5/mlx5_flow_dv.c ../../root/dpdk/drivers/net/mlx5/mlx5_flow_dv.c: In function 'mlx5_flow_fie= ld_id_to_modify_info': ../../root/dpdk/drivers/net/mlx5/mlx5_flow_dv.c:1777:4: error: 'memcpy' for= ming offset [8, 63] is out of the bounds [0, 8] of object 'val' with type '= uint64_t' {aka 'long unsigned int'} [-Werror=3Darray-bounds] 1777 | memcpy(&val, (void *)(uintptr_t)data->value, 64); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../../root/dpdk/drivers/net/mlx5/mlx5_flow_dv.c:1398:11: note: 'val' declar= ed here 1398 | uint64_t val =3D 0; | ^~~ cc1: all warnings being treated as errors [1914/3005] Compiling C object drivers/libtmp_rte_net_mlx5.a.p/net_mlx5_mlx= 5_rxtx.c.o ninja: build stopped: subcommand failed. This is with gcc: CC(host): gcc (GCC) 10.2.1 20201125 (Red Hat 10.2.1-9) Kindest regards, Raslan Darawsheh > -----Original Message----- > From: Alexander Kozyrev > Sent: Wednesday, April 7, 2021 4:14 AM > To: dev@dpdk.org > Cc: stable@dpdk.org; Raslan Darawsheh ; Slava > Ovsiienko > Subject: [PATCH] net/mlx5: support 64-bit value for modify field action >=20 > Extend the range of immediate value used in the MODIFY_FIELD action > from 32 to 64 bits to conform to the rte_flow_action_modify_data spec. > Apply appropriate big endian conversion to the immediate value > according to a destination field bit width. >=20 > Fixes: 641dbe4fb053 ("net/mlx5: support modify field flow action") > Cc: stable@dpdk.org >=20 > Signed-off-by: Alexander Kozyrev > --- > drivers/net/mlx5/mlx5_flow_dv.c | 158 +++++++++++++++++--------------- > 1 file changed, 83 insertions(+), 75 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c > index 45e34395a8..6f8d16cec3 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -1325,16 +1325,77 @@ flow_dv_convert_action_modify_ipv6_dscp > MLX5_MODIFICATION_TYPE_SET, > error); > } >=20 > +static int > +mlx5_flow_item_field_width(enum rte_flow_field_id field) > +{ > + switch (field) { > + case RTE_FLOW_FIELD_START: > + return 32; > + case RTE_FLOW_FIELD_MAC_DST: > + case RTE_FLOW_FIELD_MAC_SRC: > + return 48; > + case RTE_FLOW_FIELD_VLAN_TYPE: > + return 16; > + case RTE_FLOW_FIELD_VLAN_ID: > + return 12; > + case RTE_FLOW_FIELD_MAC_TYPE: > + return 16; > + case RTE_FLOW_FIELD_IPV4_DSCP: > + return 6; > + case RTE_FLOW_FIELD_IPV4_TTL: > + return 8; > + case RTE_FLOW_FIELD_IPV4_SRC: > + case RTE_FLOW_FIELD_IPV4_DST: > + return 32; > + case RTE_FLOW_FIELD_IPV6_DSCP: > + return 6; > + case RTE_FLOW_FIELD_IPV6_HOPLIMIT: > + return 8; > + case RTE_FLOW_FIELD_IPV6_SRC: > + case RTE_FLOW_FIELD_IPV6_DST: > + return 128; > + case RTE_FLOW_FIELD_TCP_PORT_SRC: > + case RTE_FLOW_FIELD_TCP_PORT_DST: > + return 16; > + case RTE_FLOW_FIELD_TCP_SEQ_NUM: > + case RTE_FLOW_FIELD_TCP_ACK_NUM: > + return 32; > + case RTE_FLOW_FIELD_TCP_FLAGS: > + return 6; > + case RTE_FLOW_FIELD_UDP_PORT_SRC: > + case RTE_FLOW_FIELD_UDP_PORT_DST: > + return 16; > + case RTE_FLOW_FIELD_VXLAN_VNI: > + case RTE_FLOW_FIELD_GENEVE_VNI: > + return 24; > + case RTE_FLOW_FIELD_GTP_TEID: > + case RTE_FLOW_FIELD_TAG: > + return 32; > + case RTE_FLOW_FIELD_MARK: > + return 24; > + case RTE_FLOW_FIELD_META: > + return 32; > + case RTE_FLOW_FIELD_POINTER: > + case RTE_FLOW_FIELD_VALUE: > + return 64; > + default: > + MLX5_ASSERT(false); > + } > + return 0; > +} > + > static void > mlx5_flow_field_id_to_modify_info > (const struct rte_flow_action_modify_data *data, > struct field_modify_info *info, > - uint32_t *mask, uint32_t *value, uint32_t width, > + uint32_t *mask, uint32_t *value, > + uint32_t width, uint32_t dst_width, > struct rte_eth_dev *dev, > const struct rte_flow_attr *attr, > struct rte_flow_error *error) > { > uint32_t idx =3D 0; > + uint64_t val =3D 0; > switch (data->field) { > case RTE_FLOW_FIELD_START: > /* not supported yet */ > @@ -1698,21 +1759,25 @@ mlx5_flow_field_id_to_modify_info > } > break; > case RTE_FLOW_FIELD_POINTER: > - for (idx =3D 0; idx < MLX5_ACT_MAX_MOD_FIELDS; idx++) { > - if (mask[idx]) { > - memcpy(&value[idx], > - (void *)(uintptr_t)data->value, 32); > - value[idx] =3D rte_cpu_to_be_32(value[idx]); > - break; > - } > - } > - break; > case RTE_FLOW_FIELD_VALUE: > + if (data->field =3D=3D RTE_FLOW_FIELD_POINTER) > + memcpy(&val, (void *)(uintptr_t)data->value, 64); > + else > + val =3D data->value; > for (idx =3D 0; idx < MLX5_ACT_MAX_MOD_FIELDS; idx++) { > if (mask[idx]) { > - value[idx] =3D > - rte_cpu_to_be_32((uint32_t)data- > >value); > - break; > + if (dst_width > 16) { > + value[idx] =3D rte_cpu_to_be_32(val); > + val >>=3D 32; > + } else if (dst_width > 8) { > + value[idx] =3D rte_cpu_to_be_16(val); > + val >>=3D 16; > + } else { > + value[idx] =3D (uint8_t)val; > + val >>=3D 8; > + } > + if (!val) > + break; > } > } > break; > @@ -1757,25 +1822,26 @@ flow_dv_convert_action_modify_field > uint32_t mask[MLX5_ACT_MAX_MOD_FIELDS] =3D {0, 0, 0, 0, 0}; > uint32_t value[MLX5_ACT_MAX_MOD_FIELDS] =3D {0, 0, 0, 0, 0}; > uint32_t type; > + uint32_t dst_width =3D mlx5_flow_item_field_width(conf->dst.field); >=20 > if (conf->src.field =3D=3D RTE_FLOW_FIELD_POINTER || > conf->src.field =3D=3D RTE_FLOW_FIELD_VALUE) { > type =3D MLX5_MODIFICATION_TYPE_SET; > /** For SET fill the destination field (field) first. */ > mlx5_flow_field_id_to_modify_info(&conf->dst, field, mask, > - value, conf->width, dev, attr, error); > + value, conf->width, dst_width, dev, attr, error); > /** Then copy immediate value from source as per mask. */ > mlx5_flow_field_id_to_modify_info(&conf->src, dcopy, > mask, > - value, conf->width, dev, attr, error); > + value, conf->width, dst_width, dev, attr, error); > item.spec =3D &value; > } else { > type =3D MLX5_MODIFICATION_TYPE_COPY; > /** For COPY fill the destination field (dcopy) without mask. > */ > mlx5_flow_field_id_to_modify_info(&conf->dst, dcopy, > NULL, > - value, conf->width, dev, attr, error); > + value, conf->width, dst_width, dev, attr, error); > /** Then construct the source field (field) with mask. */ > mlx5_flow_field_id_to_modify_info(&conf->src, field, mask, > - value, conf->width, dev, attr, error); > + value, conf->width, dst_width, dev, attr, error); > } > item.mask =3D &mask; > return flow_dv_convert_modify_action(&item, > @@ -4469,64 +4535,6 @@ flow_dv_validate_action_modify_ttl(const > uint64_t action_flags, > return ret; > } >=20 > -static int > -mlx5_flow_item_field_width(enum rte_flow_field_id field) > -{ > - switch (field) { > - case RTE_FLOW_FIELD_START: > - return 32; > - case RTE_FLOW_FIELD_MAC_DST: > - case RTE_FLOW_FIELD_MAC_SRC: > - return 48; > - case RTE_FLOW_FIELD_VLAN_TYPE: > - return 16; > - case RTE_FLOW_FIELD_VLAN_ID: > - return 12; > - case RTE_FLOW_FIELD_MAC_TYPE: > - return 16; > - case RTE_FLOW_FIELD_IPV4_DSCP: > - return 6; > - case RTE_FLOW_FIELD_IPV4_TTL: > - return 8; > - case RTE_FLOW_FIELD_IPV4_SRC: > - case RTE_FLOW_FIELD_IPV4_DST: > - return 32; > - case RTE_FLOW_FIELD_IPV6_DSCP: > - return 6; > - case RTE_FLOW_FIELD_IPV6_HOPLIMIT: > - return 8; > - case RTE_FLOW_FIELD_IPV6_SRC: > - case RTE_FLOW_FIELD_IPV6_DST: > - return 128; > - case RTE_FLOW_FIELD_TCP_PORT_SRC: > - case RTE_FLOW_FIELD_TCP_PORT_DST: > - return 16; > - case RTE_FLOW_FIELD_TCP_SEQ_NUM: > - case RTE_FLOW_FIELD_TCP_ACK_NUM: > - return 32; > - case RTE_FLOW_FIELD_TCP_FLAGS: > - return 6; > - case RTE_FLOW_FIELD_UDP_PORT_SRC: > - case RTE_FLOW_FIELD_UDP_PORT_DST: > - return 16; > - case RTE_FLOW_FIELD_VXLAN_VNI: > - case RTE_FLOW_FIELD_GENEVE_VNI: > - return 24; > - case RTE_FLOW_FIELD_GTP_TEID: > - case RTE_FLOW_FIELD_TAG: > - return 32; > - case RTE_FLOW_FIELD_MARK: > - return 24; > - case RTE_FLOW_FIELD_META: > - case RTE_FLOW_FIELD_POINTER: > - case RTE_FLOW_FIELD_VALUE: > - return 32; > - default: > - MLX5_ASSERT(false); > - } > - return 0; > -} > - > /** > * Validate the generic modify field actions. > * @param[in] dev > -- > 2.24.1