From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0058.outbound.protection.outlook.com [104.47.32.58]) by dpdk.org (Postfix) with ESMTP id 1DE4F1B6D4 for ; Mon, 16 Oct 2017 15:43:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=9bIMATI/FJRqq24t4d/xZUqSL3HIOqHjEI1ROpPZoTY=; b=I+FZpiWHeuWea/hwtg4Ow3wuLDetGz3daj+VJbHNcPlj8RI/OeBogqkP+O0MrPPqy0iP2Ayxg4cVUrl5r5HLdlzqw6/9Syf6DyU33I3jo+KMd0ibZA+mWBMsnk8SNLYs5WXRrU9JpfYiQ4hFH1aU1xENFweEaVmpvQOxKZaCCXo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Santosh.Shukla@cavium.com; Received: from localhost.localdomain (111.93.218.67) by BN6PR07MB3092.namprd07.prod.outlook.com (10.172.105.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Mon, 16 Oct 2017 13:43:55 +0000 From: Santosh Shukla To: dev@dpdk.org Cc: olivier.matz@6wind.com, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, Santosh Shukla Date: Mon, 16 Oct 2017 13:42:46 +0000 Message-Id: <20171016134247.5431-1-santosh.shukla@caviumnetworks.com> X-Mailer: git-send-email 2.13.0 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [111.93.218.67] X-ClientProxiedBy: PN1PR01CA0104.INDPRD01.PROD.OUTLOOK.COM (10.174.144.20) To BN6PR07MB3092.namprd07.prod.outlook.com (10.172.105.10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1cabefcf-9c03-4d80-d281-08d5149bf304 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN6PR07MB3092; X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3092; 3:VzGkKnQtcb7poUEcna4vlXBmP6mc5X0ghlT8GdSfizP2G/Sjs2EDx4fx+ibAUEotxoYF8AMYECQpmJB09XesgGWq+IBgNr3x68Lqii1LYuuEbeZ4Tt/Q0nPosJ5KBGqjX76Ds9BlKJFHP1tIWkEzTLh4rPUztb4fGdQkUqNpVUeJDq2tFdEuBk8Iat64/pkMp+18tiU+gTYoFFNrE7+Z6eJxTybdvSELp4FaaQvBUmOpqNRCBP/wbB/v1q8OUYol; 25:qyZ+Jd++Hlf3TgJqj6AKc3HRPAUISEsWpiAU3kQvX91YppBnX2OC/EIkEVts+Rr8HBsaZrY9mwXgBjLD5akdKTdRJV7+ALNJbohyFJteGqM+KdydoZBlans5wG5kitZYWbTvGSI1K1EFA8i3JYVh31wvHMkGL82B5H2o8yqgWPHa7pvlm4xktyX21o91np7+RhUtlZ640w+j64ZF0hkLsQ4cL5AJoQBttCFoSzu+SfzzaFIEX6qZn++y2z1ZM+3UhqtXOq6eUgZw2nqIRcGbGfYnhsLhazfB9S1AOu9kfsB1ThWSQT01eYmGebjgaqpnxTUhcTB2EWvaihf+az+j+Q==; 31:yneNwpCtve7UGHT/lf6drtn7qaZ5OavmjE+jYir/9fE3CeAfygvCwHPAvQ8N3LUQUQ0CQqEhAn3a1Ki1+qg9OpqDcwMxyDXv4+c3LQnQeP8kphHtfbp0K2tvLehuX4MyyPCZzjphKGVsBlBLpKOJ0EuLAw9Bg4NWgtpqFUDLYb7S8tk6jt0evrgUUHhaeCk0JZcRkTG9VN0D5OuzdkHrcp9zlrQdJBrU7sbo2ueUIpM= X-MS-TrafficTypeDiagnostic: BN6PR07MB3092: X-Microsoft-Exchange-Diagnostics: 1; BN6PR07MB3092; 20:84muw36qomogJdcGHG1iIx3VfAwC0js4HUqkbs0JVHBP2Ie5MPbsgzx4kTUKp4+7zLb2V5uD9+4OfBe3UXN9chh10cHSo3PAa6/uBlpJvOUmnYtSjB5siT+0dyFjbUqZcrKX42LN3wxLCz5aUgDSwcOrOf3U8ZsC7JHDTgUkhmLOI+OOVJq+YN659liwWNl0Ql14EiX0lZGuNGHsu2Wbbj3rSP0cLXELJmjKQCAa4+8Ub6yptIaRZe4Cx07ZKHbpEYHUFaVOXnVSwboWTizI7X/r5UMajQ3GQcqG6Ep51rKVrujWmScogcleFDmcGcJK3578grTRnKqfV1mS2IhBgB/8CMdFlZ8weLDvU8eqJz2+DQw5/YADiTVcXEZGrvHQaMzHyRghxYIQNxu887p6GlgsCwbrP3pRC2tUqxERptZAnHpnuC6Hx2k7WLwybznWwBaAGt9CNNrq8A371rn4bYk3WFLu9zPMD+/Ho396E6HYh+txT5bBRTvFHWmleoH38NChJOtNs9cojW/nqNRUg4Qnv9GLQGG587kmXQ8003VA3soywHaDuwyJBS1y+AQS3I9A8MXjuKoeQ4mV1cK1bfcFSsq8kYWIiO2/FE9qz7Q=; 4:/80HP8sB9eG3dW3o/ofNB3wmxwwxrVNFXY/UOc6B7MjtIUntbLoHF36pSypFuwHt+grq8XVenyWN/ppM85NWtlpzqTI3RTCKyhv1bkTiig8ySfLg3yQrchD7mjMNGKbUzb9/yO2TBeIKW1Wnv4Mkn2SwJoZdvNI5OIjcDT5ifeFz/NKaoyhgo2rOKJo03Uk0Y1c3N0ARp8NKpnr0Tnm5Rx2HFdqd3j5a0jaaD5iK1ZxSLHuWfTRcOCC8N53tX0QwG5ry5SYkydAe+umoF/deIAPCqU55c+JZUaY9XtnRRgI= X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(3002001)(93006095)(10201501046)(100000703101)(100105400095)(6041248)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR07MB3092; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR07MB3092; X-Forefront-PRVS: 0462918D61 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(6069001)(376002)(346002)(199003)(189002)(189998001)(8936002)(50226002)(68736007)(7736002)(305945005)(316002)(97736004)(8676002)(81156014)(81166006)(6916009)(42882006)(6512007)(6306002)(53936002)(478600001)(50986999)(25786009)(16526018)(16586007)(36756003)(107886003)(53376002)(48376002)(4326008)(101416001)(966005)(6666003)(6116002)(106356001)(2351001)(5660300001)(575784001)(1076002)(105586002)(2361001)(33646002)(72206003)(50466002)(2906002)(3846002)(8656003)(5003940100001)(47776003)(5009440100003)(66066001)(6486002)(6506006); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR07MB3092; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR07MB3092; 23:PKPdXlrQXHJKnXWom6ea0kMf6gnzpI+UhyS+YsSji?= =?us-ascii?Q?+NZTvLS2fybBU4wWlBM7prNKfTZOlPZd1bXk740+xnbQ2VZQCRKfbGC/NK1T?= =?us-ascii?Q?ZMsKM7zV3hGiCjaCaTihgEbiMWPFXeadTj9gPuHaQJemFtJKpL3kNKQmVUrX?= =?us-ascii?Q?eRsJJ+Fe4MSVkRCv70u9sx5zD0i6p9dDV/kxr+FIj78x1dQ06Lj9ESbUJ3nQ?= =?us-ascii?Q?o1nFdzyfAZ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b3XUHRnD/qozF7FgXdcMNBD2hbS3RLSKL/Tq7AYi+tMOoUDmekQw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2017 13:43:55.4021 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR07MB3092 Subject: [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool 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: , X-List-Received-Date: Mon, 16 Oct 2017 13:43:59 -0000 Octeontx mempool pmd need mailbox for pool setup. That mailbox was defined at drivers/event/octeontx. So mempool has dependency on event/octeontx driver and commit:8700239f7767 has added make rule which makes sure event/* get build before mempool, but this rule introduces cyclic dependency and may create problem to future feature addition in drivers/Makefile. Same problem noticed and reported in below thread: http://dpdk.org/ml/archives/dev/2017-October/079187.html The patch solves problem by moving mbox definition from drivers/event/octeontx to drivers/mempool/octeontx. Moving mbox files involves below changes: * Renamed ssovf_mbox.[ch] --> octeontx_mbox.[ch] * Renamed ssovf_probe.c --> octeontx_ssovf.c * Introduced pool logger file. * Moved API from rte_pmd_octeontx_ssovf_version.map to rte_mempool_octeontx_version.map. * Respective Makefile changes done in drivers/event/octeontx/Makefile and drivers/mempool/octeontx/Makefile. Fixes: 8700239f7767 ("mempool/octeontx: add build and log infrastructure") Reported-by: Hemant Agrawal Signed-off-by: Santosh Shukla --- drivers/Makefile | 6 +- drivers/event/Makefile | 2 +- drivers/event/octeontx/Makefile | 6 +- .../octeontx/rte_pmd_octeontx_ssovf_version.map | 6 -- drivers/event/octeontx/ssovf_evdev.h | 9 +-- drivers/event/octeontx/ssovf_worker.h | 1 + drivers/mempool/Makefile | 2 +- drivers/mempool/octeontx/Makefile | 10 +--- drivers/mempool/octeontx/octeontx_fpavf.c | 2 +- drivers/mempool/octeontx/octeontx_fpavf.h | 19 +----- .../octeontx/octeontx_mbox.c} | 12 ++-- .../octeontx/octeontx_mbox.h} | 9 ++- drivers/mempool/octeontx/octeontx_pool_logs.h | 68 ++++++++++++++++++++++ .../octeontx/octeontx_ssovf.c} | 30 ++++++---- .../octeontx/rte_mempool_octeontx_version.map | 5 ++ drivers/net/Makefile | 2 +- drivers/net/octeontx/Makefile | 1 - drivers/net/octeontx/base/octeontx_bgx.h | 2 +- drivers/net/octeontx/base/octeontx_pkivf.h | 2 +- 19 files changed, 120 insertions(+), 74 deletions(-) rename drivers/{event/octeontx/ssovf_mbox.c => mempool/octeontx/octeontx_mbox.c} (95%) rename drivers/{event/octeontx/rte_pmd_octeontx_ssovf.h => mempool/octeontx/octeontx_mbox.h} (93%) create mode 100644 drivers/mempool/octeontx/octeontx_pool_logs.h rename drivers/{event/octeontx/ssovf_probe.c => mempool/octeontx/octeontx_ssovf.c} (89%) diff --git a/drivers/Makefile b/drivers/Makefile index 3a5b22342..0467250aa 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -32,13 +32,13 @@ include $(RTE_SDK)/mk/rte.vars.mk DIRS-y += bus -DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event -DEPDIRS-event := bus DIRS-y += mempool -DEPDIRS-mempool := bus event +DEPDIRS-mempool := bus DIRS-y += net DEPDIRS-net := bus mempool DIRS-$(CONFIG_RTE_LIBRTE_CRYPTODEV) += crypto DEPDIRS-crypto := bus mempool +DIRS-$(CONFIG_RTE_LIBRTE_EVENTDEV) += event +DEPDIRS-event := bus mempool include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/event/Makefile b/drivers/event/Makefile index 3f6b8988a..d09be74da 100644 --- a/drivers/event/Makefile +++ b/drivers/event/Makefile @@ -38,7 +38,7 @@ DEPDIRS-skeleton = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_PMD_SW_EVENTDEV) += sw DEPDIRS-sw = $(core-libs) librte_kvargs librte_ring DIRS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += octeontx -DEPDIRS-octeontx = $(core-libs) +DEPDIRS-octeontx = $(core-libs) librte_mempool_octeontx DIRS-$(CONFIG_RTE_LIBRTE_PMD_DPAA2_EVENTDEV) += dpaa2 DEPDIRS-dpaa2 = $(core-libs) librte_bus_fslmc diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile index e5661ca82..50434a384 100644 --- a/drivers/event/octeontx/Makefile +++ b/drivers/event/octeontx/Makefile @@ -38,6 +38,7 @@ include $(RTE_SDK)/mk/rte.vars.mk LIB = librte_pmd_octeontx_ssovf.a CFLAGS += $(WERROR_FLAGS) +CFLAGS += -I$(RTE_SDK)/drivers/mempool/octeontx/ EXPORT_MAP := rte_pmd_octeontx_ssovf_version.map @@ -48,8 +49,6 @@ LIBABIVER := 1 # SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_worker.c SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_evdev.c -SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_probe.c -SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_mbox.c ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y) CFLAGS_ssovf_worker.o += -fno-prefetch-loop-arrays @@ -64,7 +63,4 @@ else CFLAGS_ssovf_worker.o += -Ofast endif -# install this header file -SYMLINK-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF)-include := rte_pmd_octeontx_ssovf.h - include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/event/octeontx/rte_pmd_octeontx_ssovf_version.map b/drivers/event/octeontx/rte_pmd_octeontx_ssovf_version.map index 3810a03f3..5352e7e3b 100644 --- a/drivers/event/octeontx/rte_pmd_octeontx_ssovf_version.map +++ b/drivers/event/octeontx/rte_pmd_octeontx_ssovf_version.map @@ -1,9 +1,3 @@ DPDK_17.05 { - global: - - octeontx_ssovf_info; - octeontx_ssovf_bar; - octeontx_ssovf_mbox_send; - local: *; }; diff --git a/drivers/event/octeontx/ssovf_evdev.h b/drivers/event/octeontx/ssovf_evdev.h index 1cdc81047..933c5a365 100644 --- a/drivers/event/octeontx/ssovf_evdev.h +++ b/drivers/event/octeontx/ssovf_evdev.h @@ -37,7 +37,7 @@ #include #include -#include "rte_pmd_octeontx_ssovf.h" +#include #define EVENTDEV_NAME_OCTEONTX_PMD event_octeontx @@ -58,10 +58,6 @@ RTE_LOG(ERR, EVENTDEV, "[%s] %s() " fmt "\n", \ RTE_STR(EVENTDEV_NAME_OCTEONTX_PMD), __func__, ## args) -#define PCI_VENDOR_ID_CAVIUM 0x177D -#define PCI_DEVICE_ID_OCTEONTX_SSOGRP_VF 0xA04B -#define PCI_DEVICE_ID_OCTEONTX_SSOWS_VF 0xA04D - #define SSO_MAX_VHGRP (64) #define SSO_MAX_VHWS (32) @@ -76,7 +72,6 @@ #define SSO_VHGRP_XAQ_CNT (0x1B0ULL) #define SSO_VHGRP_AQ_CNT (0x1C0ULL) #define SSO_VHGRP_AQ_THR (0x1E0ULL) -#define SSO_VHGRP_PF_MBOX(x) (0x200ULL | ((x) << 3)) /* BAR2 */ #define SSO_VHGRP_OP_ADD_WORK0 (0x00ULL) @@ -107,8 +102,6 @@ #define SSOW_VHWS_OP_GET_WORK0 (0x80000ULL) #define SSOW_VHWS_OP_GET_WORK1 (0x80008ULL) -#define SSOW_BAR4_LEN (64 * 1024) - /* Mailbox message constants */ #define SSO_COPROC 0x2 diff --git a/drivers/event/octeontx/ssovf_worker.h b/drivers/event/octeontx/ssovf_worker.h index 55f72555a..8dc1264ab 100644 --- a/drivers/event/octeontx/ssovf_worker.h +++ b/drivers/event/octeontx/ssovf_worker.h @@ -35,6 +35,7 @@ #include #include "ssovf_evdev.h" +#include enum { SSO_SYNC_ORDERED, diff --git a/drivers/mempool/Makefile b/drivers/mempool/Makefile index 18cbaa293..ce5d02cf7 100644 --- a/drivers/mempool/Makefile +++ b/drivers/mempool/Makefile @@ -41,6 +41,6 @@ DEPDIRS-ring = $(core-libs) DIRS-$(CONFIG_RTE_DRIVER_MEMPOOL_STACK) += stack DEPDIRS-stack = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL) += octeontx -DEPDIRS-octeontx = $(core-libs) librte_pmd_octeontx_ssovf +DEPDIRS-octeontx = $(core-libs) include $(RTE_SDK)/mk/rte.subdir.mk diff --git a/drivers/mempool/octeontx/Makefile b/drivers/mempool/octeontx/Makefile index 0b2043842..f2fa22b9b 100644 --- a/drivers/mempool/octeontx/Makefile +++ b/drivers/mempool/octeontx/Makefile @@ -36,13 +36,7 @@ include $(RTE_SDK)/mk/rte.vars.mk # LIB = librte_mempool_octeontx.a -ifeq ($(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL_DEBUG),y) -CFLAGS += -O0 -g -else -CFLAGS += -O3 CFLAGS += $(WERROR_FLAGS) -endif - EXPORT_MAP := rte_mempool_octeontx_version.map LIBABIVER := 1 @@ -50,6 +44,8 @@ LIBABIVER := 1 # # all source are stored in SRCS-y # +SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL) += octeontx_ssovf.c +SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL) += octeontx_mbox.c SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL) += octeontx_fpavf.c SRCS-$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL) += rte_mempool_octeontx.c @@ -69,6 +65,4 @@ endif # this lib depends upon: DEPDIRS-$(CONFIG_RTE_LIBRTE_OCTEONTX_MEMPOOL) += lib/librte_mbuf -LDLIBS += -lrte_pmd_octeontx_ssovf - include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/mempool/octeontx/octeontx_fpavf.c b/drivers/mempool/octeontx/octeontx_fpavf.c index 8d5c2a689..3c441fd3e 100644 --- a/drivers/mempool/octeontx/octeontx_fpavf.c +++ b/drivers/mempool/octeontx/octeontx_fpavf.c @@ -48,7 +48,7 @@ #include #include -#include +#include "octeontx_mbox.h" #include "octeontx_fpavf.h" /* FPA Mbox Message */ diff --git a/drivers/mempool/octeontx/octeontx_fpavf.h b/drivers/mempool/octeontx/octeontx_fpavf.h index 7a39cd22c..1d09f0079 100644 --- a/drivers/mempool/octeontx/octeontx_fpavf.h +++ b/drivers/mempool/octeontx/octeontx_fpavf.h @@ -33,25 +33,8 @@ #ifndef __OCTEONTX_FPAVF_H__ #define __OCTEONTX_FPAVF_H__ -#include #include - -#ifdef RTE_LIBRTE_OCTEONTX_MEMPOOL_DEBUG -#define fpavf_log_info(fmt, args...) \ - RTE_LOG(INFO, PMD, "%s() line %u: " fmt "\n", \ - __func__, __LINE__, ## args) -#define fpavf_log_dbg(fmt, args...) \ - RTE_LOG(DEBUG, PMD, "%s() line %u: " fmt "\n", \ - __func__, __LINE__, ## args) -#else -#define fpavf_log_info(fmt, args...) -#define fpavf_log_dbg(fmt, args...) -#endif - -#define fpavf_func_trace fpavf_log_dbg -#define fpavf_log_err(fmt, args...) \ - RTE_LOG(ERR, PMD, "%s() line %u: " fmt "\n", \ - __func__, __LINE__, ## args) +#include "octeontx_pool_logs.h" /* fpa pool Vendor ID and Device ID */ #define PCI_VENDOR_ID_CAVIUM 0x177D diff --git a/drivers/event/octeontx/ssovf_mbox.c b/drivers/mempool/octeontx/octeontx_mbox.c similarity index 95% rename from drivers/event/octeontx/ssovf_mbox.c rename to drivers/mempool/octeontx/octeontx_mbox.c index 9ed417d1a..9525da1aa 100644 --- a/drivers/event/octeontx/ssovf_mbox.c +++ b/drivers/mempool/octeontx/octeontx_mbox.c @@ -38,10 +38,11 @@ #include #include -#include "ssovf_evdev.h" +#include "octeontx_mbox.h" +#include "octeontx_pool_logs.h" /* Mbox operation timeout in seconds */ -#define MBOX_WAIT_TIME_SEC 3 +#define MBOX_WAIT_TIME_SEC 3 #define MAX_RAM_MBOX_LEN ((SSOW_BAR4_LEN >> 1) - 8 /* Mbox header */) /* Mbox channel state */ @@ -87,7 +88,6 @@ struct mbox_ram_hdr { }; }; - static inline void mbox_msgcpy(uint8_t *d, const uint8_t *s, uint16_t size) { @@ -181,7 +181,7 @@ mbox_wait_response(struct mbox *m, struct octeontx_mbox_hdr *hdr, return len; error: - ssovf_log_err("Failed to send mbox(%d/%d) coproc=%d msg=%d ret=(%d,%d)", + mbox_log_err("Failed to send mbox(%d/%d) coproc=%d msg=%d ret=(%d,%d)", m->tag_own, rx_hdr.tag, hdr->coproc, hdr->msg, res, hdr->res_code); return res; @@ -195,7 +195,7 @@ mbox_send(struct mbox *m, struct octeontx_mbox_hdr *hdr, const void *txmsg, if (m->init_once == 0 || hdr == NULL || txsize > MAX_RAM_MBOX_LEN || rxsize > MAX_RAM_MBOX_LEN) { - ssovf_log_err("Invalid init_once=%d hdr=%p txsz=%d rxsz=%d", + mbox_log_err("Invalid init_once=%d hdr=%p txsz=%d rxsz=%d", m->init_once, hdr, txsize, rxsize); return res; } @@ -219,7 +219,7 @@ mbox_setup(struct mbox *m) m->reg += SSO_VHGRP_PF_MBOX(1); if (m->ram_mbox_base == NULL || m->reg == NULL) { - ssovf_log_err("Invalid ram_mbox_base=%p or reg=%p", + mbox_log_err("Invalid ram_mbox_base=%p or reg=%p", m->ram_mbox_base, m->reg); return -EINVAL; } diff --git a/drivers/event/octeontx/rte_pmd_octeontx_ssovf.h b/drivers/mempool/octeontx/octeontx_mbox.h similarity index 93% rename from drivers/event/octeontx/rte_pmd_octeontx_ssovf.h rename to drivers/mempool/octeontx/octeontx_mbox.h index ba6d51422..49f38257e 100644 --- a/drivers/event/octeontx/rte_pmd_octeontx_ssovf.h +++ b/drivers/mempool/octeontx/octeontx_mbox.h @@ -30,11 +30,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef __RTE_PMD_OCTEONTX_SSOVF_H__ -#define __RTE_PMD_OCTEONTX_SSOVF_H__ +#ifndef __OCTEONTX_MBOX_H__ +#define __OCTEONTX_MBOX_H__ #include +#define SSOW_BAR4_LEN (64 * 1024) +#define SSO_VHGRP_PF_MBOX(x) (0x200ULL | ((x) << 3)) + struct octeontx_ssovf_info { uint16_t domain; /* Domain id */ uint8_t total_ssovfs; /* Total sso groups available in domain */ @@ -58,4 +61,4 @@ void *octeontx_ssovf_bar(enum octeontx_ssovf_type, uint8_t id, uint8_t bar); int octeontx_ssovf_mbox_send(struct octeontx_mbox_hdr *hdr, void *txdata, uint16_t txlen, void *rxdata, uint16_t rxlen); -#endif /* __RTE_PMD_OCTEONTX_SSOVF_H__ */ +#endif /* __OCTEONTX_MBOX_H__ */ diff --git a/drivers/mempool/octeontx/octeontx_pool_logs.h b/drivers/mempool/octeontx/octeontx_pool_logs.h new file mode 100644 index 000000000..58ccb0f0e --- /dev/null +++ b/drivers/mempool/octeontx/octeontx_pool_logs.h @@ -0,0 +1,68 @@ +/* + * BSD LICENSE + * + * Copyright (C) 2017 Cavium Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Cavium networks nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#ifndef __OCTEONTX_POOL_LOGS_H__ +#define __OCTEONTX_POOL_LOGS_H__ + +#include + +#ifdef RTE_LIBRTE_OCTEONTX_MEMPOOL_DEBUG +#define fpavf_log_info(fmt, args...) \ + RTE_LOG(INFO, PMD, "%s() line %u: " fmt "\n", \ + __func__, __LINE__, ## args) +#define fpavf_log_dbg(fmt, args...) \ + RTE_LOG(DEBUG, PMD, "%s() line %u: " fmt "\n", \ + __func__, __LINE__, ## args) + +#define mbox_log_info(fmt, args...) \ + RTE_LOG(INFO, PMD, "%s() line %u: " fmt "\n", \ + __func__, __LINE__, ## args) +#define mbox_log_dbg(fmt, args...) \ + RTE_LOG(DEBUG, PMD, "%s() line %u: " fmt "\n", \ + __func__, __LINE__, ## args) +#else +#define fpavf_log_info(fmt, args...) +#define fpavf_log_dbg(fmt, args...) +#define mbox_log_info(fmt, args...) +#define mbox_log_dbg(fmt, args...) +#endif + +#define fpavf_func_trace fpavf_log_dbg +#define fpavf_log_err(fmt, args...) \ + RTE_LOG(ERR, PMD, "%s() line %u: " fmt "\n", \ + __func__, __LINE__, ## args) +#define mbox_func_trace mbox_log_dbg +#define mbox_log_err(fmt, args...) \ + RTE_LOG(ERR, PMD, "%s() line %u: " fmt "\n", \ + __func__, __LINE__, ## args) + +#endif /* __OCTEONTX_POOL_LOGS_H__*/ diff --git a/drivers/event/octeontx/ssovf_probe.c b/drivers/mempool/octeontx/octeontx_ssovf.c similarity index 89% rename from drivers/event/octeontx/ssovf_probe.c rename to drivers/mempool/octeontx/octeontx_ssovf.c index e1c0c6d50..9953b2eac 100644 --- a/drivers/event/octeontx/ssovf_probe.c +++ b/drivers/mempool/octeontx/octeontx_ssovf.c @@ -36,7 +36,17 @@ #include #include -#include "ssovf_evdev.h" +#include "octeontx_mbox.h" +#include "octeontx_pool_logs.h" + +#define PCI_VENDOR_ID_CAVIUM 0x177D +#define PCI_DEVICE_ID_OCTEONTX_SSOGRP_VF 0xA04B +#define PCI_DEVICE_ID_OCTEONTX_SSOWS_VF 0xA04D + +#define SSO_MAX_VHGRP (64) +#define SSO_MAX_VHWS (32) + +#define SSO_VHGRP_AQ_THR (0x1E0ULL) struct ssovf_res { uint16_t domain; @@ -86,7 +96,7 @@ octeontx_ssovf_info(struct octeontx_ssovf_info *info) if (sdev.grp[i].vfid != i || sdev.grp[i].bar0 == NULL || sdev.grp[i].domain != domain) { - ssovf_log_err("GRP error, vfid=%d/%d domain=%d/%d %p", + mbox_log_err("GRP error, vfid=%d/%d domain=%d/%d %p", i, sdev.grp[i].vfid, domain, sdev.grp[i].domain, sdev.grp[i].bar0); @@ -99,7 +109,7 @@ octeontx_ssovf_info(struct octeontx_ssovf_info *info) if (sdev.hws[i].vfid != i || sdev.hws[i].bar0 == NULL || sdev.hws[i].domain != domain) { - ssovf_log_err("HWS error, vfid=%d/%d domain=%d/%d %p", + mbox_log_err("HWS error, vfid=%d/%d domain=%d/%d %p", i, sdev.hws[i].vfid, domain, sdev.hws[i].domain, sdev.hws[i].bar0); @@ -169,7 +179,7 @@ ssowvf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) if (pci_dev->mem_resource[0].addr == NULL || pci_dev->mem_resource[2].addr == NULL || pci_dev->mem_resource[4].addr == NULL) { - ssovf_log_err("Empty bars %p %p %p", + mbox_log_err("Empty bars %p %p %p", pci_dev->mem_resource[0].addr, pci_dev->mem_resource[2].addr, pci_dev->mem_resource[4].addr); @@ -177,7 +187,7 @@ ssowvf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) } if (pci_dev->mem_resource[4].len != SSOW_BAR4_LEN) { - ssovf_log_err("Bar4 len mismatch %d != %d", + mbox_log_err("Bar4 len mismatch %d != %d", SSOW_BAR4_LEN, (int)pci_dev->mem_resource[4].len); return -EINVAL; } @@ -185,7 +195,7 @@ ssowvf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) id = pci_dev->mem_resource[4].addr; vfid = id->vfid; if (vfid >= SSO_MAX_VHWS) { - ssovf_log_err("Invalid vfid(%d/%d)", vfid, SSO_MAX_VHWS); + mbox_log_err("Invalid vfid(%d/%d)", vfid, SSO_MAX_VHWS); return -EINVAL; } @@ -198,7 +208,7 @@ ssowvf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) sdev.total_ssowvfs++; rte_wmb(); - ssovf_log_dbg("Domain=%d hws=%d total_ssowvfs=%d", res->domain, + mbox_log_dbg("Domain=%d hws=%d total_ssowvfs=%d", res->domain, res->vfid, sdev.total_ssowvfs); return 0; } @@ -239,7 +249,7 @@ ssovf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) if (pci_dev->mem_resource[0].addr == NULL || pci_dev->mem_resource[2].addr == NULL) { - ssovf_log_err("Empty bars %p %p", + mbox_log_err("Empty bars %p %p", pci_dev->mem_resource[0].addr, pci_dev->mem_resource[2].addr); return -ENODEV; @@ -252,7 +262,7 @@ ssovf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) rte_write64((1ULL << 33) - 1, idreg); vfid = (val >> 16) & 0xffff; if (vfid >= SSO_MAX_VHGRP) { - ssovf_log_err("Invalid vfid (%d/%d)", vfid, SSO_MAX_VHGRP); + mbox_log_err("Invalid vfid (%d/%d)", vfid, SSO_MAX_VHGRP); return -EINVAL; } @@ -264,7 +274,7 @@ ssovf_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) sdev.total_ssovfs++; rte_wmb(); - ssovf_log_dbg("Domain=%d group=%d total_ssovfs=%d", res->domain, + mbox_log_dbg("Domain=%d group=%d total_ssovfs=%d", res->domain, res->vfid, sdev.total_ssovfs); return 0; } diff --git a/drivers/mempool/octeontx/rte_mempool_octeontx_version.map b/drivers/mempool/octeontx/rte_mempool_octeontx_version.map index a70bd197b..fe8cdeca0 100644 --- a/drivers/mempool/octeontx/rte_mempool_octeontx_version.map +++ b/drivers/mempool/octeontx/rte_mempool_octeontx_version.map @@ -1,4 +1,9 @@ DPDK_17.11 { + global: + + octeontx_ssovf_info; + octeontx_ssovf_bar; + octeontx_ssovf_mbox_send; local: *; }; diff --git a/drivers/net/Makefile b/drivers/net/Makefile index 5d2ad2f8a..012af881a 100644 --- a/drivers/net/Makefile +++ b/drivers/net/Makefile @@ -84,7 +84,7 @@ DEPDIRS-bnxt = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_PMD_NULL) += null DEPDIRS-null = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_OCTEONTX_PMD) += octeontx -DEPDIRS-octeontx = $(core-libs) librte_eventdev librte_pmd_octeontx_ssovf +DEPDIRS-octeontx = $(core-libs) librte_mempool_octeontx librte_eventdev DIRS-$(CONFIG_RTE_LIBRTE_PMD_PCAP) += pcap DEPDIRS-pcap = $(core-libs) DIRS-$(CONFIG_RTE_LIBRTE_QEDE_PMD) += qede diff --git a/drivers/net/octeontx/Makefile b/drivers/net/octeontx/Makefile index 4d6c67c54..827319de5 100644 --- a/drivers/net/octeontx/Makefile +++ b/drivers/net/octeontx/Makefile @@ -62,6 +62,5 @@ endif CFLAGS_octeontx_rxtx.o += -O3 -Ofast LDLIBS += -lrte_eventdev -LDLIBS += -lrte_pmd_octeontx_ssovf include $(RTE_SDK)/mk/rte.lib.mk diff --git a/drivers/net/octeontx/base/octeontx_bgx.h b/drivers/net/octeontx/base/octeontx_bgx.h index 02aa7e6f4..f740a1d99 100644 --- a/drivers/net/octeontx/base/octeontx_bgx.h +++ b/drivers/net/octeontx/base/octeontx_bgx.h @@ -36,7 +36,7 @@ #include #include -#include +#include #define OCTEONTX_BGX_COPROC 6 diff --git a/drivers/net/octeontx/base/octeontx_pkivf.h b/drivers/net/octeontx/base/octeontx_pkivf.h index b6e9edc6a..7cf8332c5 100644 --- a/drivers/net/octeontx/base/octeontx_pkivf.h +++ b/drivers/net/octeontx/base/octeontx_pkivf.h @@ -35,7 +35,7 @@ #include -#include +#include #define OCTEONTX_PKI_COPROC 5 -- 2.13.0