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 B06A3A0562; Sun, 29 Mar 2020 13:17:07 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 07E271AFF; Sun, 29 Mar 2020 13:17:07 +0200 (CEST) Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80045.outbound.protection.outlook.com [40.107.8.45]) by dpdk.org (Postfix) with ESMTP id 04C23F3E; Sun, 29 Mar 2020 13:17:05 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZUaZhywotB7yNoRay1ds/ccLDbPyb6zcjeAz0nXIIH/QF7q94DIghAa4Rx9k0w18+QVPbkMGs3xKkFNHJ6T0TH/i1pE2eI3sMg5pv9vtc6AYhI1iExE3CxvoZ4OR+9FAeCbUwd33UaWB+9LnAd4m3nmZaRhZbVn7pmA8EFd1y+te/QHJpAG0gpk2jad7vUyHiREX0MGHy6/ZHl7WA5MqXSecut3FRuxEMkgtoWZl3HBeTsZbqiiiPKgkKiWW9eJ8cDwIvn4kZRFhmmHleKkTJdZglomKkhasC0twGSdOdYparAzj+GERU5QxOPkC0f/IsoyDoLl3LVsoDKFFdWzh/g== 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=gOKSHQX3sh8clC1tHTQZidkWjJFHOpqHT+OUiL2qc5o=; b=gazOPF6wmgWWGwJSejI9t6aHktuWyfWhnqV0Yg8PnDdDMs2QWrYwJfI5re1BJ4T0VpDCiGMkAwMVIZPXyJ4g+d2KicWdOIlI/fh5IXGKsOWLwpfIDv3VY4RTZwz3Sh3dFypdvgzG329KdVMWfIaPqauEUJUrQdvrhpiB+3PoyLcvFXCzDx9Q9k0Ebv0+3FKugH8BScqnANAb94/wwCpLrm1phI+YuVDBGCN1FgUXgVnxlFUTregFZtrTHUe/DPRdXG4wZh75TlA4aTr+i7CoowyCKr/aOEguO/WxFpjJaUNqb3Te9dZpwc8HT9zEQaGe5Rk7EDwIngaaG2J3T9p7ag== 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=gOKSHQX3sh8clC1tHTQZidkWjJFHOpqHT+OUiL2qc5o=; b=hf89LGs91KatIkrh84HANXBPMeJebDDfYw56CmfEcmudxFzd2ZdWSnYaeqzmSVHpl664R6ywdyun6aJb/nx/7Yw+qmXOLZdGVzjEssWP+6pmlgDLQgXrZmDKdjno83qW18VvPFFq4/a56hYPdA2++VfGj9gx8pAsnqZlk+YjyXs= Received: from AM0PR05MB6707.eurprd05.prod.outlook.com (10.186.174.145) by AM0PR05MB5172.eurprd05.prod.outlook.com (20.178.19.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2856.18; Sun, 29 Mar 2020 11:17:05 +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.2856.019; Sun, 29 Mar 2020 11:17:05 +0000 From: Raslan Darawsheh To: Asaf Penso , "dev@dpdk.org" CC: Slava Ovsiienko , Matan Azrad , Dekel Peled , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix call to modify action without init item Thread-Index: AQHWAt8TU+J0/5tnoUWn5vbRCq82CqhfcURQ Date: Sun, 29 Mar 2020 11:17:04 +0000 Message-ID: References: <1585165998-14221-1-git-send-email-asafp@mellanox.com> In-Reply-To: <1585165998-14221-1-git-send-email-asafp@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: [188.161.229.130] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 797b471c-b758-4708-0069-08d7d3d2b63f x-ms-traffictypediagnostic: AM0PR05MB5172:|AM0PR05MB5172: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-forefront-prvs: 035748864E 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:(10009020)(4636009)(366004)(39860400002)(136003)(376002)(346002)(396003)(52536014)(76116006)(64756008)(8936002)(9686003)(7696005)(110136005)(450100002)(6506007)(2906002)(66476007)(4326008)(66556008)(66946007)(316002)(55016002)(53546011)(54906003)(33656002)(66446008)(71200400001)(86362001)(81166006)(5660300002)(26005)(81156014)(478600001)(186003); DIR:OUT; SFP:1101; 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: OHgQN1bF+oab0IQ5u+/3046cfu5OWH6t34mVEHXx3W7fbdLh1I5OlZlz8zBX1boFnKFu6oHiio7NymPmviGO7IpTwF+d0ZJZOCPoLKJ5Ffs1pq8kEs6yQ4RxZyLAKWarB8cUjUtZIGmRyROpJ21vzW+EXw/j5R4ua/YvH4X1gP7DmTacOGee3Oz8cg5KwGrC7xEGCtb95tLJmo2BU3G1PHdYNCVL6chWSc52q19MxSiEWL9E4Aau5XrwqxFn+oImO9ECCJWz3NIXa+5/iqbaFWSFS+Bd561AIXXLrEVWM4jMKlQWKBpmLGnYDdnzlUWNstQRFBlgx+icPssirzS1if6BJmiZrHQNCJywnn+mbiQ3m0OCNxAORWXI+/HqgrL1asDQIHy1qS/XoHVEVFav4A5Ybb9tyMUFh5hXLJf0R9KOF169TmX1xMGlQJWGp6qJ x-ms-exchange-antispam-messagedata: UyAIO2Vkr10QGVXLQXgc5l54IFnEiBvCyC+YcfN1qfilM408t8YU6YV8Hspnru+4IcbF8YGawwSB+8389m11Z/vZVHjhqXezKpZA3xZ1/v0YBu8OsI5SCkZ15soxGwXvv9QHxOd7BZTnAvtGdDrLpg== 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: 797b471c-b758-4708-0069-08d7d3d2b63f X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Mar 2020 11:17:04.8935 (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: WTchgVDk09Wbez9b3Elusuxrr44ebpeDd/plxeJUoSYDzzek4ukXDIfPUJdvJwd/Va4O+eYU6su5WUvOcz+XfA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB5172 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix call to modify action without init item 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: dev On Behalf Of Asaf Penso > Sent: Wednesday, March 25, 2020 9:53 PM > To: dev@dpdk.org > Cc: Slava Ovsiienko ; Matan Azrad > ; Dekel Peled ; > stable@dpdk.org > Subject: [dpdk-dev] [PATCH] net/mlx5: fix call to modify action without i= nit > item >=20 > The item is being set according to the attribute value, whether it is > udp/tcp or ipv4/6. > Also, there are two condition calls. >=20 > If the attribute is neither udp/tcp or ipv4/6 the item is not initialized > at all, but the call to the flow_dv_convert_modify_action is still being > done. > Also, even if the attribute is tcp/udp or ipv4/6, we still have two > conditions. >=20 > This patch changes the conditions, so the item will always be set. > By doing this, there is also a save in the number of condition calls. >=20 > Fixes: 4bb14c83 ("net/mlx5: support modify header using Direct Verbs") > Cc: stable@dpdk.org >=20 > Signed-off-by: Asaf Penso > Reviewed-by: Dekel Peled > --- > drivers/net/mlx5/mlx5_flow_dv.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow_dv.c > b/drivers/net/mlx5/mlx5_flow_dv.c > index 809833b..eabc745 100644 > --- a/drivers/net/mlx5/mlx5_flow_dv.c > +++ b/drivers/net/mlx5/mlx5_flow_dv.c > @@ -702,8 +702,8 @@ struct field_modify_info modify_tcp[] =3D { > item.spec =3D &udp; > item.mask =3D &udp_mask; > field =3D modify_udp; > - } > - if (attr->tcp) { > + } else { > + MLX5_ASSERT(attr->tcp); > memset(&tcp, 0, sizeof(tcp)); > memset(&tcp_mask, 0, sizeof(tcp_mask)); > if (action->type =3D=3D RTE_FLOW_ACTION_TYPE_SET_TP_SRC) { > @@ -773,8 +773,8 @@ struct field_modify_info modify_tcp[] =3D { > item.spec =3D &ipv4; > item.mask =3D &ipv4_mask; > field =3D modify_ipv4; > - } > - if (attr->ipv6) { > + } else { > + MLX5_ASSERT(attr->ipv6); > memset(&ipv6, 0, sizeof(ipv6)); > memset(&ipv6_mask, 0, sizeof(ipv6_mask)); > ipv6.hdr.hop_limits =3D conf->ttl_value; > @@ -834,8 +834,8 @@ struct field_modify_info modify_tcp[] =3D { > item.spec =3D &ipv4; > item.mask =3D &ipv4_mask; > field =3D modify_ipv4; > - } > - if (attr->ipv6) { > + } else { > + MLX5_ASSERT(attr->ipv6); > memset(&ipv6, 0, sizeof(ipv6)); > memset(&ipv6_mask, 0, sizeof(ipv6_mask)); > ipv6.hdr.hop_limits =3D 0xFF; > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh