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 744E3A0C4A; Tue, 13 Jul 2021 11:32:40 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6047D411BD; Tue, 13 Jul 2021 11:32:40 +0200 (CEST) Received: from mail-io1-f47.google.com (mail-io1-f47.google.com [209.85.166.47]) by mails.dpdk.org (Postfix) with ESMTP id 994F24069E for ; Tue, 13 Jul 2021 11:32:39 +0200 (CEST) Received: by mail-io1-f47.google.com with SMTP id b1so26355281ioz.8 for ; Tue, 13 Jul 2021 02:32:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ovtq8hYuxTlcLHWw47Yl8ymUSX7hMfbOmGn8kQW4Z/M=; b=TZQa/Dt4vF+MF7MMdmZ9CVkqLl2XwsuUbaG0GLS4QdunB/DyQiwDQ8zRVvYm8xolUP neKE/IOAllFAg9P3s2/0AS/i5cai5GIGYjC+Zg1bX602MH0/l6CAe2PiAoYLG2dA83ew 3H5SDuS94eLv9pKlG45JIKwjMMtPt8SqDqDC0xqEW7wfwEkFHYEGRDx0Y9+5Qea/eczh WrDQ+LOWZwxS8HIg/eMEWz39/V/2i1rY3+4S40dyFKecDJQJyrEUqqnR2K2hw54pLgRB YEY2FXqgt8GWRORRm8pzQfQ4tC741eRDhnv6BNMYtWis/v/L7fuTEinE+HLR0oDWrEzn utlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ovtq8hYuxTlcLHWw47Yl8ymUSX7hMfbOmGn8kQW4Z/M=; b=JvD11vVawamNsmybfbBHSMOIepcYBfb4EINK5q8abasbp4+2UAfdBzx1NEbvcuY0Tm aKpe5iNnvPRJhuETbfw7cjd2jrZXZOTE6aU9FhmFvKAi2JiB0h6gHvJsGhGS/3raJEHI H+l8JnU/amthJOHbggiWJ4UCFU7PcgBZJLlCh1iYyTTQvRnN8ukZDOpaptobP7fq7FEL fww5chjdXF5dGuv2aT6PLuaGe1JuCIZDUENcoEYRHubYuIEENL99sShev9j2SJ12oC1F OhMmkImmvFhV8fVT8JGFaUbWclxW7aR/zTqZnwNH5ukxOBBrHh2YZWpwZQtL204wbwAp CPVA== X-Gm-Message-State: AOAM531wLgygKXCiLShsSiE4aBkAM0ed245sXwHQiKOMf14+foZToGTR HOMSibNv2z5I71kAiBwWxv9R2vpMSu3h8jv5rA4= X-Google-Smtp-Source: ABdhPJwaLKsiudpzrVi+AoXKFU35EEX+2+B6CKwKuqeG/HCQ2BUo6viE2u6vtJeELXQP/wQ3Eeq5fyC7ZsTjC+c37ys= X-Received: by 2002:a5e:a816:: with SMTP id c22mr2578162ioa.94.1626168759048; Tue, 13 Jul 2021 02:32:39 -0700 (PDT) MIME-Version: 1.0 References: <1625676557-2269-1-git-send-email-skoteshwar@marvell.com> In-Reply-To: <1625676557-2269-1-git-send-email-skoteshwar@marvell.com> From: Jerin Jacob Date: Tue, 13 Jul 2021 15:02:12 +0530 Message-ID: To: Satha Koteswara Rao Kottidi Cc: Jerin Jacob , Nithin Dabilpuram , Kiran Kumar K , dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH 1/3] net/octeontx2: handle link status when device stopped 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 Sender: "dev" On Wed, Jul 7, 2021 at 10:20 PM wrote: > > From: Satha Rao > > Set link status to down and don't fetch link status from kernel > when device in stopped state. > > Signed-off-by: Satha Rao Series Acked-by: Jerin Jacob Series applied to dpdk-next-net-mrvl/for-dpdk-main. Thanks. > --- > drivers/net/octeontx2/otx2_ethdev.c | 5 +++++ > drivers/net/octeontx2/otx2_link.c | 2 +- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/octeontx2/otx2_ethdev.c b/drivers/net/octeontx2/otx2_ethdev.c > index 84225f4..ac53d8c 100644 > --- a/drivers/net/octeontx2/otx2_ethdev.c > +++ b/drivers/net/octeontx2/otx2_ethdev.c > @@ -2171,6 +2171,7 @@ > struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev); > struct rte_mbuf *rx_pkts[32]; > struct otx2_eth_rxq *rxq; > + struct rte_eth_link link; > int count, i, j, rc; > > nix_lf_switch_header_type_enable(dev, false); > @@ -2196,6 +2197,10 @@ > for (i = 0; i < eth_dev->data->nb_tx_queues; i++) > otx2_nix_tx_queue_stop(eth_dev, i); > > + /* Bring down link status internally */ > + memset(&link, 0, sizeof(link)); > + rte_eth_linkstatus_set(eth_dev, &link); > + > return 0; > } > > diff --git a/drivers/net/octeontx2/otx2_link.c b/drivers/net/octeontx2/otx2_link.c > index 5378e5c..81dd624 100644 > --- a/drivers/net/octeontx2/otx2_link.c > +++ b/drivers/net/octeontx2/otx2_link.c > @@ -148,7 +148,7 @@ > RTE_SET_USED(wait_to_complete); > memset(&link, 0, sizeof(struct rte_eth_link)); > > - if (otx2_dev_is_sdp(dev)) > + if (!eth_dev->data->dev_started || otx2_dev_is_sdp(dev)) > return 0; > > if (otx2_dev_is_lbk(dev)) > -- > 1.8.3.1 >