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 5D400A0563; Tue, 17 Mar 2020 13:42:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BF2241BE51; Tue, 17 Mar 2020 13:42:07 +0100 (CET) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40066.outbound.protection.outlook.com [40.107.4.66]) by dpdk.org (Postfix) with ESMTP id 24FAB25D9; Tue, 17 Mar 2020 13:42:06 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SWUd1YEqHshBmiK6Cye/1ltbQef9YAoMDf9pw5VbtK7eqtd7hI4P34M4aaHN52/xx9F1Dn/03NjXocl9eA64+N8wu5wrRDq+O4X4vD61rPVe3KmdsPC+xJIq7dUQYswVkbzgTdpd6jAUfP6p3JZWlnZ+PToGCTEGH70Gc6w6QzI9+bk0gte97I5ua6UEaZXDsCxVJfu6kqlLUaIYJUg3yP8wsXBOaR9teccnwZ/lPZGur+ibDOwWSVs0NXgpOIvmK+S9/f64NtN4llxd53wr1D6KKWkTFQgNWEdXdiEBUXt4J6qOxLSj8fiPQsbAzYAIRQVayaOHIcgYRT0slEKy1Q== 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=rAWOkTkRlNV9c9qPNM/xq9JJxUJqrYoUwHQenlnb76A=; b=nLmuZqC31PTK4++vyPr98TWHPoQw4wcwybsN/WIYGsJhAtzB25xqYq+DiA7mRjhDsJH0/JAhqgrWnQPh+fs5nR3pBG1OzdqZkrAkFS2brujiPtJdqzupeSI7+BgYGOkU8vnTmzowTWXjLAzHOA3oZjuYKfbU2Et0cSOReoc4Ekw/yuUqetkfW9sXG6eeuA3wfGHCKDYUvSF/azT8w9WkVGAYPSnWDsdl8DFT2UbD2P5SSNbomuqF89i3J4f10CH4l53vcH6oAIOmKD2mx+4yvOz5ut8hu91TSEQgygUIjmKP66wH3Q7T5IlBrj6IREitFMRuox4nnjkmJOU6qlkPnA== 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=rAWOkTkRlNV9c9qPNM/xq9JJxUJqrYoUwHQenlnb76A=; b=qI/XzSwFdfyTndBagJppgPq8PicoT3q76eSsRikEsRLAersASRZGG+HragRbne9fLPUhh8VVQ0yDBzZVeqCyrMjbrgPF9Enl0hU/cuFy30EYKwyWJzHklBGiqpVJB8yRbrASgwOQ6QxQbVEXFhVOIyajMa+FpRQWqBiKjq44FLg= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (10.186.174.145) by AM0PR05MB5234.eurprd05.prod.outlook.com (20.178.18.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2814.19; Tue, 17 Mar 2020 12:42:04 +0000 Received: from AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::adbd:45ca:54:bba9]) by AM0PR05MB6707.eurprd05.prod.outlook.com ([fe80::adbd:45ca:54:bba9%7]) with mapi id 15.20.2814.021; Tue, 17 Mar 2020 12:42:04 +0000 From: Raslan Darawsheh To: Dekel Peled , Matan Azrad , Slava Ovsiienko CC: "dev@dpdk.org" , "stable@dpdk.org" Thread-Topic: [PATCH] net/mlx5: fix CVLAN tag set in IP item translation Thread-Index: AQHV+3EIetuHKm/7ME2g2IBpit7YtahMu/Fw Date: Tue, 17 Mar 2020 12:42:04 +0000 Message-ID: References: <259ecb84468740008ea1ecb5a407ad0bdb788d7d.1584348950.git.dekelp@mellanox.com> In-Reply-To: <259ecb84468740008ea1ecb5a407ad0bdb788d7d.1584348950.git.dekelp@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: [84.242.49.134] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 89fc5987-fd81-4623-3844-08d7ca7098ac x-ms-traffictypediagnostic: AM0PR05MB5234:|AM0PR05MB5234: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-forefront-prvs: 0345CFD558 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(346002)(39860400002)(366004)(136003)(396003)(376002)(199004)(86362001)(4326008)(52536014)(6506007)(53546011)(7696005)(2906002)(26005)(186003)(76116006)(450100002)(64756008)(66556008)(66476007)(66446008)(8676002)(66946007)(33656002)(6636002)(478600001)(81156014)(81166006)(5660300002)(9686003)(55016002)(71200400001)(316002)(54906003)(110136005)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR05MB5234; H:AM0PR05MB6707.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; 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: e6IPmNlwKp4m/OUgc0niJaXB8v3QceDANMj2fQ/mwdiqnvQ5MJJB76iDMc68N4yQZ6LKwkv3dB5vYNa42Flx+MS1B1SpYss81jilIRd4Vq5gquHNfiH0KjtsC4KVxKlWSbNKuk7uURSBNAPCEeklOnZQ+/OHuyLzIBv0VMUc8/QYcZqEQ9GApvaN1NXT2f90v5EWffDV/UPXcGGx9KAJGPfOzf4aayRqigEUWUnTfX0pK8YLHzGmPUM4IZIR/CSapOtU9AMfK48mLCmiyQtuNDWTr6B1JX1iu+XUbMGfWOepLT2UDab7ba3CdwvyPiptYaWikt7FLQqQhPq/OkIyPhAiG7vV0fIm6R35pLW4wgdG37wLF4MngqTSq/sxdtUiEdwUoQhg6v/OnBzqSpE3aVz6kCUH5e+BHAdbu0881whsONQVrCvXKOE33FUKDZ4Q x-ms-exchange-antispam-messagedata: bj6n2mZLpyDKliA8NapJQGIduIneFMD9lTwHn/m5PwlbPnCPhKJwig5VjQC3/oVVk8yzjAlY5LdivcSF85lzZAplYSlHsOVI9CQYci1XpdTRMM0ogbawi9oClvuq9vKdt2PQGCww15cGsRs3zARcug== 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: 89fc5987-fd81-4623-3844-08d7ca7098ac X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Mar 2020 12:42:04.1511 (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: 1Ba5hTI91+PhlF2xQet4++pgPVAOuwINUA49Zh/J113aC4fZotHqPpAAe5Rbossb10i9uUIecd0/YCcXGysOYA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5234 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix CVLAN tag set in IP item translation 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: Dekel Peled > Sent: Monday, March 16, 2020 10:58 AM > To: Matan Azrad ; Slava Ovsiienko > ; Raslan Darawsheh > Cc: dev@dpdk.org; stable@dpdk.org > Subject: [PATCH] net/mlx5: fix CVLAN tag set in IP item translation >=20 > Previous fix added, at the end of functions flow_dv_translate_item_ipv4() > and flow_dv_translate_item_ipv6(), the setting of cvlan_tag mask. > In the case of unspecified item (item->spec =3D=3D null) these functions > return, and the new code section is not reached. >=20 > This patch moves the setting of cvlan_tag mask to be done before the > check of item->spec, to make sure it is always executed. >=20 > Fixes: 797329d6c4a1 ("net/mlx5: fix match on ethertype and CVLAN tag") > Cc: stable@dpdk.org >=20 > Signed-off-by: Dekel Peled > Acked-by: Matan Azrad > --- > drivers/net/mlx5/mlx5_flow_dv.c | 26 ++++++++++++++------------ > 1 file changed, 14 insertions(+), 12 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c > index e2d6690..2090631 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -5464,6 +5464,13 @@ struct field_modify_info modify_tcp[] =3D { > else > MLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_version, > 0x4); > MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_version, 4); > + /* > + * On outer header (which must contains L2), or inner header with L2, > + * set cvlan_tag mask bit to mark this packet as untagged. > + * This should be done even if item->spec is empty. > + */ > + if (!inner || item_flags & MLX5_FLOW_LAYER_INNER_L2) > + MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag, > 1); > if (!ipv4_v) > return; > if (!ipv4_m) > @@ -5495,12 +5502,6 @@ struct field_modify_info modify_tcp[] =3D { > ipv4_m->hdr.time_to_live); > MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_ttl_hoplimit, > ipv4_v->hdr.time_to_live & ipv4_m->hdr.time_to_live); > - /* > - * On outer header (which must contains L2), or inner header with L2, > - * set cvlan_tag mask bit to mark this packet as untagged. > - */ > - if (!inner || item_flags & MLX5_FLOW_LAYER_INNER_L2) > - MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag, > 1); > } >=20 > /** > @@ -5565,6 +5566,13 @@ struct field_modify_info modify_tcp[] =3D { > else > MLX5_SET(fte_match_set_lyr_2_4, headers_m, ip_version, > 0x6); > MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_version, 6); > + /* > + * On outer header (which must contains L2), or inner header with L2, > + * set cvlan_tag mask bit to mark this packet as untagged. > + * This should be done even if item->spec is empty. > + */ > + if (!inner || item_flags & MLX5_FLOW_LAYER_INNER_L2) > + MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag, > 1); > if (!ipv6_v) > return; > if (!ipv6_m) > @@ -5613,12 +5621,6 @@ struct field_modify_info modify_tcp[] =3D { > ipv6_m->hdr.hop_limits); > MLX5_SET(fte_match_set_lyr_2_4, headers_v, ip_ttl_hoplimit, > ipv6_v->hdr.hop_limits & ipv6_m->hdr.hop_limits); > - /* > - * On outer header (which must contains L2), or inner header with L2, > - * set cvlan_tag mask bit to mark this packet as untagged. > - */ > - if (!inner || item_flags & MLX5_FLOW_LAYER_INNER_L2) > - MLX5_SET(fte_match_set_lyr_2_4, headers_m, cvlan_tag, > 1); > } >=20 > /** > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh