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 E901FA034E; Tue, 19 Nov 2019 16:59:38 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BA66F1C0B; Tue, 19 Nov 2019 16:59:38 +0100 (CET) Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-eopbgr130054.outbound.protection.outlook.com [40.107.13.54]) by dpdk.org (Postfix) with ESMTP id 498D9B62 for ; Tue, 19 Nov 2019 16:59:37 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nk8wv/zdPM33TcuZaF/ws/6vUrwYy03FbXBv8ZNhVWnYAwTy+/kOfybRyChyCpHkjCvLDNOoDDGJrCnPRgJWsqOgYXrJYVRanxcKanI6eIs6C979bHpyQDsi1w76CkUWjyor30ICio6qJtAFX58nf4eMGvyBv8HfZ8cllKj+XYh9SB+WXAkoZtmzz40ngAkfZDcyQE9RTUco9OfDQzsy3hm6qNt4xnZ0YHdzsOh5QJLUnPZvaZE/MokJJvs+jvjHz/46i7gAICrIPE3mqtJhS99TA8vgXKQMHDqpHWYGpW9Ruoxc7czjl/7zAbanDp5SBD2lbqbQ7PmS6I47wdtd9g== 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=BTFfMfkJOsqWvrk4DJeWo2pI+v0hWPDRMq5ovb9tpJg=; b=PAxIe6IV9/H97vgrzlydtUwUCs34ctz2+l0LcqPpWHyN9NLKIJ2fKaZeR1FHREBNW9SiqgwKldFpKll9jqJY1MLPIRSL1GMiaDg0JYUJZk1zUOUQPwssBOwddffHwnOs+l6Hgpd31INsHb4oCopeztQJbviy7eMVHKxyupdsx4SuX0ucsDWw9KjezenbBORDm2tliayoCtRBxt91t2xMpSmvqRj6RH23v8hAk49RW7Ekf6YdCXa9eJudR8KBeitalAfC2aH+bGA0SRftcgLFYeYscZWc8zVq1JUGgKO9iJdyVIm2nVheoVblYZa1Jw3OQvrkRTdI7s8zAxC2xV18Xg== 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=BTFfMfkJOsqWvrk4DJeWo2pI+v0hWPDRMq5ovb9tpJg=; b=DO/K5d+33WX6sRHvRG3ucBuKnMLwqnBk83oDJnCZBmVPj7WAbX3yEJFX7CNMbgKTLPaZ/4v3UmktNjZ1ZhJtK9nhm3jn7E3jpKezj8tMi4wtOJ/DjH83+WjOniaujUiXoO66AtciFk0dBJIx0u8ITx4wfS5UoFXo0vrQ9rYGA9U= Received: from DB3PR0502MB3964.eurprd05.prod.outlook.com (52.134.65.161) by DB3PR0502MB4010.eurprd05.prod.outlook.com (52.134.66.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2451.23; Tue, 19 Nov 2019 15:59:35 +0000 Received: from DB3PR0502MB3964.eurprd05.prod.outlook.com ([fe80::a850:bac9:c90f:f2f5]) by DB3PR0502MB3964.eurprd05.prod.outlook.com ([fe80::a850:bac9:c90f:f2f5%6]) with mapi id 15.20.2451.031; Tue, 19 Nov 2019 15:59:35 +0000 From: Raslan Darawsheh To: Ori Kam , Matan Azrad , Shahaf Shuler , Slava Ovsiienko CC: "dev@dpdk.org" , Ori Kam Thread-Topic: [dpdk-dev] [PATCH] net/mlx5: fix hairpin split detection Thread-Index: AQHVntZQ4d8nQA8IA0imAMcqvtTrGaeSpvRQ Date: Tue, 19 Nov 2019 15:59:35 +0000 Message-ID: References: <1574167114-112790-1-git-send-email-orika@mellanox.com> In-Reply-To: <1574167114-112790-1-git-send-email-orika@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: e492ca8b-d62f-4b45-84b3-08d76d097999 x-ms-traffictypediagnostic: DB3PR0502MB4010:|DB3PR0502MB4010: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1443; x-forefront-prvs: 022649CC2C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(376002)(346002)(39860400002)(136003)(396003)(13464003)(199004)(189003)(51234002)(6116002)(6636002)(3846002)(26005)(2906002)(186003)(6246003)(107886003)(5660300002)(6436002)(486006)(476003)(66946007)(66556008)(66446008)(64756008)(7736002)(305945005)(9686003)(66476007)(14454004)(71200400001)(55016002)(71190400001)(478600001)(52536014)(4326008)(11346002)(74316002)(446003)(25786009)(76176011)(7696005)(8676002)(86362001)(316002)(81166006)(33656002)(99286004)(81156014)(229853002)(110136005)(54906003)(76116006)(66066001)(256004)(53546011)(6506007)(102836004)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB4010; H:DB3PR0502MB3964.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX: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: v9aTwpaS1boGGEwNuGa1NdL74Ji126mbbf+ScCxdV+LqPDZrB0RLLWTEL9JEfz4r2IPf0mik+B2XJ6Dwoaqid50o4JzrWgfJI1gHweTfohhYfLz4JJllFyNv/gkxdT9VTE1UeqQ5tyAGXu3Y0pzTL9Xpto+Ot/MfSCknn+fxSq0f2Y/nBjnW8qCSjDAAFWf12xaOt4SlRFkSyxi69FU1PEOBzHQdw/4jAwzoDfIcgHXur5cA2VCSNv16zF+nQZthkuYK5T3sjQpfx+rwAW8A1qdJoXrJHUcVYyC9sCTcBIlrf3ivS9WP4caTB7/01fopeKi/8C+h4BQTqp0wdCtEBp/xhzCp3vO+qj6+IUi5Kew6nmnZ81m6ZRlCMlMUwob0gIAfUYJQa/nRA6glwmnpaaN5LZ8V4v5huLBjEKikhpba+JwZfqjRViwa/Xz3GmRgUTFiLR0TcbTGguDBNQVYLQ== 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: e492ca8b-d62f-4b45-84b3-08d76d097999 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Nov 2019 15:59:35.6542 (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: NFQgmJx/8nXCM11xYgE6N+XRjry1K7Ep2H5ObXRuC8nEA0/alWixMA5caHyUrcQCPOzhjcZCjgdAaBNV5U/Vhg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB4010 Subject: Re: [dpdk-dev] [PATCH] net/mlx5: fix hairpin split detection 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 Ori Kam > Sent: Tuesday, November 19, 2019 2:39 PM > To: Matan Azrad ; Shahaf Shuler > ; Slava Ovsiienko > Cc: dev@dpdk.org; Ori Kam > Subject: [dpdk-dev] [PATCH] net/mlx5: fix hairpin split detection >=20 > When creating a flow, the flow is checked if it should be split into > 2 flows based on the queue/rss acton. >=20 > If the RSS action with given without any queues, it will result in crash > due to the fact that the function checks the queue type. >=20 > This commit fixes this issue by checking if the rss action is not empty, > and at least one queue. >=20 > Fixes: d85c7b5ea59f ("net/mlx5: split hairpin flows") >=20 > Signed-off-by: Ori Kam > Acked-by: Viacheslav Ovsiienko > --- > drivers/net/mlx5/mlx5_flow.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c > index d677de8..b488b67 100644 > --- a/drivers/net/mlx5/mlx5_flow.c > +++ b/drivers/net/mlx5/mlx5_flow.c > @@ -2814,6 +2814,8 @@ uint32_t mlx5_flow_adjust_priority(struct > rte_eth_dev *dev, int32_t priority, > switch (actions->type) { > case RTE_FLOW_ACTION_TYPE_QUEUE: > queue =3D actions->conf; > + if (queue =3D=3D NULL) > + return 0; > if (mlx5_rxq_get_type(dev, queue->index) !=3D > MLX5_RXQ_TYPE_HAIRPIN) > return 0; > @@ -2822,6 +2824,8 @@ uint32_t mlx5_flow_adjust_priority(struct > rte_eth_dev *dev, int32_t priority, > break; > case RTE_FLOW_ACTION_TYPE_RSS: > rss =3D actions->conf; > + if (rss =3D=3D NULL || rss->queue_num =3D=3D 0) > + return 0; > if (mlx5_rxq_get_type(dev, rss->queue[0]) !=3D > MLX5_RXQ_TYPE_HAIRPIN) > return 0; > -- > 1.8.3.1 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh