From patchwork Fri Aug 24 14:54:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Duszynski X-Patchwork-Id: 43872 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 F30535F2D; Fri, 24 Aug 2018 16:55:05 +0200 (CEST) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by dpdk.org (Postfix) with ESMTP id 51E115F28 for ; Fri, 24 Aug 2018 16:55:04 +0200 (CEST) Received: by mail-lj1-f193.google.com with SMTP id f8-v6so7131045ljk.1 for ; Fri, 24 Aug 2018 07:55:04 -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=s8z5Hk93eG+7g+UHFj1EQT46F4z3gY52q2lbFSaBU8U=; b=ATyk+LofP2OPICM28t4JAeGZTzrJvsAnSMsV530fIYO3J3B/cx+7eU3hDf3bE87yb4 8t9IiWpNKNdsGOuN59dqhpJmf4j6QoEOWL/OemqmIYcNn9styQyjfM5gMgumjU2/XoeO S/Q7YDV2XJ0aRDjRrl5qoavXKTfcKXC0aR5UA0d5Cgft2iXothCj87EroTG1GLNp+hrO cqf3ipazKhwZiHEKHEqf7rYIUAMk6ucvZDbJaleQaafKWYRyDzHAGOJxXTvG8Yf5jjGw ObrulV5PQxgvaCa3JtxUz9w/UwkaPTLEfOEHAferG7qh/ZHlILv+KohEM6Oz1s9/RM7B ScrA== 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=s8z5Hk93eG+7g+UHFj1EQT46F4z3gY52q2lbFSaBU8U=; b=E6ZzdEM3c63ftrhfhQnqEREcJWfZBiDw1bFK/nMdidd/tVSaSkFIik4zS5UaMVpwGr STqDN5qq6SFOtggLHj+8Du2K9wfYYSXs3z4oT/oADbEaUSar+b218TXLYKe+V58icTAn VPgzKHz7Anow33R/vAXpKUNZ9ZBmx3OUND6IdFZJkxQ1H3Jif1IIo07qPL6X1UcQRDsj iBqct7NzlRWjk/Sjrzrb2C2i5NtS5EyM5gdb/pnZf/TBo5sFFkAdX7HNfYZtM37qcOpu o4RVWNg8I5OhHLnfG9oG2oPy0VSZvowtIDHxC+vNt/wvcNgu4dYR3lDP3o/qzGgnxFCo 26aQ== X-Gm-Message-State: APzg51CE/wJ8tXXrH4MEC3go7dCX3MxjGlv2mFl6IUfrBkEBBEJLtQEq vhN23L86rO4+WHEqnky9NovHx+tElIE= X-Google-Smtp-Source: ANB0VdadvYduLgqtyhsYn7FjmOKWvL8ILwQ7hZ5JiDM2GUpkr9/detX/pHgKBb8i4jfQSyIhH1HBKA== X-Received: by 2002:a2e:2ac3:: with SMTP id q186-v6mr1554172ljq.123.1535122503588; Fri, 24 Aug 2018 07:55:03 -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 j140-v6sm1373659lfg.16.2018.08.24.07.55.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Aug 2018 07:55:02 -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 16:54:49 +0200 Message-Id: <1535122494-30249-2-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535122494-30249-1-git-send-email-tdu@semihalf.com> References: <1535113006-9393-1-git-send-email-tdu@semihalf.com> <1535122494-30249-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH v2 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..fa1a1b8 --- /dev/null +++ b/drivers/common/mvep/rte_common_mvep_version.map @@ -0,0 +1,6 @@ +DPDK_18.08 { + 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 14:54:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Duszynski X-Patchwork-Id: 43873 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 649D45F38; Fri, 24 Aug 2018 16:55:08 +0200 (CEST) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by dpdk.org (Postfix) with ESMTP id 523CC5F2B for ; Fri, 24 Aug 2018 16:55:05 +0200 (CEST) Received: by mail-lf1-f67.google.com with SMTP id c21-v6so6907758lfh.3 for ; Fri, 24 Aug 2018 07:55:05 -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=Rr8XQqSaj7UoEbdE2DpmaUy19I2laBmqxUZ2ot/DQ98=; b=ivREtC8tIL7VDTy/jJ+QSDntraImm6cgiFHcQk7XVgI5yY3xnJ0N62X7r1p0dYSHLP ZIni+Wb8kgFmql68mPfNVrNpYQPWYfKzSi+czt3SsXmmxu4yeewfBc33vAYboJWxLBx+ N1KElnEUszcztYltysv1B7Zpf08S1jtWOTa45JIRTeqkUJJXv5XChuBPSBxM+T50T/X0 SPXyi/hC65zNa+GqNjAGaNeTwT1kqc/17u2YVgEsCu0tOwfgsRRpk/tTOpE1NxVj5Q+t 8kCgpXkij6Caq7tA3mtxeecT6XLtLavhQb6fZKvxOSqbKP00bqy//o2cgjd/aRV5zFzZ P88Q== 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=Rr8XQqSaj7UoEbdE2DpmaUy19I2laBmqxUZ2ot/DQ98=; b=eHUZdVuDQgB+BTQRJZMph2B/lDFVUrWj+ShcKTyFZAUWrpPcAqxJfz02vPEZBnpb4u oVPTbLwxNwyqwBknsLdPxM4vj3bcixTs0sfHqZhmefQSrddBQPhRuV6iiycWRwaeZvud WvKaHEGxoptOC15ZdRK3VnL6HCmSJATSeGzZM9pDCV/kZk3K3DxXLteWDcmAKC1OFlJY p8v/8Q6I8x4LUG7XzdF8F70SOK8PeiP4JAm3F86IG/MW13iXIUBl9GwgRxs1qXsrtQON HdeoJcwiHYyFtMECxyadBrX+cIaY2DdS5hYReTRyiXaprWXdJ4crRx3dXNGNGyB8d9jQ Nj5g== X-Gm-Message-State: APzg51C+56JAg498IyJWAgWCwuW60Es54wJjvKpsfqgid+Oyj+NoWNcn vzOZ/hIiP0Gcp9M1/p6kV9Cq+amiI28= X-Google-Smtp-Source: ANB0VdaWidmZPQ/03Bew8onYux6Ovq+IueKEfqf/D++X0UGMb9F5++iyc5EFgnE9WaTHGo93YjNRYQ== X-Received: by 2002:a19:9710:: with SMTP id z16-v6mr1677431lfd.17.1535122504824; Fri, 24 Aug 2018 07:55:04 -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 j140-v6sm1373659lfg.16.2018.08.24.07.55.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Aug 2018 07:55:03 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com, Liron Himi Date: Fri, 24 Aug 2018 16:54:50 +0200 Message-Id: <1535122494-30249-3-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535122494-30249-1-git-send-email-tdu@semihalf.com> References: <1535113006-9393-1-git-send-email-tdu@semihalf.com> <1535122494-30249-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH v2 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 | 36 +++++++++++++----------------------- 3 files changed, 16 insertions(+), 25 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..7ea8946 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 | \ @@ -2653,24 +2651,17 @@ rte_pmd_mrvl_probe(struct rte_vdev_device *vdev) if (mrvl_dev_num) 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."); - } + MRVL_LOG(INFO, "Perform MUSDK initializations\n"); + + 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; + MRVL_LOG(ERR, "Failed to init PP!\n"); + 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 14:54:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Duszynski X-Patchwork-Id: 43874 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 1D19E5F57; Fri, 24 Aug 2018 16:55:10 +0200 (CEST) Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by dpdk.org (Postfix) with ESMTP id B947E5F34 for ; Fri, 24 Aug 2018 16:55:06 +0200 (CEST) Received: by mail-lf1-f65.google.com with SMTP id e23-v6so6878730lfc.13 for ; Fri, 24 Aug 2018 07:55:06 -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=27kVjXLcn+xnuRXnsBpb6FC4jqCh8tUmyPgN9dHQcAg=; b=bS/0QWC6i3HcHohfg+tq7ieZwVePOVIPtlt2AcdHIqoQch/Ntcs/KJMoUQuPxeTvnK 9Y7YF3IcSFam/pSHgRyl/bRhRitO+aHoOoBK3Tlfoif3EmEBVVNh5DwQHRSG0oHEF8k+ tseeWW6tDUfL+kbCghh+muK5+4nfZWJzMr30Orb+61TG+fJE+JpiY6ZeyDepy1xQMIZp I+YYzY9VmeheYPG+01Hr7UuGxn15kR+UgMhTFYWtqUxFDBH3NU4qDQzpSU94g4QaApPF CDXEGDliyFoAhu6edjhGD5OG8j2no7ZWRYhqtauk/5Rb9siTnKasA8/60Pt6aalEkou2 0aqw== 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=27kVjXLcn+xnuRXnsBpb6FC4jqCh8tUmyPgN9dHQcAg=; b=WCUKQRoQuH1P3e+U8KQ47pYQL9nsVFFaeOCXLyYqntlX+i+0aPwemJ7AdJk1huz/ET oWokNqWy9SMpz8wmLFlIkpODLhCJX4t6LLfNQKhpFkRqW0zL3GUW0nK+/WjJNASi2MrT yj8NC1IteO/lPHUdRcTiNUIl3+dqu8pMkO/2PhrfPhYmrCZOJRqW7zul4ASSb7c2QZp/ MoZazdAjGP+SwjDIE5HPddiCwbufafJy+SK4aC5Um1jlRBas66Lla7undENFyLI90nzr 08/Gu+Ge8883yBEpPXlq5E+rViYgje6ogq1sFABimbHsBBR3u/petKLfkc9iW75Vcyqq /4NQ== X-Gm-Message-State: APzg51BqcAm2NBMQ/XAXmmzXCYgidHfnPvUxnVrnx2YenxB0CzgliS2f KrXVk5Oh8PtnsFJucMwhELxZbXRAo94= X-Google-Smtp-Source: ANB0VdZ2+axFVKAjlnUvNm6ZRCvl95V4EhhtSufYRVbpKtOggB51DCzpXaANk9J/P98YPga/tLBRpw== X-Received: by 2002:a19:b2c8:: with SMTP id t69-v6mr1538948lfk.105.1535122506120; Fri, 24 Aug 2018 07:55:06 -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 j140-v6sm1373659lfg.16.2018.08.24.07.55.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Aug 2018 07:55:05 -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 16:54:51 +0200 Message-Id: <1535122494-30249-4-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535122494-30249-1-git-send-email-tdu@semihalf.com> References: <1535113006-9393-1-git-send-email-tdu@semihalf.com> <1535122494-30249-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH v2 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 7ea8946..60ca6e0 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 14:54:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Duszynski X-Patchwork-Id: 43875 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 952906C9B; Fri, 24 Aug 2018 16:55:12 +0200 (CEST) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by dpdk.org (Postfix) with ESMTP id 1BD745F34 for ; Fri, 24 Aug 2018 16:55:08 +0200 (CEST) Received: by mail-lj1-f193.google.com with SMTP id 203-v6so7075620ljj.13 for ; Fri, 24 Aug 2018 07:55:08 -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=w6e/xE+sHPPmcxtq2vB0tRtnZBIMmzgBR3dInBL8KGTqDRRsVXvhPWeN8ORj3RPtQr W3MskbG3ymME1f3Q+rKz/mO9xJOZTzphXUQHpWum2qVlHmM6VGS2RnbzlQg8+eHc0X7K teFaSZOfN+9b+r/VdsOn3PubaDPeyOWuISSyE5jyUo7Ze8cosJgnPsLo4NIs+D860odB 3Dwu1W+VEoM2qPl+PBt4EGEeV024KfPb6/aZ7zuvM9OTN/rYBlnRkxX43NPhvY6rrnex /JMxredCgDrbwJDDCW4CSq+oTvgng9KBlS1u44XEmSOUn2VnkAQRHyE9mOnsWyO1P1MQ 37vQ== 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=EPiEJrpaHnMr5mgo3NcY75iuZQ+XOgHk9scLtbZ6hPfPN5NKyx2ChpVR068/QJQaUH Gca8ehnblj1sm4moC8dTOnwy7UHuJHwAoToqZjrrbB1nhhCASJAnhR5Iy4PairAZPx2I bAuPmTG8Mlw265pdzxOeyfKq3qKv7Xcn+/kSihzsnDcc/YHKOkX1GQ9rc6XfDVY1a4tV Z47WgmvzOX4WYx8f8JYRPNZmFlKNeVhuY30s2gWqWsLZqGM3pQ6w53wWj2qerxWsudfF gqXV9pXMxEHeFDePJfDuUanMipe00G0i4uO+Vh5jEOxJMinlryXTSpJiTEg2BeM8/MHs +RDQ== X-Gm-Message-State: APzg51CigBiSPWPL9cI2b0vEb5UPCGdBkdQzlweXFT9Rj893D/tiyzcI J19mssb62EE82BtEqvADcAR/F9nzk18= X-Google-Smtp-Source: ANB0Vdb20ChulXA71hf0c1j624JCdc5VawGJFgxo5sulvVqAp2nY6GoGfr0SOmUmw8kniQr9kyfQNw== X-Received: by 2002:a2e:88d0:: with SMTP id a16-v6mr1578926ljk.63.1535122507579; Fri, 24 Aug 2018 07:55:07 -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 j140-v6sm1373659lfg.16.2018.08.24.07.55.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Aug 2018 07:55:06 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com, tdu@semihalf.com Date: Fri, 24 Aug 2018 16:54:52 +0200 Message-Id: <1535122494-30249-5-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535122494-30249-1-git-send-email-tdu@semihalf.com> References: <1535113006-9393-1-git-send-email-tdu@semihalf.com> <1535122494-30249-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH v2 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 14:54:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Duszynski X-Patchwork-Id: 43876 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 14E036CC3; Fri, 24 Aug 2018 16:55:14 +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 11C9D5F34 for ; Fri, 24 Aug 2018 16:55:09 +0200 (CEST) Received: by mail-lf1-f68.google.com with SMTP id j8-v6so6920421lfb.4 for ; Fri, 24 Aug 2018 07:55:09 -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=+ezLhpRVF5U+tAjBCZiE6ooH0HrjSolobZPKeVOd58M=; b=aPYCEUI/QCFHCbHqj9IYbjAkWxWKF0/G06xaQLlhra/TjLjiJgZLihtuOdHWGCVej8 v9FcaQ9W0jefJ9FWXK6gl2cN7jSTiK4mSNGlkEYWvkvc2QlarykacZ8c2Rjt08bR6x7N EcmQQEyg6WgAknC3S3gECGD311LhfEEUf/x+mPRy30S1M/dSRo1xonlnRTsBs3oHwLf8 eYL+IxE8TjaAiOMti5bnJMCzctCLbzOzB4w2US7WCpuRIya/SLyBLlCttq012eMXxxT7 eK9p/le324WZu4lczLfr4b3Bqy4s63+Aj3THw7s0M2UGONmjRvE8elzVhPsOvFAztcx+ 9CDw== 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=+ezLhpRVF5U+tAjBCZiE6ooH0HrjSolobZPKeVOd58M=; b=ZlpJyO8IqMDP+3F+/zhKsxeSIJauWaTxCjaU44RQQrlJKku4ROAnaB4GIibzOpfi98 sJncjPrMBg7W9diXXDuqPf7djnpDDyD1vsc8wkGIbfKxCC4iNfzNvtag4Svlg36V+K+m 4wmOTCB+Fv8x5MALEnT3u1klGtwkvcnspACKarYpO0d0SuyUzw3VWxxfgsymFEJqrMF0 gfqN9E23JIPmhADUfK4vaAGskBNRoVF/OVtdoFgMkEb1wmGAa7O8neMQYbxBGqlsWRON n5y+TnlMJCPlyzGq/D35tXj0szYT/oibid1q7aIZFWHFBPtheDPZ4AnAWaZG63PiUe9U qsxw== X-Gm-Message-State: APzg51BVdCazqeWaF9u1PTtrKiBX64otOlM/O/85Uar8ifb5YGxnM4de IIvRQQD3ZphkMoulIrGsllmp6ZjDplM= X-Google-Smtp-Source: ANB0Vdb0pc9syGJuchaOk/sFbbI79nLmYXNLLB41bBZea1lVFR45nZT3VyAUp2EiGh6m96xRTC5Sog== X-Received: by 2002:ac2:418b:: with SMTP id z11-v6mr1536906lfh.3.1535122508635; Fri, 24 Aug 2018 07:55:08 -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 j140-v6sm1373659lfg.16.2018.08.24.07.55.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Aug 2018 07:55:07 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com Date: Fri, 24 Aug 2018 16:54:53 +0200 Message-Id: <1535122494-30249-6-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535122494-30249-1-git-send-email-tdu@semihalf.com> References: <1535113006-9393-1-git-send-email-tdu@semihalf.com> <1535122494-30249-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH v2 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 60ca6e0..5cd84c1 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 14:54:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomasz Duszynski X-Patchwork-Id: 43877 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 E37EF7CDE; Fri, 24 Aug 2018 16:55:15 +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 821475F72 for ; Fri, 24 Aug 2018 16:55:10 +0200 (CEST) Received: by mail-lj1-f195.google.com with SMTP id f8-v6so7131353ljk.1 for ; Fri, 24 Aug 2018 07:55:10 -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=RiHTFc5IROF+rR74not8nQ52o6A7SWEJIrPv9/aPEEA=; b=pM5rfPcE/CYK6I1KmZeeHvcsU3fGLDccM8ij4M6JQzCEw4UX7zZ41sD4Dzk6coNKqe 8Tootv+LUI1IHc8KYyknbDvhYyjS6/efLEROhq8PBjIb0RIuxnLSQGqS467ZSVRrkfwl s+YPr7o4KjPklC1woMnS1wEMYZGKUfzAV0hHhJgoKk/y+wgoNYPehVcK5NSeVD8PMzQ2 4vurhKeMNZ0O6mDqz9AestdnmqUlk/Ix0uUFwBv3OW8V4zKYycVkvYHEEAKaRy3X5ve/ uXrnFxnz2F7m5COP68La5ueKC25De7RHWWegasFGyaQVrfTVW/Qhd5F0x2sqfDGH9J0Y viuQ== 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=RiHTFc5IROF+rR74not8nQ52o6A7SWEJIrPv9/aPEEA=; b=HK8t49Bq3wCGwaxyeuzTYFk9agQO3V7WUQ4vN749LMCK+MlCMkE/yoKgU5K3p+e8FY gN0+ZGDwB6yyBcjjqC4KpPM/F67mE+xL2Y9Me0qHJv4PpsieRMZB5UnRnb2uNTB0Mum9 6FwtBtFlYj6Dpl9r6cKq3u9hn2BwuNzEZD2d/35vTEUihz2HPB325HfwKWJfwLqnH3Tg 464OucUvghOEO4kRc9L2O19PZL26j5eEwZ79i0GHGy3t4uvzTQPeZZPU5/PWnNmwaX/1 /wf2mzBHhvTqjXc0uZIh4tLaJtfykRk50sfWk1c2b+vz417AbMa5366smKx6UG+yAlCx x8ZQ== X-Gm-Message-State: APzg51Chieoiu+kxhFONsqH13em/AxwEca/NMjHmBW9bGC/BFncH5Xf2 DM5Fzg9p13vDZCxgj1X9tH/Lob818Ps= X-Google-Smtp-Source: ANB0VdZrAbna5KlW8gPvWCi4BZW3deE6ecQGFiZNn3DJtHvQADL3EWGaxoPXQxzsfMOuDzQDS7kLjQ== X-Received: by 2002:a2e:1609:: with SMTP id w9-v6mr1610034ljd.120.1535122509991; Fri, 24 Aug 2018 07:55:09 -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 j140-v6sm1373659lfg.16.2018.08.24.07.55.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 24 Aug 2018 07:55:08 -0700 (PDT) From: Tomasz Duszynski To: dev@dpdk.org Cc: nsamsono@marvell.com, mw@semihalf.com Date: Fri, 24 Aug 2018 16:54:54 +0200 Message-Id: <1535122494-30249-7-git-send-email-tdu@semihalf.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535122494-30249-1-git-send-email-tdu@semihalf.com> References: <1535113006-9393-1-git-send-email-tdu@semihalf.com> <1535122494-30249-1-git-send-email-tdu@semihalf.com> Subject: [dpdk-dev] [PATCH v2 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 5cd84c1..5b92d82 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;