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 D1D08A04B3; Sun, 15 Dec 2019 09:54:51 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 192C91BFAD; Sun, 15 Dec 2019 09:54:51 +0100 (CET) Received: from EUR03-DB5-obe.outbound.protection.outlook.com (mail-eopbgr40052.outbound.protection.outlook.com [40.107.4.52]) by dpdk.org (Postfix) with ESMTP id F0F751BFA8 for ; Sun, 15 Dec 2019 09:54:49 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l7/Jd8hHUT5/gx+OjoTVHnTMWuCHXftqitBckHCkqUfPN1SuGfb5t7FZdxCdjrtE6mH0kCcbu1FWvNMPHgtWdBCyGKvEzoRY8tYzVY/xtCLeds3nCjaj5X7doTCx8F8cRSDu13iWrwFJI7WiImf4WBkFfe1ftTSzoy7GTuVHYhz+YOHXgHaZkQghkxNo7UHSI6BhGYC1KLzRWhvNu0tmUX6ZkUsjfrnBLByPB1qBAYfSDoyxyL6iI40Vd2EoFdnF6lC5S//WvhojkaRVSZwzCBcjhhtnCr4OT4Cj53rrkECvX0atWlyg6DEcRr+mpQuYi1HbJy1aWGFh4qxXlC9oaA== 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=460lCt4DlyICBRqkjS9f1v2UQVKDcI/wKY94UnU33SY=; b=j+Hxh7IgDRSenCrze/0dM3FwxWSUnBBxFG3viDY4EyZ3BUR2Hzuuyj8fItSznGngurRD3INE63m2eubcYVf4jnPFDYYxIFa3lvuAjOkWPbrV6CzOimUKf+GI2U/T37bcrlkQwiwXYmSDk7+HFbwERD/oLuOAuZhpt4mq2CNoBcq0uUepk+j9ziXQ2BtrkIo3otduebnjWuA3By8gPJcSrNsKwDDUWYSBrWWTf3uAdFSajcxok4qAlwRFwUAeVVZyOI8zhuUfQ4jlWNkGD8LVDA8nLdUQPhUhaIpQ7jFXRclD/Jc1dJToJ+SJK3MQxXE4WnfF0955x/Atsjv000COQg== 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=460lCt4DlyICBRqkjS9f1v2UQVKDcI/wKY94UnU33SY=; b=E402+EN7lHMkNA8fzbesZvcrB/oBOWx6Ly4TO71nD1ad8wKw5lgiuntafs32CF1/ijjRBbFXmRK8gxhv9Ny44/OlFFBKak+T2ZpRGpRAIXC2smkmYDuu92/HgU1K3AlL460CURWtA9WnVobYvj0e3uTJk4byPspOza6/g1bI6e8= Received: from DB3PR0502MB3964.eurprd05.prod.outlook.com (52.134.65.161) by DB3PR0502MB3961.eurprd05.prod.outlook.com (52.134.70.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2538.17; Sun, 15 Dec 2019 08:54:49 +0000 Received: from DB3PR0502MB3964.eurprd05.prod.outlook.com ([fe80::2151:27c7:b8ec:3da9]) by DB3PR0502MB3964.eurprd05.prod.outlook.com ([fe80::2151:27c7:b8ec:3da9%6]) with mapi id 15.20.2538.019; Sun, 15 Dec 2019 08:54:48 +0000 From: Raslan Darawsheh To: "xiangxia.m.yue@gmail.com" , "dev@dpdk.org" CC: Ori Kam Thread-Topic: [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues Thread-Index: AQHVpS2fA2l+Inzr40Ow9Wuj4qx21qe7ACYg Date: Sun, 15 Dec 2019 08:54:48 +0000 Message-ID: References: <1574864323-85580-1-git-send-email-xiangxia.m.yue@gmail.com> In-Reply-To: <1574864323-85580-1-git-send-email-xiangxia.m.yue@gmail.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: cbe20762-4399-42d8-4d71-08d7813c70fb x-ms-traffictypediagnostic: DB3PR0502MB3961:|DB3PR0502MB3961: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5236; x-forefront-prvs: 02524402D6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(346002)(396003)(136003)(366004)(39860400002)(199004)(189003)(13464003)(186003)(107886003)(81156014)(53546011)(6506007)(86362001)(52536014)(5660300002)(478600001)(4326008)(2906002)(26005)(8936002)(55016002)(316002)(76116006)(110136005)(66946007)(9686003)(64756008)(66446008)(66556008)(66476007)(33656002)(7696005)(71200400001)(81166006); DIR:OUT; SFP:1101; SCL:1; SRVR:DB3PR0502MB3961; 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: V1BTx/MfHMsDKrIA/k7uae68zZ8YZa4HRUyf1vFHezZgSoE4QUE90tc5D6jMFsVvL14cY+HyRSynPQOnRWbKBnJTLIxMuMbKD0YeXRYyEUpHnzC7s8BAd84/Oh5OSe57853Elm1ddXJIsGI9xRmLNtBzy2JG6Wh6XiIKuTbEOV53jDyF4T5w1+I9I/7vQstbGaA04Q5gzMQk2D1D4CSNkcV0NlgUFYRhycCUx9v/89NlZwU4/x7evq/+XXRRt7RFy+EBv7Y9FfVdZqYyWkcPLmxPlHTAyf8yrCgxzHqbobvJIdYlj2bGjVqhuBKWEhQjtFIEHEvDwImn3S9pNlRFc+hQxS1cDtDAOJ94FPD8M8ZSSRQlgOAtw+gSuN6TVRwqSNh9nEFD2drzHTqsdz8sJ8gjn5Ds/2KCJquhvmxZhxMTtORMyhJswYCkapuXyRe9GJInKJrL+JOV0ZxvLtH2gZNYotBY7p+tFEWuFvlrAJA2KXR8/ajWLpIYGqRASpfN 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: cbe20762-4399-42d8-4d71-08d7813c70fb X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Dec 2019 08:54:48.8083 (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: Sk00VPlNbyY3qX3GDyCJdjf2Yl8qzujnSmVUixr5ZVSgaFuzRnUmnIAL8DrjPCtWhS9gzRWphrxZWfWHiDxTXg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR0502MB3961 Subject: Re: [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues 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 > xiangxia.m.yue@gmail.com > Sent: Wednesday, November 27, 2019 4:19 PM > To: dev@dpdk.org > Cc: Tonghao Zhang ; Ori Kam > > Subject: [dpdk-dev] [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when > setting hairpin queues >=20 > From: Tonghao Zhang >=20 > If configuring the number of tx/rx queue with rte_eth_dev_configure > to nr_queues + hairpin_nr_queues, and setting tx/rx queues to > nr_queues with rte_eth_tx/rx_queue_setup. But not configuring the > hairpin queues via rte_eth_tx/rx_hairpin_queue_setup. >=20 > When starting the netdev, there is a crash because of NULL accessing. >=20 > Fixes: cf5516696d77 ("ethdev: add hairpin queue") > Cc: Ori Kam > Signed-off-by: Tonghao Zhang > --- > drivers/net/mlx5/mlx5_ethdev.c | 2 +- > drivers/net/mlx5/mlx5_trigger.c | 5 ++++- > 2 files changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_ethdev.c > b/drivers/net/mlx5/mlx5_ethdev.c > index 1d6c084119ec..0076d05b00cc 100644 > --- a/drivers/net/mlx5/mlx5_ethdev.c > +++ b/drivers/net/mlx5/mlx5_ethdev.c > @@ -476,7 +476,7 @@ mlx5_dev_configure_rss_reta(struct rte_eth_dev > *dev) >=20 > rxq_data =3D (*priv->rxqs)[i]; > rxq_ctrl =3D container_of(rxq_data, struct mlx5_rxq_ctrl, rxq); > - if (rxq_ctrl->type =3D=3D MLX5_RXQ_TYPE_STANDARD) > + if (rxq_ctrl && rxq_ctrl->type =3D=3D > MLX5_RXQ_TYPE_STANDARD) > rss_queue_arr[j++] =3D i; > } > rss_queue_n =3D j; > diff --git a/drivers/net/mlx5/mlx5_trigger.c > b/drivers/net/mlx5/mlx5_trigger.c > index cafab25c67e7..ab6937ab10d1 100644 > --- a/drivers/net/mlx5/mlx5_trigger.c > +++ b/drivers/net/mlx5/mlx5_trigger.c > @@ -106,9 +106,12 @@ mlx5_rxq_start(struct rte_eth_dev *dev) > unsigned int i; > int ret =3D 0; > enum mlx5_rxq_obj_type obj_type =3D MLX5_RXQ_OBJ_TYPE_IBV; > + struct mlx5_rxq_data *rxq =3D NULL; >=20 > for (i =3D 0; i < priv->rxqs_n; ++i) { > - if ((*priv->rxqs)[i]->lro) { > + rxq =3D (*priv->rxqs)[i]; > + > + if (rxq && rxq->lro) { > obj_type =3D MLX5_RXQ_OBJ_TYPE_DEVX_RQ; > break; > } > -- > 2.23.0 Patch applied to next-net-mlx, Kindest regards, Raslan Darawsheh