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 410FFA0C46; Tue, 31 Aug 2021 17:41:21 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BA21E40142; Tue, 31 Aug 2021 17:41:20 +0200 (CEST) Received: from mail-108-mta141.mxroute.com (mail-108-mta141.mxroute.com [136.175.108.141]) by mails.dpdk.org (Postfix) with ESMTP id B0EF340141 for ; Tue, 31 Aug 2021 17:41:18 +0200 (CEST) Received: from filter004.mxroute.com ([149.28.56.236] filter004.mxroute.com) (Authenticated sender: mN4UYu2MZsgR) by mail-108-mta141.mxroute.com (ZoneMTA) with ESMTPSA id 17b9cdf2cf200074ba.001 for (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES128-GCM-SHA256); Tue, 31 Aug 2021 15:41:16 +0000 X-Zone-Loop: 13fe08341a30ee3fc664643b2bf19f10d8b54e1a1fb0 X-Originating-IP: [149.28.56.236] DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=ashroe.eu; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=7e8rL4Fo863aPmJBoDuFoW7TgbDd/29DRClocdw6rk8=; b=oqQU9tojsBMtFvcmSGoun3d7fi xh/7nr5PB56A3ulgdlFrttpASKh5ulEVJk2GxdreK8FUgHgfyxR5GAfZwHdENRUoJjc5tz0we84mn 4qQHVfOgXhIJJPii+PJ+6LKapzqMP7enNI2Iy7WO3x2p59FEYPRi9y8uPkbPnuF+8x6dzZPhgp040 XiurFCdcUNakLvcePS4qWG7FZj1p5E0QNWto+3mn7ymNJIP10cNTQdoH1hJ9h+CwwRJ8D7tDcH1hU 1UzDIjEazdbS0CLryRyPAAU0PX35ZPvo5wRpYPsHNjEbVzryicB8nnWi8xz4nRWLvCorXMImBodzK x8iW3r1Q==; To: psatheesh@marvell.com, Nithin Dabilpuram , Kiran Kumar K , Sunil Kumar Kori , Satha Rao Cc: dev@dpdk.org References: <20210831041614.3453698-1-psatheesh@marvell.com> From: "Kinsella, Ray" Message-ID: Date: Tue, 31 Aug 2021 16:41:13 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20210831041614.3453698-1-psatheesh@marvell.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AuthUser: mdr@ashroe.eu Subject: Re: [dpdk-dev] [PATCH] common/cnxk: add ROC API to merge base steering rule 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 31/08/2021 05:16, psatheesh@marvell.com wrote: > From: Satheesh Paul > > This patch adds an ROC API to merge base steering rule with rules > added by VF. > > Signed-off-by: Satheesh Paul > Reviewed-by: Kiran Kumar Kokkilagadda > --- > drivers/common/cnxk/roc_npc.c | 27 +++++++++++++++++++++++++++ > drivers/common/cnxk/roc_npc.h | 5 ++--- > drivers/common/cnxk/version.map | 1 + > 3 files changed, 30 insertions(+), 3 deletions(-) > > diff --git a/drivers/common/cnxk/roc_npc.c b/drivers/common/cnxk/roc_npc.c > index aff4eef554..53074bed99 100644 > --- a/drivers/common/cnxk/roc_npc.c > +++ b/drivers/common/cnxk/roc_npc.c > @@ -1136,3 +1136,30 @@ roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc) > } > } > } > + > +int > +roc_npc_mcam_merge_base_steering_rule(struct roc_npc *roc_npc, > + struct roc_npc_flow *flow) > +{ > + struct npc_mcam_read_base_rule_rsp *base_rule_rsp; > + struct npc *npc = roc_npc_to_npc_priv(roc_npc); > + struct mcam_entry *base_entry; > + int idx, rc; > + > + if (roc_nix_is_pf(roc_npc->roc_nix)) > + return 0; > + > + (void)mbox_alloc_msg_npc_read_base_steer_rule(npc->mbox); > + rc = mbox_process_msg(npc->mbox, (void *)&base_rule_rsp); > + if (rc) { > + plt_err("Failed to fetch VF's base MCAM entry"); > + return rc; > + } > + base_entry = &base_rule_rsp->entry_data; > + for (idx = 0; idx < ROC_NPC_MAX_MCAM_WIDTH_DWORDS; idx++) { > + flow->mcam_data[idx] |= base_entry->kw[idx]; > + flow->mcam_mask[idx] |= base_entry->kw_mask[idx]; > + } > + > + return 0; > +} > diff --git a/drivers/common/cnxk/roc_npc.h b/drivers/common/cnxk/roc_npc.h > index bab25fd72e..1f9d29e2dd 100644 > --- a/drivers/common/cnxk/roc_npc.h > +++ b/drivers/common/cnxk/roc_npc.h > @@ -215,15 +215,12 @@ int __roc_api roc_npc_flow_parse(struct roc_npc *roc_npc, > const struct roc_npc_action actions[], > struct roc_npc_flow *flow); > int __roc_api roc_npc_get_low_priority_mcam(struct roc_npc *roc_npc); > - > int __roc_api roc_npc_mcam_free_counter(struct roc_npc *roc_npc, > uint16_t ctr_id); > - > int __roc_api roc_npc_mcam_read_counter(struct roc_npc *roc_npc, > uint32_t ctr_id, uint64_t *count); > int __roc_api roc_npc_mcam_clear_counter(struct roc_npc *roc_npc, > uint32_t ctr_id); > - > int __roc_api roc_npc_mcam_free_all_resources(struct roc_npc *roc_npc); > void __roc_api roc_npc_flow_dump(FILE *file, struct roc_npc *roc_npc); > void __roc_api roc_npc_flow_mcam_dump(FILE *file, struct roc_npc *roc_npc, > @@ -234,4 +231,6 @@ int __roc_api roc_npc_mark_actions_sub_return(struct roc_npc *roc_npc, > int __roc_api roc_npc_vtag_actions_get(struct roc_npc *roc_npc); > int __roc_api roc_npc_vtag_actions_sub_return(struct roc_npc *roc_npc, > uint32_t count); > +int __roc_api roc_npc_mcam_merge_base_steering_rule(struct roc_npc *roc_npc, > + struct roc_npc_flow *flow); Missing __rte_internal ? > #endif /* _ROC_NPC_H_ */ > diff --git a/drivers/common/cnxk/version.map b/drivers/common/cnxk/version.map > index 2cbcc4b93a..13231fcf04 100644 > --- a/drivers/common/cnxk/version.map > +++ b/drivers/common/cnxk/version.map > @@ -234,6 +234,7 @@ INTERNAL { > roc_npc_mcam_free_all_resources; > roc_npc_mcam_free_counter; > roc_npc_mcam_free_entry; > + roc_npc_mcam_merge_base_steering_rule; > roc_npc_mcam_write_entry; > roc_npc_mcam_read_counter; > roc_npc_profile_name_get; >