From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A38B8A00C2; Mon, 2 May 2022 19:44:36 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 94E3240F35; Mon, 2 May 2022 19:44:36 +0200 (CEST) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mails.dpdk.org (Postfix) with ESMTP id 8268740E28 for ; Mon, 2 May 2022 19:44:35 +0200 (CEST) Received: by mail-pf1-f169.google.com with SMTP id bo5so12848042pfb.4 for ; Mon, 02 May 2022 10:44:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=T8lGvaJ1J93Plic22Wz7IHWUPDVqSJ/WUSCgWyvtMas=; b=VBG5m9R3t/BuuMpps3J4/ZKbfDZ9BubALpUk0sriP2SraJQEVN8LVuzZSvM6AbpPwv Nj4ZMGaxAKm3THGS1AAq3XCr9M4498Q2fDKCgnKOC7Fkg1v85GWQYPrTq011Xk1sy5i8 Zv4M7NDVJvboM8FvL3FWYEfDlA4K7VsJFV8w4nTDw3putH2nZlR7BvgP5iYSYqesEZ0+ kksBaZmGCeJXySOrOyIYLshS1s06ZC/3mFzSqF/VoSaR5lXWZIhB8jPcaUqCw7mvqwi/ vbqJGCZeUewkFZkFrE4QXC4gw8ouZk9i8o7T7Qi/nq7cIy8QUa8KxuB29b07Z+FB3fHL zLhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=T8lGvaJ1J93Plic22Wz7IHWUPDVqSJ/WUSCgWyvtMas=; b=HsPogJiFqY9mewsbrfxZ4SE1WzyCdqUtvtLQg6l4oVmjoo5NDjxnR2am1eJeDv2mZX qsyEWwLiuEbDZ308WYrBYOb+14mG+Ap+JTaQfZi48Bi6zagvw+YENf+px8EiH7pkQY04 2Vr2Qbl4Ps+QQkrE7jBf9ZgOPzwPOyLhrShQ00nsUYVGKZ6GBf2ODgLSmwXFFVr4XB1L B+BWOBrhC951Cbsg7/LzdCn4jAfcFvLnrciD/GVk4Hy++h9IGUElFMBr/9QbAx1fGcNr A7ZP/c3pHtVBi5u6IPZEM30C9n1m7zYUB72sSF9KdBcPca16qx+QmYe6A4Fwi9P4qgZ5 m+Hw== X-Gm-Message-State: AOAM531Nmbqdgfl8O+BPlBCuZMX+aey9F6TJ8es89ASW2bGeAPe82Qhi QecaruusWIvYmMS5tmzB8aA+vNujPpFrROk5X0lnqXmoivA= X-Google-Smtp-Source: ABdhPJz+mTNeNpqAdfV8KT+bdoqxipbXY96tacqCFaHMXdbCFfN7YLdd4wH7x/+/hNlMOxUnkQbvIFrb8f50FYcL8XY= X-Received: by 2002:a65:63d9:0:b0:374:6b38:c6b3 with SMTP id n25-20020a6563d9000000b003746b38c6b3mr10639220pgv.195.1651513474504; Mon, 02 May 2022 10:44:34 -0700 (PDT) MIME-Version: 1.0 References: <20220329102857.2872895-1-skori@marvell.com> In-Reply-To: <20220329102857.2872895-1-skori@marvell.com> From: Jerin Jacob Date: Mon, 2 May 2022 23:14:08 +0530 Message-ID: Subject: Re: [PATCH] net/cnxk: fix crash during hotplug detach operation To: Sunil Kumar Kori , Ferruh Yigit , Andrew Rybchenko Cc: Nithin Dabilpuram , Kiran Kumar K , Satha Rao , dpdk-dev Content-Type: text/plain; charset="UTF-8" X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Tue, Mar 29, 2022 at 3:59 PM wrote: > > From: Sunil Kumar Kori > > hot_plug application does not perform any port setup > configuration via rte_eth_dev_configure() API. All the probed > Ethernet ports do not contain any Rx and Tx queues. > > While detaching a device via rte_eal_hotplug_remove(), CNXK > driver expects Rx and Tx queues structures populated during > reset of PFC. So application gets crashed as data->rx_queues > and data->tx_queues are NULL. > > Fixes: 9544713564f5 ("net/cnxk: support priority flow control") Cc: stable@dpdk.org > Signed-off-by: Sunil Kumar Kori Acked-by: Jerin Jacob Applied to dpdk-next-net-mrvl/for-next-net. Thanks > --- > drivers/net/cnxk/cnxk_ethdev_ops.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/drivers/net/cnxk/cnxk_ethdev_ops.c b/drivers/net/cnxk/cnxk_ethdev_ops.c > index f4a0562475..15d8e8efa6 100644 > --- a/drivers/net/cnxk/cnxk_ethdev_ops.c > +++ b/drivers/net/cnxk/cnxk_ethdev_ops.c > @@ -1069,6 +1069,11 @@ nix_priority_flow_ctrl_configure(struct rte_eth_dev *eth_dev, > rx_pause = (mode == RTE_ETH_FC_FULL) || (mode == RTE_ETH_FC_RX_PAUSE); > tx_pause = (mode == RTE_ETH_FC_FULL) || (mode == RTE_ETH_FC_TX_PAUSE); > > + if (data->rx_queues == NULL || data->tx_queues == NULL) { > + rc = 0; > + goto exit; > + } > + > /* Configure CQs */ > memset(&fc_cfg, 0, sizeof(struct roc_nix_fc_cfg)); > rxq = ((struct cnxk_eth_rxq_sp *)data->rx_queues[conf->rx_qid]) - 1; > -- > 2.25.1 >