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 0C511A0C47; Tue, 15 Jun 2021 14:32:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9089A4067A; Tue, 15 Jun 2021 14:31:59 +0200 (CEST) Received: from mail-il1-f172.google.com (mail-il1-f172.google.com [209.85.166.172]) by mails.dpdk.org (Postfix) with ESMTP id C542140140 for ; Tue, 15 Jun 2021 14:31:58 +0200 (CEST) Received: by mail-il1-f172.google.com with SMTP id z1so15171518ils.0 for ; Tue, 15 Jun 2021 05:31:58 -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=etSM8dloM0mrN4JOBqRDWaVkDuNuy9o4aniKOD3pfLA=; b=hfTtQ2M8o9NfapbvdazMxHJ7h+2zY4W47dRMIIWgA3puYGKUvN1fwi21ip+DeDhc7s rP8ow+3z4bxkeyD2YQSwuTmMi/QA2ZMWdFU5nEZdORlwefyTsGVVvZkiHQkxCjfR2umF keCWSdZiaBBs6Oz8yKU5SILpHlgpuKMOM8RR3uDvutrh/6c4r3/DvluVKSUX0+PjZ6AL 6pMOIJgFaYKb3uRCnYZtbDr2AQHIqN9FJzerkv3vuuUP5+55/1CE8vbeSXbExsli7pXV DS2XkeskToKArFEaaQhJk3LCE7/ad1aS4AcK9wByVJzimUY6Z2lW/3synJHpmcDEKdqM tzgQ== 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=etSM8dloM0mrN4JOBqRDWaVkDuNuy9o4aniKOD3pfLA=; b=lT5u1coInvSRuLktwwKJ5NytQPhobDhWjhnRBT+FqiqawWyIgXoq2xn4mJYrR/2s/F Fp1urO0Rt4TsIcDt4c5sfpnGDU7SCUY4+TTcRVQr0Lfue+PQ9yPoNHwJLnNSASom+Q0R xIan1hQ67E0EFn/aS3NMEnr3XCR74/FcWgDHmVlBWdoXFT73NNqXNu95tlLJ4ORjTCBh wGEXY3QCXYntvRQeRavirXnnCLeOCL/pXM/1k5ev69WPDBxHwo1ma+3aauaFvyA6jzj5 7fJlkkmE0GhxCaygB9UOR4ZAv8nZzNwfZXMSCfm22vNUTLH6Md5oAYlMQJp2NmqVtVLz PAWw== X-Gm-Message-State: AOAM53098ph0M+WLzzhksFhZirvwUS3GtoNNTxrNsjDy1yT3+V6+OGae FfJaDaIhnfYjfm3BEYJOKBbaxk6nuLmwJ4LoDP0= X-Google-Smtp-Source: ABdhPJxSbEw3r94RC8/MsCJSVeQ2cPi2AmE5JqCY5pGz3pnuWLYuFLXDWEcrNFJA2ns1pNcRC1lfLAN+0Rqx6iJhvng= X-Received: by 2002:a05:6e02:1a6a:: with SMTP id w10mr18087009ilv.130.1623760318099; Tue, 15 Jun 2021 05:31:58 -0700 (PDT) MIME-Version: 1.0 References: <20210306153404.10781-1-ndabilpuram@marvell.com> <20210607175943.31690-1-ndabilpuram@marvell.com> <20210607175943.31690-15-ndabilpuram@marvell.com> In-Reply-To: <20210607175943.31690-15-ndabilpuram@marvell.com> From: Jerin Jacob Date: Tue, 15 Jun 2021 18:01:42 +0530 Message-ID: To: Nithin Dabilpuram Cc: dpdk-dev , Jerin Jacob , Sunil Kumar Kori , Satha Koteswara Rao Kottidi , Pavan Nikhilesh , Kiran Kumar K , Satheesh Paul , Ashwin Sekhar Thalakalath Kottilveetil Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 14/62] net/cnxk: add link status update support 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 Mon, Jun 7, 2021 at 11:35 PM Nithin Dabilpuram wrote: > > Add link status update callback to get current > link status. > > Signed-off-by: Nithin Dabilpuram > --- > doc/guides/nics/cnxk.rst | 1 + > doc/guides/nics/features/cnxk.ini | 2 + > doc/guides/nics/features/cnxk_vec.ini | 2 + > doc/guides/nics/features/cnxk_vf.ini | 2 + > drivers/net/cnxk/cnxk_ethdev.c | 7 +++ > drivers/net/cnxk/cnxk_ethdev.h | 8 +++ > drivers/net/cnxk/cnxk_link.c | 102 ++++++++++++++++++++++++++++++++++ > drivers/net/cnxk/meson.build | 3 +- > 8 files changed, 126 insertions(+), 1 deletion(-) > create mode 100644 drivers/net/cnxk/cnxk_link.c > > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2021 Marvell. > + */ > + > +#include "cnxk_ethdev.h" > + > +static inline int > +nix_wait_for_link_cfg(struct cnxk_eth_dev *dev) > +{ > + uint16_t wait = 1000; > + > + do { > + rte_rmb(); Please use gcc atomics instead. With above change: Reviewed-by: Jerin Jacob > + if (!(dev->flags & CNXK_LINK_CFG_IN_PROGRESS_F)) > + break; > + wait--; > + rte_delay_ms(1); > + } while (wait); > + > + return wait ? 0 : -1; > +} >