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 284DBA0C4C; Tue, 21 Sep 2021 08:38:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 02F7B40DF7; Tue, 21 Sep 2021 08:38:15 +0200 (CEST) Received: from mail-io1-f53.google.com (mail-io1-f53.google.com [209.85.166.53]) by mails.dpdk.org (Postfix) with ESMTP id 8340C40683 for ; Tue, 21 Sep 2021 08:38:13 +0200 (CEST) Received: by mail-io1-f53.google.com with SMTP id q3so25344248iot.3 for ; Mon, 20 Sep 2021 23:38:13 -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=S8p/rH/rvaEcgjEJhoHXwxH8RyBLQf6ut2SWajmbo8Y=; b=Hm2zEmkUv6x8nufI1fKpwaCOYJti8GbXEXhbznOh96Bo8kx7TcqThrgSCh1FWxVedo alONMxJB3WpmLWedSksK1kH4SgN15nf1ZyJ02VAiEiaqOSZUllOzisyuOgssCMgigAqM 0MB08uBr2yU8GFD2kLCOy05Q4/1pjByxEMFdQHVUjzFhsMjMUS9pNgcLzWMf05JQTLjT P/vymb3lXflPf+4jnxB6YiWjQ51fMgmzgmqFhcjUyg9k2FT9v3JWaCMqdKlYL1mO8asy U2qWN12ZE9q8gswX8aq8aidsQoK1dSY+v5mCxcpd5BVW5LrR9mMt2AMvSYwZEQoyNS3t qlbA== 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=S8p/rH/rvaEcgjEJhoHXwxH8RyBLQf6ut2SWajmbo8Y=; b=cP2Ao4HU9RIXp0+6IMY6retqcJW2ZEwK8/Grcgyz4/rM1Xm8krxk/UOMvdBCpqFqnh H5EygUvGptM7a4AM2izpBLMu2sAaSEVDyPgTFImkSh/yBN6baukVCutm1YY9whIEI8DQ dymzgPGnCzZWi71pyNfXCHtNAw16xgtTNVXrck3dLXQP9ygYDzuiGhrm5KQZ49pHLD5V VmErUhb7l2z2DeixaOnsyXf77HoKveH3LEX/ITuYyIRZcrPzl2DT2srHHsAcQPjBsx3X D7ahP/zoOvh4joMCl1ttLwZY9BgiTOAaU5FPaE/kaaaNgArMo0UdJFFUmxoGUVdC2X+4 9++g== X-Gm-Message-State: AOAM531orBSasnh88Zu5PS4J3YIi1/ThxkhU5B2oYMPIQoHL5GbE19bh Fh2ljflzEXekMzCwCPAVp22ZgQEfeFRpnSEvhtv2Q1fcCJbFcQ== X-Google-Smtp-Source: ABdhPJx2vbMRh12mE2xVKSZom2JE0lYDcQMRXII7MX+hgT2lNoVvGeBkv/x+hs2rrHzCI5GO8ecOzQSCsoBAt9lMYDE= X-Received: by 2002:a05:6638:94c:: with SMTP id f12mr14117625jad.126.1632206292714; Mon, 20 Sep 2021 23:38:12 -0700 (PDT) MIME-Version: 1.0 References: <1630516236-10526-1-git-send-email-skoteshwar@marvell.com> <1631975519-30924-1-git-send-email-skoteshwar@marvell.com> <1631975519-30924-3-git-send-email-skoteshwar@marvell.com> In-Reply-To: <1631975519-30924-3-git-send-email-skoteshwar@marvell.com> From: Jerin Jacob Date: Tue, 21 Sep 2021 12:07:46 +0530 Message-ID: To: Satha Koteswara Rao Kottidi Cc: Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Ray Kinsella , dpdk-dev Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v2 2/8] common/cnxk: flush smq 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 Sat, Sep 18, 2021 at 8:02 PM wrote: > > From: Satha Rao > > Added new API to flush all SMQs related nix interface nix-> NIX Add more details in the commit log for meaning flush. Change the subject to : common/cnxk: support SMQ flush > > Signed-off-by: Satha Rao > --- > drivers/common/cnxk/hw/nix.h | 6 +++++ > drivers/common/cnxk/roc_nix.h | 1 + > drivers/common/cnxk/roc_nix_tm_ops.c | 50 ++++++++++++++++++++++++++++++++++++ > drivers/common/cnxk/version.map | 1 + > 4 files changed, 58 insertions(+) > > diff --git a/drivers/common/cnxk/hw/nix.h b/drivers/common/cnxk/hw/nix.h > index a0ffd25..bc908c2 100644 > --- a/drivers/common/cnxk/hw/nix.h > +++ b/drivers/common/cnxk/hw/nix.h > @@ -2189,4 +2189,10 @@ struct nix_lso_format { > #define NIX_LSO_FORMAT_IDX_TSOV4 0 > #define NIX_LSO_FORMAT_IDX_TSOV6 1 > > +/* [CN10K, .) */ > +#define NIX_SENDSTATALG_MASK 0x7 > +#define NIX_SENDSTATALG_SEL_MASK 0x8 > +#define NIX_SENDSTAT_IOFFSET_MASK 0xFFF > +#define NIX_SENDSTAT_OOFFSET_MASK 0xFFF > + > #endif /* __NIX_HW_H__ */ > diff --git a/drivers/common/cnxk/roc_nix.h b/drivers/common/cnxk/roc_nix.h > index b0e6fab..ac7bd7e 100644 > --- a/drivers/common/cnxk/roc_nix.h > +++ b/drivers/common/cnxk/roc_nix.h > @@ -468,6 +468,7 @@ int __roc_api roc_nix_tm_rsrc_count(struct roc_nix *roc_nix, > int __roc_api roc_nix_tm_node_name_get(struct roc_nix *roc_nix, > uint32_t node_id, char *buf, > size_t buflen); > +int __roc_api roc_nix_smq_flush(struct roc_nix *roc_nix); > > /* MAC */ > int __roc_api roc_nix_mac_rxtx_start_stop(struct roc_nix *roc_nix, bool start); > diff --git a/drivers/common/cnxk/roc_nix_tm_ops.c b/drivers/common/cnxk/roc_nix_tm_ops.c > index ed244d4..d9741f5 100644 > --- a/drivers/common/cnxk/roc_nix_tm_ops.c > +++ b/drivers/common/cnxk/roc_nix_tm_ops.c > @@ -311,6 +311,56 @@ > } > > int > +roc_nix_smq_flush(struct roc_nix *roc_nix) > +{ > + struct nix *nix = roc_nix_to_nix_priv(roc_nix); > + struct nix_tm_node_list *list; > + enum roc_nix_tm_tree tree; > + struct nix_tm_node *node; > + int rc = 0; > + > + if (!(nix->tm_flags & NIX_TM_HIERARCHY_ENA)) > + return 0; > + > + tree = nix->tm_tree; > + list = nix_tm_node_list(nix, tree); > + > + /* XOFF & Flush all SMQ's. HRM mandates > + * all SQ's empty before SMQ flush is issued. > + */ > + TAILQ_FOREACH(node, list, node) { > + if (node->hw_lvl != NIX_TXSCH_LVL_SMQ) > + continue; > + if (!(node->flags & NIX_TM_NODE_HWRES)) > + continue; > + > + rc = nix_tm_smq_xoff(nix, node, true); > + if (rc) { > + plt_err("Failed to enable smq %u, rc=%d", node->hw_id, > + rc); > + goto exit; > + } > + } > + > + /* XON all SMQ's */ > + TAILQ_FOREACH(node, list, node) { > + if (node->hw_lvl != NIX_TXSCH_LVL_SMQ) > + continue; > + if (!(node->flags & NIX_TM_NODE_HWRES)) > + continue; > + > + rc = nix_tm_smq_xoff(nix, node, false); > + if (rc) { > + plt_err("Failed to enable smq %u, rc=%d", node->hw_id, > + rc); > + goto exit; > + } > + } > +exit: > + return rc; > +} > + > +int > roc_nix_tm_hierarchy_disable(struct roc_nix *roc_nix) > { > struct nix *nix = roc_nix_to_nix_priv(roc_nix); > diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map > index 5df2e56..388f938 100644 > --- a/drivers/common/cnxk/version.map > +++ b/drivers/common/cnxk/version.map > @@ -170,6 +170,7 @@ INTERNAL { > roc_nix_xstats_names_get; > roc_nix_switch_hdr_set; > roc_nix_eeprom_info_get; > + roc_nix_smq_flush; > roc_nix_tm_dump; > roc_nix_tm_fini; > roc_nix_tm_free_resources; > -- > 1.8.3.1 >