From mboxrd@z Thu Jan 1 00:00:00 1970 From: Akhil Goyal Subject: Re: [PATCH v2 10/33] common/cpt: add PMD ops helper functions Date: Mon, 17 Sep 2018 18:17:16 +0530 Message-ID: <2c63fcce-8969-45b7-832b-85a00c6caf74@nxp.com> References: <1528476325-15585-1-git-send-email-anoob.joseph@caviumnetworks.com> <1536033560-21541-1-git-send-email-ajoseph@caviumnetworks.com> <1536033560-21541-11-git-send-email-ajoseph@caviumnetworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Murthy NSSR , Jerin Jacob , Narayana Prasad , dev@dpdk.org, Ankur Dwivedi , Anoob Joseph , Nithin Dabilpuram , Ragothaman Jayaraman , Srisivasubramanian S , Tejasree Kondoj To: Anoob Joseph , Pablo de Lara , Thomas Monjalon Return-path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30062.outbound.protection.outlook.com [40.107.3.62]) by dpdk.org (Postfix) with ESMTP id ED6825F29 for ; Mon, 17 Sep 2018 14:47:39 +0200 (CEST) In-Reply-To: <1536033560-21541-11-git-send-email-ajoseph@caviumnetworks.com> Content-Language: en-US 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 9/4/2018 9:28 AM, Anoob Joseph wrote: > From: Murthy NSSR > > Adding pmd ops helper functions. Control path accessed APIs would be > added as helper functions. Adding microcode defined macros etc as > dependencies to the helper functions. > > Signed-off-by: Ankur Dwivedi > Signed-off-by: Anoob Joseph > Signed-off-by: Murthy NSSR > Signed-off-by: Nithin Dabilpuram > Signed-off-by: Ragothaman Jayaraman > Signed-off-by: Srisivasubramanian S > Signed-off-by: Tejasree Kondoj > --- > drivers/common/Makefile | 4 +++ > drivers/common/cpt/Makefile | 25 ++++++++++++++++ > drivers/common/cpt/cpt_common.h | 41 +++++++++++++++++++++++++++ > drivers/common/cpt/cpt_mcode_defines.h | 38 +++++++++++++++++++++++++ > drivers/common/cpt/cpt_pmd_ops_helper.c | 41 +++++++++++++++++++++++++++ > drivers/common/cpt/cpt_pmd_ops_helper.h | 34 ++++++++++++++++++++++ > drivers/common/cpt/meson.build | 8 ++++++ > drivers/common/cpt/rte_common_cpt_version.map | 6 ++++ > drivers/common/meson.build | 2 +- > mk/rte.app.mk | 4 +++ > 10 files changed, 202 insertions(+), 1 deletion(-) > create mode 100644 drivers/common/cpt/Makefile > create mode 100644 drivers/common/cpt/cpt_mcode_defines.h > create mode 100644 drivers/common/cpt/cpt_pmd_ops_helper.c > create mode 100644 drivers/common/cpt/cpt_pmd_ops_helper.h > create mode 100644 drivers/common/cpt/meson.build > create mode 100644 drivers/common/cpt/rte_common_cpt_version.map > > diff --git a/drivers/common/Makefile b/drivers/common/Makefile > index 0fd2237..ca4e854 100644 > --- a/drivers/common/Makefile > +++ b/drivers/common/Makefile > @@ -8,4 +8,8 @@ ifeq ($(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF)$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOO > DIRS-y += octeontx > endif > > +ifeq ($(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_CRYPTO),y) > +DIRS-y += cpt > +endif > + > include $(RTE_SDK)/mk/rte.subdir.mk > diff --git a/drivers/common/cpt/Makefile b/drivers/common/cpt/Makefile > new file mode 100644 > index 0000000..2340aa9 > --- /dev/null > +++ b/drivers/common/cpt/Makefile > @@ -0,0 +1,25 @@ > +# SPDX-License-Identifier: BSD-3-Clause > +# Copyright(c) 2018 Cavium, Inc > +# > + > +include $(RTE_SDK)/mk/rte.vars.mk > + > +# > +# library name > +# > +LIB = librte_common_cpt.a > + > +CFLAGS += $(WERROR_FLAGS) > +CFLAGS += -I$(RTE_SDK)/drivers/bus/pci > +EXPORT_MAP := rte_common_cpt_version.map > + > +LIBABIVER := 1 > + > +# > +# all source are stored in SRCS-y > +# > +SRCS-y += cpt_pmd_ops_helper.c > + > +LDLIBS += -lrte_eal > + > +include $(RTE_SDK)/mk/rte.lib.mk > diff --git a/drivers/common/cpt/cpt_common.h b/drivers/common/cpt/cpt_common.h > index feca5fe..1f78d42 100644 > --- a/drivers/common/cpt/cpt_common.h > +++ b/drivers/common/cpt/cpt_common.h > @@ -18,6 +18,24 @@ > #define AE_TYPE 1 > #define SE_TYPE 2 > > +#ifndef ROUNDUP4 > +#define ROUNDUP4(val) (((val) + 3) & 0xfffffffc) > +#endif > + > +#ifndef ROUNDUP8 > +#define ROUNDUP8(val) (((val) + 7) & 0xfffffff8) > +#endif > + > +#ifndef ROUNDUP16 > +#define ROUNDUP16(val) (((val) + 15) & 0xfffffff0) > +#endif > + > +#ifndef __hot > +#define __hot __attribute__((hot)) > +#endif > + > +#define MOD_INC(i, l) ((i) == (l - 1) ? (i) = 0 : (i)++) > + > /* cpt instance */ > struct cpt_instance { > uint32_t queue_id; > @@ -51,4 +69,27 @@ struct pending_queue { > /**< Pending requests count */ > }; > > +struct cpt_request_info { > + /* fast path fields */ > + uint64_t dma_mode : 2; > + /**< DMA mode */ > + uint64_t se_req : 1; > + /**< To SE core */ > + uint64_t comp_baddr : 61; > + volatile uint64_t *completion_addr; > + volatile uint64_t *alternate_caddr; > + void *op; > + /**< Reference to operation */ better to have comments in the same line wherever possible and if not, please check indentation. Please check other patches as well.