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 D89A4A04E0; Wed, 27 Nov 2019 15:50:57 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A63202BE9; Wed, 27 Nov 2019 15:50:57 +0100 (CET) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70054.outbound.protection.outlook.com [40.107.7.54]) by dpdk.org (Postfix) with ESMTP id B74292B9C for ; Wed, 27 Nov 2019 15:50:56 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zq3rSVZlErONopccxI1dON5pPvQRSYysSqNW4VB+TqpENxI8bCsgygNaOSH+nlRb6sTzksO2XggQjH9R6bqId1nOb1lOirJxGMzlK4eZOWr6nc3/LY5njizLKULXs3SGKcFxxj275Gvv3ZEmYog7/z2KTEE0AEBgbCWzK4cCpI2uIG/NX6V98C93flqmccFoYRmIvowcs+DNJGGHVSDcoHRNjtqsL5g90HEUgPc6nCOhAUkO9emKl7/h1FEyVI/8D81QF344XHvOR3S+Mi35oo4yeb8FD0Pzoe6QrOpmnUqw488zRTI833Amy8XwC2xi0pzl0ZPmUh/sHm4RhJOJ8Q== 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=BQ98J6i9jxaJeb2mqus5CaLNtFzu7zqlH3rK25VZQus=; b=JI4Hg6Ng9/7X8/JjjyXZqW+n06F5Bg5Fn6rdRuidRN+4MrK47MymFZmeI8AAiV9Uc9jRTr2VDPiLcel2wxKuGpa/cCobj0JxOmH/PddLYCab12AIrFKBtV9nR4XFKPbu43Fl35Wp5VJ1Yh2Q7M4uRXuHgO1O7R0TKLXeTqC+/LNOazEYp4biAFsq0N7a2AW42E4pCr/TL0OdwwyjMJcB/g1TbLk9d+cpYF0/caZKfPwPr7VrYgJ50bZkJh2wMHGDrZhw4U5IEIshOG0er1Su6QHslz9fWRy4H1/sAVm6lXVApdSrU/A9bcc2MNnUpSTzhGwsJeDTky1UC9gk50v5VQ== 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=BQ98J6i9jxaJeb2mqus5CaLNtFzu7zqlH3rK25VZQus=; b=nQSfOVrXJsslvX1jQQe+0kIRyIQEPru3V0Ja5bPYJbGEVU190FZEEwQCwdnN4FfTQWy1ynbSgswN5tMCWKLGzRJwpVSSiL9Jte0WaxQc/ySkeYVsgu6kfVfSvGXL6TOV8t0c3aD0oG21kV0X1DM3kbk7OD67EoSAU+a55tOpL6w= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.190.15) by AM4PR05MB3297.eurprd05.prod.outlook.com (10.170.125.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2495.18; Wed, 27 Nov 2019 14:50:56 +0000 Received: from AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::d877:95ed:5f94:a4a]) by AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::d877:95ed:5f94:a4a%3]) with mapi id 15.20.2474.023; Wed, 27 Nov 2019 14:50:56 +0000 From: Ori Kam To: "xiangxia.m.yue@gmail.com" , "dev@dpdk.org" Thread-Topic: [PATCH dpdk-dev 1/3] net/mlx5: avoid crash when setting hairpin queues Thread-Index: AQHVpS2aPRuteIP+UEKYq9CzMtLyf6efGURw Date: Wed, 27 Nov 2019 14:50:55 +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=orika@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 57641990-b227-43e6-f72a-08d77349354d x-ms-traffictypediagnostic: AM4PR05MB3297: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6790; x-forefront-prvs: 023495660C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(346002)(39860400002)(396003)(136003)(376002)(189003)(13464003)(199004)(71190400001)(11346002)(446003)(110136005)(71200400001)(316002)(6506007)(53546011)(2906002)(26005)(6116002)(3846002)(8676002)(66066001)(76176011)(7696005)(8936002)(14454004)(478600001)(66946007)(52536014)(229853002)(81166006)(33656002)(81156014)(25786009)(9686003)(6436002)(102836004)(74316002)(305945005)(5660300002)(256004)(99286004)(186003)(6246003)(66446008)(64756008)(66556008)(66476007)(86362001)(2501003)(76116006)(7736002)(55016002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3297; H:AM4PR05MB3425.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; 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: gVxvCka4o7Og1DsCWjWnIqsDFGyhe9pmaTme3YPigH0GdGdaSFC/+qDr6J0Smr+ZwMTAYRJvls8hT7RJEvNhRCBma8PBFO7QCXCDgLWiN0QLVZTA1Nrry5nvoFx0YkmR4E3lcQyJDDKLZr0ProlcIVWqKWpn9O4HB/n5Sqbi7KDcnv/z+2WmIRqXPIMkQhrStr3I+Sc9RfJaTlHTzHIvkha5KA2lvccJjO7PWcljZG67vnOFXHd68imqXL/5SBtolnfgMoK046jcVtL1ywee5KoT+WDsGcvLEG6xhgpj5ugnttpMZTJT8xIGFD8tqcM8PPtyxPS+wchGM3BE6LiF+Y66w0xWQsaILfiqnjJ9mfzmSXgEAgY9lx639jJgImbv+mj1OWPq+Q741I2sSuSY232+Q3qcecXbw3QpT+xZ27ZDzoOSsE7URqzB9YSZFlsV x-ms-exchange-transport-forked: True 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: 57641990-b227-43e6-f72a-08d77349354d X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Nov 2019 14:50:55.9383 (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: hrM0u91xFEIfAyP+1nVDiIc6Jk7TWzboXu6YCePYKOxUhA2rG/I3Vf3d4P03kQgYWPFx/5ZUs9DqKgppTg6ZXQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3297 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" > -----Original Message----- > From: xiangxia.m.yue@gmail.com > Sent: Wednesday, November 27, 2019 4:19 PM > To: dev@dpdk.org > Cc: Tonghao Zhang ; Ori Kam > > Subject: [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 Nice catch,=20 Acked-by: Ori Kam Thanks, Ori