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 CA03DA055F; Thu, 27 Feb 2020 12:13:32 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 199091F1C; Thu, 27 Feb 2020 12:13:32 +0100 (CET) Received: from mail-il1-f193.google.com (mail-il1-f193.google.com [209.85.166.193]) by dpdk.org (Postfix) with ESMTP id E57FF3B5; Thu, 27 Feb 2020 12:13:30 +0100 (CET) Received: by mail-il1-f193.google.com with SMTP id x2so2044808ila.9; Thu, 27 Feb 2020 03:13:30 -0800 (PST) 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=FeWXHdrikhXqdwA4SwW4nPkJV2RxKtpUudZOvMPolD8=; b=Cl/lPznzB+VoWHqLPbcA0uEP1y0NN6IR7Y4qXVPUEESDGjATC8YoXWho+ucjtdL6Xg hybvFAyRMShE8htuM8xgj7hkdrFzsAfoxpYBlXFSgroX/sS1vpXbLYEB3H7QSmszKA82 d1W0uJn4YjLzg08MogRXztI4brp1Lk4+qmJ7DW0pLn0LmYz1aUf/xK+b/yGiduJxG6c3 xRBZyFtIZ2cmw8EC8w+3vWDdhkewqiIxuq5Eu+kWg7Quy6NmSOS98q2RZd0XpEebkB8l GS6yT7YeJy7EGZ6Kp6i5QR1s743TOm2mfWDl/TmTxBQCNrDTF4//f9jx4fVchyrBE856 iriA== 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=FeWXHdrikhXqdwA4SwW4nPkJV2RxKtpUudZOvMPolD8=; b=SO0GKws1LY1eOkpqPRAIGa157rpXTIdYLhv/yheJOGn7IX1Ug3MKnAX1Q0ACguchqi 0YmTUnfjtY6JbUZOmm1l3oaR2i9mneV7GeLNTNbEuoo5MMZEzMJGr9Cx0fOSpOwDsT5O ny4E2ql6kD/EVMp5ueEaSbZ6j8lM+4bHKzURgg6pJEB7Hs7tXPFviTXC7PfJ7yNxxqOg 5evCu7rysCP1xugtxXLEfpqo6WL2Hxro5+KtkWnKW8t87yB7NnAHMC5OfVfJm8PtScWb 8VTvlx7rfJcLdkZSFZ9A4eUcAziDJeBo4udL3enRnYKsMt7Woz7Kwrck8n6HHwJwdotc yTiA== X-Gm-Message-State: APjAAAX3p16XKh36v3IQg2oD5D/KasXrYQczxr0xBWLgJYKh5NwnI8uw WadN6mcgPzGljuyYKfjRpb3KXmi3TxYf27QrqxQ= X-Google-Smtp-Source: APXvYqwNT3/OciIOPjP0B8QzlF2xeE+Zz0rDQTQT+4wn9kpaiG/Ut+zqz12kIjZusckiqq0lA+qGVbYRB2Y2zvyOzY4= X-Received: by 2002:a92:481d:: with SMTP id v29mr5061634ila.271.1582802009704; Thu, 27 Feb 2020 03:13:29 -0800 (PST) MIME-Version: 1.0 References: <20200206123058.9971-1-ashishg@marvell.com> In-Reply-To: <20200206123058.9971-1-ashishg@marvell.com> From: Jerin Jacob Date: Thu, 27 Feb 2020 16:43:13 +0530 Message-ID: To: Ashish Gupta , Ferruh Yigit Cc: dpdk-dev , Jerin Jacob , shallyv@marvell.com, dpdk stable Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [dpdk-dev PATCH v1 1/1] net/octeontx2: update link information for loopback port 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" On Thu, Feb 6, 2020 at 5:36 PM Ashish Gupta wrote: > > loopback devices are exposed as ethdev device in octeontx2. > dpdk link update APIs updating the link information for cgx > ports but skipping loopback ports. > > When stack uses loopback port for forwarding, packets are > dropped as link status is down. Link information need to be > updated for loopback ports to avoid it. > > Fixes: 38f566280a ("net/octeontx2: add link stats operations") > Cc: stable@dpdk.org > > Signed-off-by: Ashish Gupta Thanks for the patch. Acked-by: Jerin Jacob Applied to dpdk-next-net-mrvl/master after minor rewording of the commit message. Thanks > --- > drivers/net/octeontx2/otx2_link.c | 49 +++++++++++++++++++++++++++++---------- > 1 file changed, 37 insertions(+), 12 deletions(-) > > diff --git a/drivers/net/octeontx2/otx2_link.c b/drivers/net/octeontx2/otx2_link.c > index f5679b06e..4128f56d9 100644 > --- a/drivers/net/octeontx2/otx2_link.c > +++ b/drivers/net/octeontx2/otx2_link.c > @@ -82,32 +82,57 @@ otx2_eth_dev_link_status_update(struct otx2_dev *dev, > _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_INTR_LSC, NULL); > } > > +static int > +lbk_link_update(struct rte_eth_link *link) > +{ > + link->link_status = ETH_LINK_UP; > + link->link_speed = ETH_SPEED_NUM_100G; > + link->link_autoneg = ETH_LINK_FIXED; > + link->link_duplex = ETH_LINK_FULL_DUPLEX; > + return 0; > +} > + > +static int > +cgx_link_update(struct otx2_eth_dev *dev, struct rte_eth_link *link) > +{ > + struct otx2_mbox *mbox = dev->mbox; > + struct cgx_link_info_msg *rsp; > + int rc; > + otx2_mbox_alloc_msg_cgx_get_linkinfo(mbox); > + rc = otx2_mbox_process_msg(mbox, (void *)&rsp); > + if (rc) > + return rc; > + > + link->link_status = rsp->link_info.link_up; > + link->link_speed = rsp->link_info.speed; > + link->link_autoneg = ETH_LINK_AUTONEG; > + > + if (rsp->link_info.full_duplex) > + link->link_duplex = rsp->link_info.full_duplex; > + return 0; > +} > + > int > otx2_nix_link_update(struct rte_eth_dev *eth_dev, int wait_to_complete) > { > struct otx2_eth_dev *dev = otx2_eth_pmd_priv(eth_dev); > - struct otx2_mbox *mbox = dev->mbox; > - struct cgx_link_info_msg *rsp; > struct rte_eth_link link; > int rc; > > RTE_SET_USED(wait_to_complete); > + memset(&link, 0, sizeof(struct rte_eth_link)); > > - if (otx2_dev_is_lbk(dev) || otx2_dev_is_sdp(dev)) > + if (otx2_dev_is_sdp(dev)) > return 0; > > - otx2_mbox_alloc_msg_cgx_get_linkinfo(mbox); > - rc = otx2_mbox_process_msg(mbox, (void *)&rsp); > + if (otx2_dev_is_lbk(dev)) > + rc = lbk_link_update(&link); > + else > + rc = cgx_link_update(dev, &link); > + > if (rc) > return rc; > > - link.link_status = rsp->link_info.link_up; > - link.link_speed = rsp->link_info.speed; > - link.link_autoneg = ETH_LINK_AUTONEG; > - > - if (rsp->link_info.full_duplex) > - link.link_duplex = rsp->link_info.full_duplex; > - > return rte_eth_linkstatus_set(eth_dev, &link); > } > > -- > 2.14.3 >