From patchwork Fri Aug 24 18:29:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Duszynski X-Patchwork-Id: 43885 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2DE641B060; Fri, 24 Aug 2018 20:30:28 +0200 (CEST) Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by dpdk.org (Postfix) with ESMTP id D80221B05D for ; Fri, 24 Aug 2018 20:30:26 +0200 (CEST) Received: by mail-lf1-f68.google.com with SMTP id q13-v6so7393711lfc.2 for ; Fri, 24 Aug 2018 11:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Wgy2VMo9b1fjir57VB/05jS92sIa+6Bpezp8IjY11Rw=; b=iwcEXp4Pe4/Nq6lUcfBKmqgNfCLar3ruiznAKVhkFHGZ+xuCZLQayJrHRP+MbCd9Kh PfUxLOtfdX8gGFL/DrO2wG9jOmwSgl30BCPcwRoVff5AxWIqAUvrmS+MQJOWUfJ1P30p V6op0uFchG0M2jomwzMSkl04INfWcma/txX624LfhUsKXN6li+osxjiJaT29VVQcfyEd MjxKd3deRVPGgWZwi9649Bb3TQTAnAESD9wnkSIrfws5DHcoWa7jqh41XccRZTqtwyVW msPIWWS6fM4jBbgWecEm6tk7fGf3SJv62J/fLC0m0QlhVSBx6A7ELdhHKbywZYdcfLm5 UKBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Wgy2VMo9b1fjir57VB/05jS92sIa+6Bpezp8IjY11Rw=; b=fkVE3s0qI3vUiE9yTe7x6h/Jr9hcs9RK0iYhQRhGvNSAWWCKHdJkNFftSQFizl2hsS ISp45NQnJqD9k/MvDlX3S/Xw3TncaFPFwFCl8h+0tM2xhEwYUztMoJxNMG+iuEZw0NQG UQefdpI4TP1AloHgCRbrSRuOOm/HXGzQ4IJl1fSGAGW+rEF1BELAM9JlxSNAsVgHRKuw hUmRfYS95vwaLJmMcy00bwxdBlX6ha+uv9kwQqkd5TFRei5XaFXpAns4BJq4R/JFO/l/ RhE6+EOJjS8wccrqksFt8PXYloLjHcLba2IpGp8yS3su6gG6UOguEXkMFHAR6lVq1PpT MpJA== X-Gm-Message-State: APzg51AfTPkJi37EQ44MXnrvt76JtI9r2wtMDu2u3nI+LWVTizCdpVSS uzGfnVQ8tL07LYzx0W3pZV7hwiRFfS8= X-Google-Smtp-Source: ANB0VdYaOJSd1JTEWw7puDQv1e7bGPEApbByec6QbfMdjLvaxHmTBuUZihg6eYn2FkiAR6NvFxC00g== X-Received: by 2002:a19:c143:: with SMTP id r64-v6mr2114643lff.59.1535135426102; Fri, 24 Aug 2018 11:30:26 -0700 (PDT) Received: from sh.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id g16-v6sm1420484lfb.5.2018.08.24.11.30.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Aug 2018 11:30:25 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com, Liron Himi , Tomasz Duszynski Date: Fri, 24 Aug 2018 20:29:58 +0200 Message-Id: <1535135403-16115-2-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535135403-16115-1-git-send-email-tdu@semihalf.com> References: <1535122494-30249-1-git-send-email-tdu@semihalf.com> <1535135403-16115-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH v3 1/6] drivers/common: add mvep common code for MRVL PMDs 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" From: Liron Himi Add MVEP (Marvell Embedded Processors) to drivers/common which will keep code reused by current and future MRVL PMDs. Right now we have only common DMA memory initialization routines there. Signed-off-by: Liron Himi Signed-off-by: Tomasz Duszynski Reviewed-by: Natalie Samsonov --- drivers/common/Makefile | 4 +++ drivers/common/meson.build | 2 +- drivers/common/mvep/Makefile | 38 +++++++++++++++++++++ drivers/common/mvep/meson.build | 19 +++++++++++ drivers/common/mvep/mvep_common.c | 45 +++++++++++++++++++++++++ drivers/common/mvep/rte_common_mvep_version.map | 6 ++++ drivers/common/mvep/rte_mvep_common.h | 20 +++++++++++ mk/rte.app.mk | 4 +++ 8 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 drivers/common/mvep/Makefile create mode 100644 drivers/common/mvep/meson.build create mode 100644 drivers/common/mvep/mvep_common.c create mode 100644 drivers/common/mvep/rte_common_mvep_version.map create mode 100644 drivers/common/mvep/rte_mvep_common.h diff --git a/drivers/common/Makefile b/drivers/common/Makefile index 0fd2237..5f72da0 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_MVPP2_PMD),y) +DIRS-y += mvep +endif + include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/common/meson.build b/drivers/common/meson.build index d7b7d8c..f828ce7 100644 --- a/drivers/common/meson.build +++ b/drivers/common/meson.build @@ -2,6 +2,6 @@ # Copyright(c) 2018 Cavium, Inc std_deps = ['eal'] -drivers = ['octeontx', 'qat'] +drivers = ['mvep', 'octeontx', 'qat'] config_flag_fmt = 'RTE_LIBRTE_@0@_COMMON' driver_name_fmt = 'rte_common_@0@' diff --git a/drivers/common/mvep/Makefile b/drivers/common/mvep/Makefile new file mode 100644 index 0000000..1f5f005 --- /dev/null +++ b/drivers/common/mvep/Makefile @@ -0,0 +1,38 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Marvell International Ltd. +# + +include $(RTE_SDK)/mk/rte.vars.mk + +ifneq ($(MAKECMDGOALS),clean) +ifneq ($(MAKECMDGOALS),config) +ifeq ($(LIBMUSDK_PATH),) +$(error "Please define LIBMUSDK_PATH environment variable") +endif +endif +endif + +# library name +LIB = librte_common_mvep.a + +# library version +LIBABIVER := 1 + +# versioning export map +EXPORT_MAP := rte_common_mvep_version.map + +# external library dependencies +CFLAGS += -I$($RTE_SDK)/drivers/common/mvep +CFLAGS += -I$(LIBMUSDK_PATH)/include +CFLAGS += -DMVCONF_TYPES_PUBLIC +CFLAGS += -DMVCONF_DMA_PHYS_ADDR_T_PUBLIC +CFLAGS += $(WERROR_FLAGS) +CFLAGS += -O3 +LDLIBS += -L$(LIBMUSDK_PATH)/lib +LDLIBS += -lmusdk +LDLIBS += -lrte_eal -lrte_kvargs + +# library source files +SRCS-y += mvep_common.c + +include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/common/mvep/meson.build b/drivers/common/mvep/meson.build new file mode 100644 index 0000000..8ccfacb --- /dev/null +++ b/drivers/common/mvep/meson.build @@ -0,0 +1,19 @@ +# SPDX-License-Identifier: BSD-3-Clause +# Copyright(c) 2018 Marvell International Ltd. +# Copyright(c) 2018 Semihalf. +# All rights reserved. +# +path = get_option('lib_musdk_dir') +lib_dir = path + '/lib' +inc_dir = path + '/include' + +lib = cc.find_library('libmusdk', dirs: [lib_dir], required: false) +if not lib.found() + build = false +else + ext_deps += lib + includes += include_directories(inc_dir) + cflags += ['-DMVCONF_TYPES_PUBLIC', '-DMVCONF_DMA_PHYS_ADDR_T_PUBLIC'] +endif + +sources = files('mvep_common.c') diff --git a/drivers/common/mvep/mvep_common.c b/drivers/common/mvep/mvep_common.c new file mode 100644 index 0000000..67fa65b --- /dev/null +++ b/drivers/common/mvep/mvep_common.c @@ -0,0 +1,45 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Marvell International Ltd. + */ + +#include + +#include +#include + +#include "rte_mvep_common.h" + +/* Memory size (in bytes) for MUSDK dma buffers */ +#define MRVL_MUSDK_DMA_MEMSIZE (40 * 1024 * 1024) + +struct mvep { + uint32_t ref_count; +}; + +static struct mvep mvep; + +int rte_mvep_init(enum mvep_module_type module __rte_unused, + struct rte_kvargs *kvlist __rte_unused) +{ + int ret; + + if (!mvep.ref_count) { + ret = mv_sys_dma_mem_init(MRVL_MUSDK_DMA_MEMSIZE); + if (ret) + return ret; + } + + mvep.ref_count++; + + return 0; +} + +int rte_mvep_deinit(enum mvep_module_type module __rte_unused) +{ + mvep.ref_count--; + + if (!mvep.ref_count) + mv_sys_dma_mem_destroy(); + + return 0; +} diff --git a/drivers/common/mvep/rte_common_mvep_version.map b/drivers/common/mvep/rte_common_mvep_version.map new file mode 100644 index 0000000..c71722d --- /dev/null +++ b/drivers/common/mvep/rte_common_mvep_version.map @@ -0,0 +1,6 @@ +DPDK_18.11 { + global: + + rte_mvep_init; + rte_mvep_deinit; +}; diff --git a/drivers/common/mvep/rte_mvep_common.h b/drivers/common/mvep/rte_mvep_common.h new file mode 100644 index 0000000..ba47e16 --- /dev/null +++ b/drivers/common/mvep/rte_mvep_common.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright(c) 2018 Marvell International Ltd. + */ + +#ifndef __RTE_MVEP_COMMON_H__ +#define __RTE_MVEP_COMMON_H__ + +#include + +enum mvep_module_type { + MVEP_MOD_T_NONE = 0, + MVEP_MOD_T_PP2, + MVEP_MOD_T_SAM, + MVEP_MOD_T_LAST +}; + +int rte_mvep_init(enum mvep_module_type module, struct rte_kvargs *kvlist); +int rte_mvep_deinit(enum mvep_module_type module); + +#endif /* __RTE_MVEP_COMMON_H__ */ diff --git a/mk/rte.app.mk b/mk/rte.app.mk index de33883..899d51a 100644 --- a/mk/rte.app.mk +++ b/mk/rte.app.mk @@ -98,6 +98,10 @@ ifeq ($(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF)$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOO _LDLIBS-y += -lrte_common_octeontx endif +ifeq ($(CONFIG_RTE_LIBRTE_MVPP2_PMD),y) +_LDLIBS-y += -lrte_common_mvep -L$(LIBMUSDK_PATH)/lib -lmusdk +endif + _LDLIBS-$(CONFIG_RTE_LIBRTE_PCI_BUS) += -lrte_bus_pci _LDLIBS-$(CONFIG_RTE_LIBRTE_VDEV_BUS) += -lrte_bus_vdev _LDLIBS-$(CONFIG_RTE_LIBRTE_DPAA_BUS) += -lrte_bus_dpaa From patchwork Fri Aug 24 18:29:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Duszynski X-Patchwork-Id: 43886 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 22EDD1B066; Fri, 24 Aug 2018 20:30:30 +0200 (CEST) Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by dpdk.org (Postfix) with ESMTP id BC5E51B05E for ; Fri, 24 Aug 2018 20:30:27 +0200 (CEST) Received: by mail-lj1-f196.google.com with SMTP id q127-v6so7577364ljq.11 for ; Fri, 24 Aug 2018 11:30:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=CUCNDYiYMEPp1L3w8/F4Bfjs4lbrGllyP/ekobLjWtI=; b=BGXiOM3CKqdIW0E7R5QyTYAoHTbF/pDxoDbAijW0vIbDAjm1n7M6RyiWkfsI8gBAWz yoXv4i+PLPnjZY2V2WVmu6bpKHQ83ODtYV3bTbwDaXINnPps0Xd/Qoz1I/o+b6vemBi2 ajSAd9Grfzz4O/XXlLyVivJGZE5QRZxJ1wyS7Kwak4Gvx4ch6ZviG8C4fVzhk879L1rM XJRZY1bRiMsMIVQxTwAJ5IR5mjEZTqDiwUjP/2ZCcT+UG8mwLyya9T+eNAO+1OUvpP0k Z1z6zseo0m1JKdde802VmbSwIiXhVVFHSeERjZE3TGzbJ2wvmb8x7yjCVxknHvLlYfF6 TDug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=CUCNDYiYMEPp1L3w8/F4Bfjs4lbrGllyP/ekobLjWtI=; b=FPKcDGaHItiiVOH6ie4j+xlnf3wjZVvptBjP425rv4/hNEHYtm6y8QNrwXQKwoKSIC 6vslyMZPL0dpGyf/SRaUnOPwE5nTLN9hRqWlW+BYfFCkyJq+GU6YOBr+vW1hDDlRMpVJ KB5LUBo3Uwc08MqlDAX1SnNVOU1UDwuYVmyAFtz2cOvAfAC9/nA4mk8gCrLQzgMnLNUd fWBMXh+cMzFx5zOPgpN7uleYmsHIUzLBX+KvYHZgzpGX+qHgp0FlJCjoFJAh4I9JEn1y Jwib6CeX9FFs++CUhIBDKRxn42uLZXFiCLuXO2QiXe0AnouwY9vKjze2m5M7LYdciYu5 PfkA== X-Gm-Message-State: APzg51CGHuSk6RiDfPJVZIRTTUW8/vWQFyzlqQZgtG9l2058hZqGOI3D ypjCo57RdzqlXTupq9wXpxmuH1X0GDk= X-Google-Smtp-Source: ANB0Vdbehpr39bBkxlneYb1OgZPyPCWRlFfv4Nuknk5D4JkiOUnCG87gMH0N2ZpJIoqYeNsCDk/usg== X-Received: by 2002:a2e:9cd0:: with SMTP id g16-v6mr2206055ljj.110.1535135427253; Fri, 24 Aug 2018 11:30:27 -0700 (PDT) Received: from sh.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id g16-v6sm1420484lfb.5.2018.08.24.11.30.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Aug 2018 11:30:26 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com, Liron Himi Date: Fri, 24 Aug 2018 20:29:59 +0200 Message-Id: <1535135403-16115-3-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535135403-16115-1-git-send-email-tdu@semihalf.com> References: <1535122494-30249-1-git-send-email-tdu@semihalf.com> <1535135403-16115-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH v3 2/6] net/mvpp2: use common code to initialize DMA 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" From: Liron Himi Use common code to initialize MUSDK DMA memory buffers. Signed-off-by: Liron Himi Reviewed-by: Natalie Samsonov --- drivers/net/mvpp2/Makefile | 3 ++- drivers/net/mvpp2/meson.build | 2 +- drivers/net/mvpp2/mrvl_ethdev.c | 32 +++++++++++--------------------- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/drivers/net/mvpp2/Makefile b/drivers/net/mvpp2/Makefile index 492aef9..211d398 100644 --- a/drivers/net/mvpp2/Makefile +++ b/drivers/net/mvpp2/Makefile @@ -23,6 +23,7 @@ LIBABIVER := 1 EXPORT_MAP := rte_pmd_mvpp2_version.map # external library dependencies +CFLAGS += -I$(RTE_SDK)/drivers/common/mvep CFLAGS += -I$(LIBMUSDK_PATH)/include CFLAGS += -DMVCONF_TYPES_PUBLIC CFLAGS += -DMVCONF_DMA_PHYS_ADDR_T_PUBLIC @@ -32,7 +33,7 @@ LDLIBS += -L$(LIBMUSDK_PATH)/lib LDLIBS += -lmusdk LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring LDLIBS += -lrte_ethdev -lrte_net -lrte_kvargs -lrte_cfgfile -LDLIBS += -lrte_bus_vdev +LDLIBS += -lrte_bus_vdev -lrte_common_mvep # library source files SRCS-$(CONFIG_RTE_LIBRTE_MVPP2_PMD) += mrvl_ethdev.c diff --git a/drivers/net/mvpp2/meson.build b/drivers/net/mvpp2/meson.build index e139889..3620659 100644 --- a/drivers/net/mvpp2/meson.build +++ b/drivers/net/mvpp2/meson.build @@ -22,4 +22,4 @@ sources = files( 'mrvl_qos.c' ) -deps += ['cfgfile'] +deps += ['cfgfile', 'common_mvep'] diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index a2d0576..8e1a32f 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -29,6 +29,7 @@ #include #include +#include #include "mrvl_ethdev.h" #include "mrvl_qos.h" @@ -63,9 +64,6 @@ #define MRVL_COOKIE_HIGH_ADDR_SHIFT (sizeof(pp2_cookie_t) * 8) #define MRVL_COOKIE_HIGH_ADDR_MASK (~0ULL << MRVL_COOKIE_HIGH_ADDR_SHIFT) -/* Memory size (in bytes) for MUSDK dma buffers */ -#define MRVL_MUSDK_DMA_MEMSIZE 41943040 - /** Port Rx offload capabilities */ #define MRVL_RX_OFFLOADS (DEV_RX_OFFLOAD_VLAN_FILTER | \ DEV_RX_OFFLOAD_JUMBO_FRAME | \ @@ -2654,23 +2652,16 @@ rte_pmd_mrvl_probe(struct rte_vdev_device *vdev) goto init_devices; MRVL_LOG(INFO, "Perform MUSDK initializations"); - /* - * ret == -EEXIST is correct, it means DMA - * has been already initialized (by another PMD). - */ - ret = mv_sys_dma_mem_init(MRVL_MUSDK_DMA_MEMSIZE); - if (ret < 0) { - if (ret != -EEXIST) - goto out_free_kvlist; - else - MRVL_LOG(INFO, - "DMA memory has been already initialized by a different driver."); - } + + ret = rte_mvep_init(MVEP_MOD_T_PP2, kvlist); + if (ret) + goto out_free_kvlist; ret = mrvl_init_pp2(); if (ret) { MRVL_LOG(ERR, "Failed to init PP!"); - goto out_deinit_dma; + rte_mvep_deinit(MVEP_MOD_T_PP2); + goto out_free_kvlist; } memset(mrvl_port_bpool_size, 0, sizeof(mrvl_port_bpool_size)); @@ -2695,11 +2686,10 @@ rte_pmd_mrvl_probe(struct rte_vdev_device *vdev) for (; i > 0; i--) mrvl_eth_dev_destroy(ifnames.names[i]); - if (mrvl_dev_num == 0) + if (mrvl_dev_num == 0) { mrvl_deinit_pp2(); -out_deinit_dma: - if (mrvl_dev_num == 0) - mv_sys_dma_mem_destroy(); + rte_mvep_deinit(MVEP_MOD_T_PP2); + } out_free_kvlist: rte_kvargs_free(kvlist); @@ -2739,7 +2729,7 @@ rte_pmd_mrvl_remove(struct rte_vdev_device *vdev) MRVL_LOG(INFO, "Perform MUSDK deinit"); mrvl_deinit_hifs(); mrvl_deinit_pp2(); - mv_sys_dma_mem_destroy(); + rte_mvep_deinit(MVEP_MOD_T_PP2); } return 0; From patchwork Fri Aug 24 18:30:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Duszynski X-Patchwork-Id: 43887 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3D9B61B070; Fri, 24 Aug 2018 20:30:32 +0200 (CEST) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by dpdk.org (Postfix) with ESMTP id 3BB0C1B063 for ; Fri, 24 Aug 2018 20:30:29 +0200 (CEST) Received: by mail-lj1-f195.google.com with SMTP id j19-v6so7587649ljc.7 for ; Fri, 24 Aug 2018 11:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=23B68GOIwyoN7udtt/ZpKpY/ci2wftwnQPmFE/VJp74=; b=zjQLkebxbDKaNJB7VMjrttzCYy/fsrc87aAz80lgQ+sNEbEkyb4y9ONr8/Vzgsq9yL oJAIj87K4ubA1/Gxenb/CUh1dh0eLzQxe3Ohr6A/TMdsLCKJjEAF1/mBUelE1PbE12K2 0lT7o4eAxIZ4knyt9jFPZWKCNZfhim+9SyaYVKY9jynmhbz4MVMY2/3th9hJXTswEAdj 0DGVvg1kWQhTsvWyrsp5WLjoiYl1cyMPyhKy86ca0Pfh6HTdqY6A7nMA86oyGjrzuZHE BUsEhxQAYyEWhzYfqpK0kRZBrCNPYlKO5OjUbVaysTON59NCrQ3gPNPij4GZtlYktNIp uM9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=23B68GOIwyoN7udtt/ZpKpY/ci2wftwnQPmFE/VJp74=; b=miF8XZAZkwd2S4MuzEIahght37+Z15lIcGka5b+1aOrMGHZ/x55BLoI1cR66tjGJHI J4FQB7XRBytsHRunmTCDHvEeWIUNNd6rpmgeqYb5YZXOUmtnZU3DKPAp4k8646JIDv2z mO1AvhelZ9xdC7QXi+gJ1dyzAnaUIM03hel3fh3hVTqyYlgCDJ5e8QG11w+HHY6LZPat j2nba5QJsuYXdxR0CIjL0ZxKfD7wlzmjuxT0EnBrhxNxti+Bn2kBNhvx4AHaz7veL49z oO6mU518YD8EzK924ly6haIzIDqBVlT/rJhirLq9O9wv+l6S0uHPVk5oYLV9y8RS80Vj 83lQ== X-Gm-Message-State: APzg51CwVn9dz9ISI/bY4pBRadfWOfrpQZFBJu4bfG45dq+On+6CCOy8 cv/WFTSbmzJo8QsmGidxcdx34aCgf7c= X-Google-Smtp-Source: ANB0VdYZ8T1s3B41F+C9K5ardBlpNzxab8PPW0Mqn9b9r0mHNFc0mchCYRoXKAGzF72MKI0RuFeCYg== X-Received: by 2002:a2e:99c3:: with SMTP id l3-v6mr2262231ljj.48.1535135428745; Fri, 24 Aug 2018 11:30:28 -0700 (PDT) Received: from sh.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id g16-v6sm1420484lfb.5.2018.08.24.11.30.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Aug 2018 11:30:27 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com, Tomasz Duszynski , stable@dpdk.org Date: Fri, 24 Aug 2018 20:30:00 +0200 Message-Id: <1535135403-16115-4-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535135403-16115-1-git-send-email-tdu@semihalf.com> References: <1535122494-30249-1-git-send-email-tdu@semihalf.com> <1535135403-16115-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH v3 3/6] net/mvpp2: fix array initialization 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" Fix used_bpools array initialization by using range initializer. This way all necessary variables are properly initialized regardless of PP2_NUM_PKT_PROC value. Fixes: 0ddc9b815b11 ("net/mrvl: add net PMD skeleton") Cc: stable@dpdk.org Signed-off-by: Tomasz Duszynski --- drivers/net/mvpp2/mrvl_ethdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index 8e1a32f..fdf416b 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -84,8 +84,7 @@ static const char * const valid_args[] = { static int used_hifs = MRVL_MUSDK_HIFS_RESERVED; static struct pp2_hif *hifs[RTE_MAX_LCORE]; static int used_bpools[PP2_NUM_PKT_PROC] = { - MRVL_MUSDK_BPOOLS_RESERVED, - MRVL_MUSDK_BPOOLS_RESERVED + [0 ... PP2_NUM_PKT_PROC - 1] = MRVL_MUSDK_BPOOLS_RESERVED }; struct pp2_bpool *mrvl_port_to_bpool_lookup[RTE_MAX_ETHPORTS]; From patchwork Fri Aug 24 18:30:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Duszynski X-Patchwork-Id: 43888 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A2A581B079; Fri, 24 Aug 2018 20:30:34 +0200 (CEST) Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by dpdk.org (Postfix) with ESMTP id 663C41B053 for ; Fri, 24 Aug 2018 20:30:30 +0200 (CEST) Received: by mail-lf1-f68.google.com with SMTP id h64-v6so5874881lfi.10 for ; Fri, 24 Aug 2018 11:30:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DuNIJKs2ebfo80SbqgaSWcAxNGMIp5DumfTiALAK+uI=; b=WGHeCDGozTK8+2HtoGSWeHfuKO6ZgDb8MNMuPBoqCA7Nn7chOo26mtnRPuzf+m1h07 Xj/3ht74hZb3/uBQ43qnMV4qmCEqX0V7Wjs1r0IasdGkSokD5fC3LAEZumlZhGGR0shL 7ZVn+prIZESOQUd6Qbfr7AOcuCMS8X2Mt6edcvMu3Bm8A3uEiyngpw5wsxOM2Y1xWNuV +XEE0zxb3gdR3mwFRGqSsUtjJTUVUBrAICvue4npZ2OGOU45IO4MuqKquw13j8n6gMWq MyvVsf8NBzN+aiYDAcEdOgtlPRZHAnvh2DQcK1g8P80NpdNbeTtFJFhY4UmLRqSkF5dF QbWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DuNIJKs2ebfo80SbqgaSWcAxNGMIp5DumfTiALAK+uI=; b=Dsx6YpFTk+q66RlgsbfYPnguqBmCplj8wseSg6wLlYQ1mrm2286ReLq21KeL58ZGlg b6lY/Qsu2cC8FKGdNGkA3BoesAQOZKtZ8i09xKTrIMMEJecAJg3HHIrfNxiyCBZmHA5s 9dO+Tdfvd4lOY70/DUGVR6xmIReGvc7rlufFvppkcqisFZqHl99Yj08x8qy3lk7PW72e OTxIXrvAWp+vHUP2qsm/jE6N3ShkVu4g6bfufYaKe8VykHE/tiZ1m711IM0kOm7P0EKH V/x9EbmnaVyqwceG3PMAeMR7sS2NxFpUdnD1f3b47mR636HwSOnzSp/VcCvlWt8Hu+tJ UCMg== X-Gm-Message-State: APzg51BAfa0l3prFZrwBdGwPK0FjRk/6rIS7nBFUAAXORvVCGLzhGPog BwlBD8LVKgsGv4xjH4/va/RHdNX7/Dc= X-Google-Smtp-Source: ANB0VdZ58Bt4eGptfynA8K5PjeR1gmA7rxl946TwZajh8+8yqHurmeTh4hl3tZFhoW7zZtIXk60AXQ== X-Received: by 2002:a19:a915:: with SMTP id s21-v6mr2158567lfe.92.1535135429883; Fri, 24 Aug 2018 11:30:29 -0700 (PDT) Received: from sh.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id g16-v6sm1420484lfb.5.2018.08.24.11.30.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Aug 2018 11:30:29 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com, tdu@semihalf.com Date: Fri, 24 Aug 2018 20:30:01 +0200 Message-Id: <1535135403-16115-5-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535135403-16115-1-git-send-email-tdu@semihalf.com> References: <1535122494-30249-1-git-send-email-tdu@semihalf.com> <1535135403-16115-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH v3 4/6] net/mvpp2: fix comments and error messages 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" From: Natalie Samsonov Fix comments and error messages. Fixes: 7235341d7517 ("net/mrvl: support classifier") Cc: tdu@semihalf.com Signed-off-by: Natalie Samsonov Reviewed-by: Liron Himi --- drivers/net/mvpp2/mrvl_flow.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/drivers/net/mvpp2/mrvl_flow.c b/drivers/net/mvpp2/mrvl_flow.c index ecc3419..13295e6 100644 --- a/drivers/net/mvpp2/mrvl_flow.c +++ b/drivers/net/mvpp2/mrvl_flow.c @@ -394,7 +394,8 @@ mrvl_parse_init(const struct rte_flow_item *item, * * @param spec Pointer to the specific flow item. * @param mask Pointer to the specific flow item's mask. - * @param mask Pointer to the flow. + * @param parse_dst Parse either destination or source mac address. + * @param flow Pointer to the flow. * @return 0 in case of success, negative error value otherwise. */ static int @@ -613,6 +614,7 @@ mrvl_parse_ip4_dscp(const struct rte_flow_item_ipv4 *spec, * * @param spec Pointer to the specific flow item. * @param mask Pointer to the specific flow item's mask. + * @param parse_dst Parse either destination or source ip address. * @param flow Pointer to the flow. * @return 0 in case of success, negative error value otherwise. */ @@ -726,6 +728,7 @@ mrvl_parse_ip4_proto(const struct rte_flow_item_ipv4 *spec, * * @param spec Pointer to the specific flow item. * @param mask Pointer to the specific flow item's mask. + * @param parse_dst Parse either destination or source ipv6 address. * @param flow Pointer to the flow. * @return 0 in case of success, negative error value otherwise. */ @@ -874,6 +877,7 @@ mrvl_parse_ip6_next_hdr(const struct rte_flow_item_ipv6 *spec, * * @param spec Pointer to the specific flow item. * @param mask Pointer to the specific flow item's mask. + * @param parse_dst Parse either destination or source port. * @param flow Pointer to the flow. * @return 0 in case of success, negative error value otherwise. */ @@ -949,6 +953,7 @@ mrvl_parse_tcp_dport(const struct rte_flow_item_tcp *spec, * * @param spec Pointer to the specific flow item. * @param mask Pointer to the specific flow item's mask. + * @param parse_dst Parse either destination or source port. * @param flow Pointer to the flow. * @return 0 in case of success, negative error value otherwise. */ @@ -1022,7 +1027,6 @@ mrvl_parse_udp_dport(const struct rte_flow_item_udp *spec, * @param item Pointer to the flow item. * @param flow Pointer to the flow. * @param error Pointer to the flow error. - * @param fields Pointer to the parsed parsed fields enum. * @returns 0 on success, negative value otherwise. */ static int @@ -1073,7 +1077,6 @@ mrvl_parse_eth(const struct rte_flow_item *item, struct rte_flow *flow, * @param item Pointer to the flow item. * @param flow Pointer to the flow. * @param error Pointer to the flow error. - * @param fields Pointer to the parsed parsed fields enum. * @returns 0 on success, negative value otherwise. */ static int @@ -1139,7 +1142,6 @@ mrvl_parse_vlan(const struct rte_flow_item *item, * @param item Pointer to the flow item. * @param flow Pointer to the flow. * @param error Pointer to the flow error. - * @param fields Pointer to the parsed parsed fields enum. * @returns 0 on success, negative value otherwise. */ static int @@ -1205,7 +1207,6 @@ mrvl_parse_ip4(const struct rte_flow_item *item, * @param item Pointer to the flow item. * @param flow Pointer to the flow. * @param error Pointer to the flow error. - * @param fields Pointer to the parsed parsed fields enum. * @returns 0 on success, negative value otherwise. */ static int @@ -1276,7 +1277,6 @@ mrvl_parse_ip6(const struct rte_flow_item *item, * @param item Pointer to the flow item. * @param flow Pointer to the flow. * @param error Pointer to the flow error. - * @param fields Pointer to the parsed parsed fields enum. * @returns 0 on success, negative value otherwise. */ static int @@ -1332,7 +1332,6 @@ mrvl_parse_tcp(const struct rte_flow_item *item, * @param item Pointer to the flow item. * @param flow Pointer to the flow. * @param error Pointer to the flow error. - * @param fields Pointer to the parsed parsed fields enum. * @returns 0 on success, negative value otherwise. */ static int @@ -1981,6 +1980,7 @@ mrvl_parse_pattern_ip6_tcp(const struct rte_flow_item pattern[], * @param pattern Pointer to the flow pattern table. * @param flow Pointer to the flow. * @param error Pointer to the flow error. + * @param ip6 1 to parse ip6 item, 0 to parse ip4 item. * @returns 0 in case of success, negative value otherwise. */ static int @@ -2350,6 +2350,12 @@ mrvl_flow_parse(struct mrvl_priv *priv, const struct rte_flow_attr *attr, return mrvl_flow_parse_actions(priv, actions, flow, error); } +/** + * Get engine type for the given flow. + * + * @param field Pointer to the flow. + * @returns The type of the engine. + */ static inline enum pp2_cls_tbl_type mrvl_engine_type(const struct rte_flow *flow) { @@ -2369,6 +2375,13 @@ mrvl_engine_type(const struct rte_flow *flow) return PP2_CLS_TBL_MASKABLE; } +/** + * Create classifier table. + * + * @param dev Pointer to the device. + * @param flow Pointer to the very first flow. + * @returns 0 in case of success, negative value otherwise. + */ static int mrvl_create_cls_table(struct rte_eth_dev *dev, struct rte_flow *first_flow) { @@ -2655,7 +2668,7 @@ mrvl_flow_remove(struct mrvl_priv *priv, struct rte_flow *flow, /** * DPDK flow destroy callback called when flow is to be removed. * - * @param priv Pointer to the port's private data. + * @param dev Pointer to the device. * @param flow Pointer to the flow. * @param error Pointer to the flow error. * @returns 0 in case of success, negative value otherwise. From patchwork Fri Aug 24 18:30:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Duszynski X-Patchwork-Id: 43889 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 03ECC1B07E; Fri, 24 Aug 2018 20:30:36 +0200 (CEST) Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by dpdk.org (Postfix) with ESMTP id 5B0371B06A for ; Fri, 24 Aug 2018 20:30:31 +0200 (CEST) Received: by mail-lj1-f195.google.com with SMTP id u83-v6so7561584lje.12 for ; Fri, 24 Aug 2018 11:30:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1zvEVVfi4c4rO2tEdEvaWQ1DTpcG6gmJWaSl9WhkJwU=; b=MPVD2o4opXyxwnkkHxjSFK6L58/+CEqbuzM0syRUF8KqMr3sZmkHEl/yd7IvUeHoH0 jsRvziv2F0giyJhPK1KBI8H8gx17vz6CsKOPNvZNN9wO5vSCTEOhN+wvONaffRrB6Aih RV1VnqvpE7DvGBs61cf++FtRdPAhZ1CHIrsxuSlZmru1HQzT0sp+TFh1f/uU0gDtEXkZ aL9TPHfICTLI8O8TdlJBJZlpDmDSSjYeyVjYTW9orlADREAlpbCY2tFdO82LLwapgMXP 0GoJ1fK4YuyNPJKFTw10eZFdACtJ6S6YrmChFkXSQIaUikvpTHOBhd1aKcuzWCFwcaUl 2Yig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1zvEVVfi4c4rO2tEdEvaWQ1DTpcG6gmJWaSl9WhkJwU=; b=abVDTMQHlvl7O8InFuwAvw0UhhuZG+flK/mDzLB0uKZC4zJIwy8R56E1m+m3S54nS3 mIyqURFatpKgSS5qbrEguOnj4Tl4P7AUT4grUifMHlKB3RAC4eXdzXzCtVuz8Lx72dx0 Bwq5kBu4L9gBQExjoQKhLHOTFVNUmkTYf35yJhabsCGIrwOY4cbIEBFDAERoAGsnrWtR 69ynP7L5ogfIMQuHi+Z9hRDpBfVpK/raopKHqUor1nn2CsW2Ah4zE9yMBX0WP5IHOcfR OCAFefZzIvO4S73XuPF3jWqfbjIYbRpxSaX605ajFVD8rMfkDO6QticacBIukpAxtOOF cH7g== X-Gm-Message-State: APzg51CQN3BfKle0VNPvuHQHOc87ar829lVJfiQfMBDFUW46TW+B085q NZtjnafJjaxIrvCQpjHeT2Le5THDSwE= X-Google-Smtp-Source: ANB0VdY9BH3MGZh0+6CoZwHX9Nqai38qYm2Wv64XMc1ObW2KliFs3wNZ1ctpFhpKmj4nTlBQ9eM20Q== X-Received: by 2002:a2e:84c6:: with SMTP id q6-v6mr2239032ljh.65.1535135430927; Fri, 24 Aug 2018 11:30:30 -0700 (PDT) Received: from sh.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id g16-v6sm1420484lfb.5.2018.08.24.11.30.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Aug 2018 11:30:30 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com Date: Fri, 24 Aug 2018 20:30:02 +0200 Message-Id: <1535135403-16115-6-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535135403-16115-1-git-send-email-tdu@semihalf.com> References: <1535122494-30249-1-git-send-email-tdu@semihalf.com> <1535135403-16115-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH v3 5/6] net/mvpp2: make private variables static 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" From: Natalie Samsonov Mark internal variables static to avoid potential redefinition errors later on. Signed-off-by: Natalie Samsonov Reviewed-by: Yelena Krivosheev --- drivers/net/mvpp2/mrvl_ethdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index fdf416b..6f18315 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -87,9 +87,9 @@ static int used_bpools[PP2_NUM_PKT_PROC] = { [0 ... PP2_NUM_PKT_PROC - 1] = MRVL_MUSDK_BPOOLS_RESERVED }; -struct pp2_bpool *mrvl_port_to_bpool_lookup[RTE_MAX_ETHPORTS]; -int mrvl_port_bpool_size[PP2_NUM_PKT_PROC][PP2_BPOOL_NUM_POOLS][RTE_MAX_LCORE]; -uint64_t cookie_addr_high = MRVL_COOKIE_ADDR_INVALID; +static struct pp2_bpool *mrvl_port_to_bpool_lookup[RTE_MAX_ETHPORTS]; +static int mrvl_port_bpool_size[PP2_NUM_PKT_PROC][PP2_BPOOL_NUM_POOLS][RTE_MAX_LCORE]; +static uint64_t cookie_addr_high = MRVL_COOKIE_ADDR_INVALID; int mrvl_logtype; From patchwork Fri Aug 24 18:30:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Duszynski X-Patchwork-Id: 43890 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 9471B1B082; Fri, 24 Aug 2018 20:30:37 +0200 (CEST) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by dpdk.org (Postfix) with ESMTP id BEE9D1B074 for ; Fri, 24 Aug 2018 20:30:32 +0200 (CEST) Received: by mail-lj1-f194.google.com with SMTP id 203-v6so7561951ljj.13 for ; Fri, 24 Aug 2018 11:30:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=w1db2MwYke5E6b/UWoQugpuGwBGm8UBRDJS1sJSavl0=; b=NWH3jM4XrWc7QTSo6dglX79zEzaxbj/w/46dxO5aqWn87wYSvQV7JNtYbEo6C0Xv52 SboUtQFWimbKvGY/dyIwMSHEDr7d25vVmOdUkEpSQuMKgqcEsjMRd738i72kd2Lla480 A4cYwydeeCh0ypzrs3NWo/ODnxQE3S7LaHYmePsH5JGviz2ZAE9+ewIkTehcJDcrpun8 bGCQ1mQgHiZ8xpmiw8fnBoXEdqQpHfGooyG2rJeMUNm54jwCoqjVwEf1Lt1CeO+oNQ9Z jNBgDgINMB86hDjMOIIjVdZi84z7/KRukT32hoeFGjLctEJN+mi+362HpEACyN0wiIUe Yv4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=w1db2MwYke5E6b/UWoQugpuGwBGm8UBRDJS1sJSavl0=; b=fU+uT3dgb5tYrNx8AtUDiJvw0Mv02yzBLGBD06QL+Fna9gwy/XIT1oH+3bLUtm/JsO cF6BehFJsnzGKYbxMHiVol+FknHZxUvSOqubtA4HYTvPFoXyYxqc8dgTAkxUdpsvAIDn RlOx83nAsITTpqAEkhyGo/KXgGpi+4xMzVG+jbBFjhI15kc10yZkXm8CxeotgggdbIHJ ynGzrrRXoSEHK0e7eJCqPqgI1+D88f9BvxATSi8wZ5V2huR7qO+mpxtRkyPO2KHNCJbE xjnsGf0dh6cKbterdv/chWMHMntbRZjR2I+8zAJG7f5c9XvmriB+zqHlNw2QTAX6TpwE S1bw== X-Gm-Message-State: APzg51D0DVB5eAXPneCUn4jbrOju2GPA+ucwWTsf8mXNv286NjDaCHTx VBIjYSmzHamwsa28yMIGxRlg6U1rtfA= X-Google-Smtp-Source: ANB0Vdbn4lxNSEn/6O5gToNd9DIBL4AouRVeKHzA4lwK7tx2suQ9CMuMv68a03jERjoW8DkqWr3E0g== X-Received: by 2002:a2e:8147:: with SMTP id t7-v6mr2235792ljg.32.1535135432235; Fri, 24 Aug 2018 11:30:32 -0700 (PDT) Received: from sh.semihalf.local (31-172-191-173.noc.fibertech.net.pl. [31.172.191.173]) by smtp.gmail.com with ESMTPSA id g16-v6sm1420484lfb.5.2018.08.24.11.30.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Aug 2018 11:30:31 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com Date: Fri, 24 Aug 2018 20:30:03 +0200 Message-Id: <1535135403-16115-7-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535135403-16115-1-git-send-email-tdu@semihalf.com> References: <1535122494-30249-1-git-send-email-tdu@semihalf.com> <1535135403-16115-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH v3 6/6] net/mvpp2: add VLAN packet type support for parser offload 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" From: Natalie Samsonov Add VLAN packet type support for parser offload. Signed-off-by: Natalie Samsonov Reviewed-by: Shlomi Gridish Reviewed-by: Dmitri Epshtein Reviewed-by: Yuval Caduri --- drivers/net/mvpp2/mrvl_ethdev.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index 6f18315..6824445 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -1353,6 +1353,8 @@ mrvl_dev_supported_ptypes_get(struct rte_eth_dev *dev __rte_unused) { static const uint32_t ptypes[] = { RTE_PTYPE_L2_ETHER, + RTE_PTYPE_L2_ETHER_VLAN, + RTE_PTYPE_L2_ETHER_QINQ, RTE_PTYPE_L3_IPV4, RTE_PTYPE_L3_IPV4_EXT, RTE_PTYPE_L3_IPV4_EXT_UNKNOWN, @@ -1922,13 +1924,27 @@ mrvl_desc_to_packet_type_and_offset(struct pp2_ppio_desc *desc, { enum pp2_inq_l3_type l3_type; enum pp2_inq_l4_type l4_type; + enum pp2_inq_vlan_tag vlan_tag; uint64_t packet_type; pp2_ppio_inq_desc_get_l3_info(desc, &l3_type, l3_offset); pp2_ppio_inq_desc_get_l4_info(desc, &l4_type, l4_offset); + pp2_ppio_inq_desc_get_vlan_tag(desc, &vlan_tag); packet_type = RTE_PTYPE_L2_ETHER; + switch (vlan_tag) { + case PP2_INQ_VLAN_TAG_SINGLE: + packet_type |= RTE_PTYPE_L2_ETHER_VLAN; + break; + case PP2_INQ_VLAN_TAG_DOUBLE: + case PP2_INQ_VLAN_TAG_TRIPLE: + packet_type |= RTE_PTYPE_L2_ETHER_QINQ; + break; + default: + break; + } + switch (l3_type) { case PP2_INQ_L3_TYPE_IPV4_NO_OPTS: packet_type |= RTE_PTYPE_L3_IPV4;