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 05E05A0540; Mon, 20 Jul 2020 14:14:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7929E1023; Mon, 20 Jul 2020 14:14:34 +0200 (CEST) Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2080.outbound.protection.outlook.com [40.107.22.80]) by dpdk.org (Postfix) with ESMTP id 2A92AA69 for ; Mon, 20 Jul 2020 14:14:33 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IXhwD+G4roudDkSzupUkYIue/gKlUWibMA+8Wp9mUzRYK53dbPMztA4MqJrwcH5BDCoHxWzFWBL8I9PFyDFxF84soFMMvKV3YZX3B6X8nCZJL5CeXJDyaFxWl9Pqs7gNIGBGBcJkRgRYkA06PrVp0Y8TFAP7jM8ilQqhw5VqPqiGsIpqacFTrPdTTqpqqWi2hRxJMO/UmHikX254/s2T/uY/F30+8HSzq2b/hwoV87Svn8RZ7EG6NuhfoxqC0Hksfh7JYUn/1ztL/IcQY0lwxH1fDgWIcyfEJ6qV72qmvxz3LlwuS8LD7R6NxrNICnboBjDpgTHCLFm/K704QqvgFA== 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=N+EPFgcQZ9o3c9uQqUa1XN4jBKtNGKVRYcggZTHnUUU=; b=RcqyM0ElbF5ThEaKAce92eCPCafy1gQG4kBdSWeiVd32d8wO/HEHIA0BjYVUqSfhPHIDPc0Xf+F91EmBPPz9PA+7gCfTEojsHmQSV94DmA7FEO2UaIXpi+6TBiBNYe9aF3sGO5FeJhZ4gaoVTugI+UEylzUEEwhUuvEtleIUyqTkq9WQk0Ym0nzHJkX5d0x7L5dUrpW0iwzXsSRrH/earHMEHi7qG0q62Rt1lxLGCt5EQVKxCuw0KUPP/mauxil98oo1UCyGrBsseJYfaHQ28OrLtq3lpshWOmDmm56eiwlyHBc6RdZDDMhSLW4QX6Afs/Nf11sBfJQ921As2ryIRA== 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=N+EPFgcQZ9o3c9uQqUa1XN4jBKtNGKVRYcggZTHnUUU=; b=hXq6pBa0A8ZjYG/tWCPimX6BRSWVMJy4w2sSQMSZaF6ZreiWAah1bKLVjcA1VheYWQfxEQBk0TX6Ab8mrJGRymSiwjyPdFXLLIVJaC7UdnskvS9h3TWs87/l1zrTfYfhPryVS5uLNF44ajJ4fDbK5oGx1eymoVinDFqTdQECiNU= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (2603:10a6:20b:15b::17) by AM4PR05MB3460.eurprd05.prod.outlook.com (2603:10a6:205:6::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.23; Mon, 20 Jul 2020 12:14:32 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::ecd3:6008:3784:4012]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::ecd3:6008:3784:4012%5]) with mapi id 15.20.3195.025; Mon, 20 Jul 2020 12:14:32 +0000 From: Raslan Darawsheh To: Bing Zhao , Ori Kam , Slava Ovsiienko CC: Matan Azrad , "dev@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix the compatibility with MISC4 Thread-Index: AQHWXnSy/tIYKaf6N0W3yg4bZYKkfakQYXsg Date: Mon, 20 Jul 2020 12:14:32 +0000 Message-ID: References: <1595235822-114874-1-git-send-email-bingz@mellanox.com> In-Reply-To: <1595235822-114874-1-git-send-email-bingz@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: mellanox.com; dkim=none (message not signed) header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [84.242.49.134] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: b4a9767f-379c-4673-2bf3-08d82ca675ac x-ms-traffictypediagnostic: AM4PR05MB3460: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1923; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: QYhzdegMjVJTJZ+m002GHrMR6P39VkDMqbl404BRh2iYPj5djSWx27/5MesuJvk7AuZdpAduoHtBC2dK2MnTCuM+0449EKE5E2J9pJoUnAYKWDU8x2t64r7qDV3/IAsTFuuj33Q0w6V5CzJ4Q7NiYx6/z+V85HQyisXLdamxkgKwhWr3Vi5iG8GfiN+Wc7fMSotLSaW0Uqikxx6ama5MqwnTFVHPAbLJLpUY2e/r5/QNJ1EAEl2QSD2VYX0HLgcATc+Awrs4Hu3352IWB6s0xWL0ODgWwAkuOaYilcWc6JugQ2Pg1JkULzIPkXOoauhj x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB6707.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(396003)(376002)(136003)(346002)(39860400002)(366004)(4326008)(9686003)(478600001)(86362001)(54906003)(110136005)(52536014)(186003)(2906002)(76116006)(64756008)(66556008)(66476007)(66946007)(6636002)(316002)(8936002)(8676002)(7696005)(66446008)(53546011)(6506007)(71200400001)(83380400001)(26005)(55016002)(5660300002)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: IwG86OKtuGE9cwsqHvehJHHcXWvOJcgFLLc5ORnYzQZ9JUVE7sSLr8bXUZJxSzoAe69wY+v0mEH9pyUB1oTTSdtoFYvP9v3ONejq/9a45u1ebL+/rMrdZwEbs4F2Rln7mnHPUhm8GMyq0Di850xgIZpJkAZYzUI584akS1iPvo68xKRb7M9tuFWtRLo3TpketTKJixxsbdyYafN5mrW13FFd1HLcQdSRosyy7fYvFACLqpoHefGimwkiZItEARlhFFq3Nceb523SIRPWrH9kO3NutFKpHmCrnNO8wEGc9vhrY1iqWlb0PZ9g+j38ieyfbUrtuQLFf0GAp/ZVaDvQ8ReXtgToUrVB8Hb3O7MUze4Y2tvmv4Jv6KWD3BpxZiezg925R08IE5BW2O6jHIo/7NEGOVtQnpqShHfXSNiW/82WpxCiZu9/tZp3Pv/FDCvaCyN3lqrni47oDaP6FUvtnMXoWz5Zr6q+DNijghOsUbRLoLycxN0phFC4RtG0Cpm7 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: AM0PR05MB6707.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4a9767f-379c-4673-2bf3-08d82ca675ac X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2020 12:14:32.2410 (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: +G1hYQOpt53wTs9zZhy/HW4yZCqcTVbzZtt/65Q8F55c5CW2Ubd85rBz2T/AXax7jxrhjmK8XRxBqCKFC8/Cyg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3460 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix the compatibility with MISC4 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: Bing Zhao > Sent: Monday, July 20, 2020 12:04 PM > To: Ori Kam ; Slava Ovsiienko > > Cc: Raslan Darawsheh ; Matan Azrad > ; dev@dpdk.org > Subject: [PATCH] net/mlx5: fix the compatibility with MISC4 >=20 > When eCPRI offloading is introduced, the support for misc parameters > 4 of flow table entry (FTE) match set is needed. The structure of > "mlx5_ifc_fte_match_param_bits" is extended with > "mlx5_ifc_fte_match_set_misc4_bits" at the end of it. The total size > of the FTE match set will be changed into 384 bytes from 320 bytes. > Low level user space driver (rdma-core) will have the validation of > the length of FTE match set. In the old release that no MISC4 > supported in the rdma-core, the validation will fail, and this will > break the backward compatibility, even if the MISC4 is not used in > most cases. > In order to make new mlx5 PMD work well with old rdma-core, the > length adjustment needs to be done. When creating a flow, the lengths > of the matcher and value are both set to 320 without MISC4. There is > no need to change the structure definition, all bytes of the MISC4 > will be discarded if it is not needed. Or else, like in eCPRI > matching, the lengths will be adjusted to 384 for matcher creation > and value matching. >=20 > Fixes: afa8556c873c ("net/mlx5: add flow translation of eCPRI header") >=20 > Signed-off-by: Bing Zhao > Acked-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_flow_dv.c | 17 +++++++++++++++-- > 1 file changed, 15 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c > index ee66a44..778a766 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -5765,7 +5765,15 @@ struct field_modify_info modify_tcp[] =3D { > dev_flow =3D &((struct mlx5_flow *)priv->inter_flows)[priv- > >flow_idx++]; > dev_flow->handle =3D dev_handle; > dev_flow->handle_idx =3D handle_idx; > - dev_flow->dv.value.size =3D MLX5_ST_SZ_BYTES(fte_match_param); > + /* > + * In some old rdma-core releases, before continuing, a check of the > + * length of matching parameter will be done at first. It needs to use > + * the length without misc4 param. If the flow has misc4 support, > then > + * the length needs to be adjusted accordingly. Each param member > is > + * aligned with a 64B boundary naturally. > + */ > + dev_flow->dv.value.size =3D MLX5_ST_SZ_BYTES(fte_match_param) - > + MLX5_ST_SZ_BYTES(fte_match_set_misc4); > /* > * The matching value needs to be cleared to 0 before using. In the > * past, it will be automatically cleared when using rte_*alloc > @@ -7986,7 +7994,8 @@ struct field_modify_info modify_tcp[] =3D { > uint64_t priority =3D attr->priority; > struct mlx5_flow_dv_matcher matcher =3D { > .mask =3D { > - .size =3D sizeof(matcher.mask.buf), > + .size =3D sizeof(matcher.mask.buf) - > + MLX5_ST_SZ_BYTES(fte_match_set_misc4), > }, > }; > int actions_n =3D 0; > @@ -8678,6 +8687,10 @@ struct field_modify_info modify_tcp[] =3D { > NULL, > "cannot create eCPRI > parser"); > } > + /* Adjust the length matcher and device flow value. > */ > + matcher.mask.size =3D > MLX5_ST_SZ_BYTES(fte_match_param); > + dev_flow->dv.value.size =3D > + > MLX5_ST_SZ_BYTES(fte_match_param); > flow_dv_translate_item_ecpri(dev, match_mask, > match_value, items); > /* No other protocol should follow eCPRI layer. */ > -- > 1.8.3.1 Patch squashed into relevant commit in master-net-mlx, Kindest regards, Raslan Darawsheh