From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5F2CEA04FA; Wed, 8 Jan 2020 10:03:41 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 773B91D73A; Wed, 8 Jan 2020 10:03:40 +0100 (CET) Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20069.outbound.protection.outlook.com [40.107.2.69]) by dpdk.org (Postfix) with ESMTP id 500B41D696; Wed, 8 Jan 2020 10:03:39 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XXwSXjoiY4QR5TXpIzmc9r6QgtemGp0OfpHiIwgsyJyZj6SLAwI9NE8SNG5mOoVQPL8HH4hrcvSy8RRxq/3WfusaEPacZe4HoCKqIi8lS7+g4hAXTvs9TQuLkp6cXOKUZeadasX3XuixBVBv58DwQNC0FPK23mz52JMsF8Rb3vKyJbw4WK5rilpJESX5wAtxo/p2jWOWQOnDJi2lLoYpPeyIxo1Fjrrch/bcSXDFQqa3N5ZnWRy/A6DjqPLUGs9I4zG7mpEuUhyi1rsARyRkVwMOszL0ZbCgSDg9373GiNfAfRvpCLFcZhkMOUj03x+HhefbNTuuD9AyiKSbFmvAcw== 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=/vq3/Fth2WxEDmVNZ483cx1JVDN3hESTyoOhIlg/Ag0=; b=l3VofMyH1gJa/nX27Zvyy4DJcsprfg/dEPR/XIZkLk16F2y5JzHB9QvKNEXLAdHOAr8wN0PXTcnHz7sB2cC2zTxbNGgUAcvJWsQhoeMG9cZvQ+0zjKE0Cl/JBkDM0friAtrZ6QGENLCpOORxfoZDMd08FjI9jVkjJbcgCkrdn4PvmJrRlXBhX2kUCgR02PVSuXW5rjoZs5mUHidQPcXNQ4wIibdhLhFxM547Uw98j4QiYuNAdVQqlORJ68qQoBfrTbdfaGRpcJgfnaZ5dLG30IBiCSoo5hTyjVgrnmvwvDPX5BYm9kQfSUVb/Y2zKi5YEmnJ9Y6PgNNo8acqQr4xdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/vq3/Fth2WxEDmVNZ483cx1JVDN3hESTyoOhIlg/Ag0=; b=pe/B1RbiCeG0wWmxmKx5vclLYlYIIuqPQJPLbcr4d7nKloi4i4blzRCbX73A6N9EuFLZJaysMO0T9WzItMl5VG5GVvjMpDAEQ3sjYVjMuji3szhNw1b/0hvqo0V9wI14wPzHBGKBp++5IJSzxUSE+nOzd9CXlxC//qTf8qLPeFg= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (10.186.174.145) by AM0PR05MB5204.eurprd05.prod.outlook.com (20.178.18.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.10; Wed, 8 Jan 2020 09:03:32 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::95ff:bfb2:7f11:87b2]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::95ff:bfb2:7f11:87b2%5]) with mapi id 15.20.2602.017; Wed, 8 Jan 2020 09:03:32 +0000 From: Raslan Darawsheh To: Slava Ovsiienko , "dev@dpdk.org" CC: Matan Azrad , Ori Kam , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix metadata item endianness conversion Thread-Index: AQHVumVh8lVoUtwa4ke5db8BBbyyY6fgkCPw Date: Wed, 8 Jan 2020 09:03:32 +0000 Message-ID: References: <1577197235-26433-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1577197235-26433-1-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=rasland@mellanox.com; x-originating-ip: [212.29.221.74] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 9119e069-da43-4ad8-16c9-08d79419a2c8 x-ms-traffictypediagnostic: AM0PR05MB5204:|AM0PR05MB5204: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 02760F0D1C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(346002)(39860400002)(376002)(136003)(366004)(13464003)(189003)(199004)(478600001)(86362001)(8936002)(26005)(54906003)(316002)(9686003)(186003)(2906002)(81156014)(71200400001)(66946007)(66476007)(66446008)(8676002)(66556008)(64756008)(4326008)(76116006)(81166006)(450100002)(7696005)(33656002)(53546011)(6506007)(52536014)(5660300002)(110136005)(55016002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB5204; H:AM0PR05MB6707.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: HqiQ0RNvBnztr3uxxZoiq75beHlxXJD2aihfXE3s1JGfjxVxlELQw9lmSObYCsCtGvbzbcz8IAQun+eFwoHcYBlmEBRl5q3pzo1j0GT1tZIwfOT3YKqr2TCKsqE8WvA0IAaHhuqUDolBEe3woAq9neV31CFAtO2YLTVBSEPkgGwm7BGQ3xfcwIvlHdNT9A3qbBerdAnBy86nC0QMspDqFhaskp/YlyobuaxwnPZSR1E1qbPghuneRAEcOBED3+KCB5kAFeNIzQ4pDpXKBIzCXKvaiH7nl8DkkzYxPdg95v4BC0NAVd/5VC87wppQPsOuKD3iMqHUVFUcawc+eMyGT5LvJqpraXj4BOQyn2/jsLGox7RvgZeAnrfwQU4zxsoaZTdPh+CcLmPd7QLqIy++W8BdwKVaWcifXAJqgbrMkfxZv0zugzuw9hqcj+ij8M++a+826Q4xZ7p3CRQa0AaTNKbu/zVydP1nTxPpj2db3AGqO4XtCODiCq/mBwGa7rYV Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9119e069-da43-4ad8-16c9-08d79419a2c8 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jan 2020 09:03:32.1164 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 5X++4hYFOgUSZaXesugewQF3ZMJ9zBbqEpncn/OytW9eTd9oYwiGda6F+koUvS35pRq5fXJsjbsQDY66IH+LyA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5204 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix metadata item endianness conversion 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, > -----Original Message----- > From: Viacheslav Ovsiienko > Sent: Tuesday, December 24, 2019 4:21 PM > To: dev@dpdk.org > Cc: Matan Azrad ; Raslan Darawsheh > ; Ori Kam ; > stable@dpdk.org > Subject: [PATCH] net/mlx5: fix metadata item endianness conversion >=20 > The metadata register c0 field in the matcher might be split into two > independent fields - the source vport index and META item value. These > fields have no permanent assigned bits, the configuration is queried from= the > kernel drivers. >=20 > It means the metadata item field might be less than 32 bits. > Also, the metadata are engaged in datapath and there are no any metadata > endianness conversions in datapath to provide the better performance, all > conversions are implemented in rte_flow engine. If there are less than 32 > bits of metadata the extra right shift is needed after endianness convers= ion > for little- endian hosts. >=20 > Fixes: acfcd5c52f94 ("net/mlx5: update meta register matcher set") > Cc: stable@dpdk.org >=20 > Signed-off-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_flow_dv.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c index f8e153c..cb416ca 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -5903,8 +5903,12 @@ struct field_modify_info modify_tcp[] =3D { > struct mlx5_priv *priv =3D dev->data->dev_private; > uint32_t msk_c0 =3D priv->sh->dv_regc0_mask; > uint32_t shl_c0 =3D rte_bsf32(msk_c0); > +#if RTE_BYTE_ORDER =3D=3D RTE_LITTLE_ENDIAN > + uint32_t shr_c0 =3D __builtin_clz(priv->sh- > >dv_meta_mask); >=20 > - msk_c0 =3D rte_cpu_to_be_32(msk_c0); > + value >>=3D shr_c0; > + mask >>=3D shr_c0; > +#endif > value <<=3D shl_c0; > mask <<=3D shl_c0; > assert(msk_c0); > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh