* [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool
@ 2017-10-16 13:42 Santosh Shukla
2017-10-16 13:42 ` [dpdk-dev] [PATCH v1 2/2] event/octeontx: bump library version Santosh Shukla
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Santosh Shukla @ 2017-10-16 13:42 UTC (permalink / raw)
To: dev; +Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal, Santosh Shukla
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 <hemant.agrawal@nxp.com>
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
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 <rte_eventdev_pmd_vdev.h>
#include <rte_io.h>
-#include "rte_pmd_octeontx_ssovf.h"
+#include <octeontx_mbox.h>
#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 <rte_branch_prediction.h>
#include "ssovf_evdev.h"
+#include <octeontx_mbox.h>
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 <rte_spinlock.h>
#include <rte_mbuf.h>
-#include <rte_pmd_octeontx_ssovf.h>
+#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 <rte_debug.h>
#include <rte_io.h>
-
-#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 <rte_io.h>
#include <rte_spinlock.h>
-#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 <rte_common.h>
+#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 <rte_debug.h>
+
+#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 <rte_io.h>
#include <rte_pci.h>
-#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 <stddef.h>
#include <stdint.h>
-#include <rte_pmd_octeontx_ssovf.h>
+#include <octeontx_mbox.h>
#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 <stdint.h>
-#include <rte_pmd_octeontx_ssovf.h>
+#include <octeontx_mbox.h>
#define OCTEONTX_PKI_COPROC 5
--
2.13.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v1 2/2] event/octeontx: bump library version
2017-10-16 13:42 [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool Santosh Shukla
@ 2017-10-16 13:42 ` Santosh Shukla
2017-10-17 9:50 ` Hemant Agrawal
2017-10-23 14:38 ` Thomas Monjalon
2017-10-17 9:49 ` [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool Hemant Agrawal
` (2 subsequent siblings)
3 siblings, 2 replies; 8+ messages in thread
From: Santosh Shukla @ 2017-10-16 13:42 UTC (permalink / raw)
To: dev; +Cc: olivier.matz, thomas, jerin.jacob, hemant.agrawal, Santosh Shukla
This commit bumps the library version to reflect the ABI change
caused by removing the below function from event/octeontx:
* octeontx_ssovf_info
* octeontx_ssovf_bar
* octeontx_ssovf_mbox_send
And moved to mempool/octeontx area.
Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
---
doc/guides/rel_notes/release_17_11.rst | 1 +
drivers/event/octeontx/Makefile | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
index 8db35f5e4..eac2f677a 100644
--- a/doc/guides/rel_notes/release_17_11.rst
+++ b/doc/guides/rel_notes/release_17_11.rst
@@ -377,6 +377,7 @@ The libraries prepended with a plus sign were incremented in this version.
librte_table.so.2
librte_timer.so.1
librte_vhost.so.3
+ librte_pmd_octeontx_ssovf.so.2
Tested Platforms
diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile
index 50434a384..08fc16775 100644
--- a/drivers/event/octeontx/Makefile
+++ b/drivers/event/octeontx/Makefile
@@ -42,7 +42,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/mempool/octeontx/
EXPORT_MAP := rte_pmd_octeontx_ssovf_version.map
-LIBABIVER := 1
+LIBABIVER := 2
#
# all source are stored in SRCS-y
--
2.13.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool
2017-10-16 13:42 [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool Santosh Shukla
2017-10-16 13:42 ` [dpdk-dev] [PATCH v1 2/2] event/octeontx: bump library version Santosh Shukla
@ 2017-10-17 9:49 ` Hemant Agrawal
2017-10-21 9:51 ` Jerin Jacob
2017-10-18 4:46 ` Pavan Nikhilesh Bhagavatula
2017-10-23 14:50 ` Thomas Monjalon
3 siblings, 1 reply; 8+ messages in thread
From: Hemant Agrawal @ 2017-10-17 9:49 UTC (permalink / raw)
To: Santosh Shukla, dev; +Cc: olivier.matz, thomas, jerin.jacob
Thanks! this patch solves the issue.
Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
On 10/16/2017 7:12 PM, Santosh Shukla wrote:
> 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 <hemant.agrawal@nxp.com>
> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> ---
> 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 <rte_eventdev_pmd_vdev.h>
> #include <rte_io.h>
>
> -#include "rte_pmd_octeontx_ssovf.h"
> +#include <octeontx_mbox.h>
>
> #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 <rte_branch_prediction.h>
>
> #include "ssovf_evdev.h"
> +#include <octeontx_mbox.h>
>
> 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 <rte_spinlock.h>
> #include <rte_mbuf.h>
>
> -#include <rte_pmd_octeontx_ssovf.h>
> +#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 <rte_debug.h>
> #include <rte_io.h>
> -
> -#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 <rte_io.h>
> #include <rte_spinlock.h>
>
> -#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 <rte_common.h>
>
> +#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 <rte_debug.h>
> +
> +#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 <rte_io.h>
> #include <rte_pci.h>
>
> -#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 <stddef.h>
> #include <stdint.h>
>
> -#include <rte_pmd_octeontx_ssovf.h>
> +#include <octeontx_mbox.h>
>
> #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 <stdint.h>
>
> -#include <rte_pmd_octeontx_ssovf.h>
> +#include <octeontx_mbox.h>
>
> #define OCTEONTX_PKI_COPROC 5
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v1 2/2] event/octeontx: bump library version
2017-10-16 13:42 ` [dpdk-dev] [PATCH v1 2/2] event/octeontx: bump library version Santosh Shukla
@ 2017-10-17 9:50 ` Hemant Agrawal
2017-10-23 14:38 ` Thomas Monjalon
1 sibling, 0 replies; 8+ messages in thread
From: Hemant Agrawal @ 2017-10-17 9:50 UTC (permalink / raw)
To: Santosh Shukla, dev; +Cc: olivier.matz, thomas, jerin.jacob
On 10/16/2017 7:12 PM, Santosh Shukla wrote:
> This commit bumps the library version to reflect the ABI change
> caused by removing the below function from event/octeontx:
> * octeontx_ssovf_info
> * octeontx_ssovf_bar
> * octeontx_ssovf_mbox_send
>
> And moved to mempool/octeontx area.
>
> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> ---
> doc/guides/rel_notes/release_17_11.rst | 1 +
> drivers/event/octeontx/Makefile | 2 +-
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
> index 8db35f5e4..eac2f677a 100644
> --- a/doc/guides/rel_notes/release_17_11.rst
> +++ b/doc/guides/rel_notes/release_17_11.rst
> @@ -377,6 +377,7 @@ The libraries prepended with a plus sign were incremented in this version.
> librte_table.so.2
> librte_timer.so.1
> librte_vhost.so.3
> + librte_pmd_octeontx_ssovf.so.2
>
>
> Tested Platforms
> diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile
> index 50434a384..08fc16775 100644
> --- a/drivers/event/octeontx/Makefile
> +++ b/drivers/event/octeontx/Makefile
> @@ -42,7 +42,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/mempool/octeontx/
>
> EXPORT_MAP := rte_pmd_octeontx_ssovf_version.map
>
> -LIBABIVER := 1
> +LIBABIVER := 2
>
> #
> # all source are stored in SRCS-y
>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool
2017-10-16 13:42 [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool Santosh Shukla
2017-10-16 13:42 ` [dpdk-dev] [PATCH v1 2/2] event/octeontx: bump library version Santosh Shukla
2017-10-17 9:49 ` [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool Hemant Agrawal
@ 2017-10-18 4:46 ` Pavan Nikhilesh Bhagavatula
2017-10-23 14:50 ` Thomas Monjalon
3 siblings, 0 replies; 8+ messages in thread
From: Pavan Nikhilesh Bhagavatula @ 2017-10-18 4:46 UTC (permalink / raw)
To: Santosh Shukla, jerin.jacob; +Cc: dev
On Mon, Oct 16, 2017 at 01:42:46PM +0000, Santosh Shukla wrote:
> 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 <hemant.agrawal@nxp.com>
> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> ---
> 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 <rte_eventdev_pmd_vdev.h>
> #include <rte_io.h>
>
> -#include "rte_pmd_octeontx_ssovf.h"
> +#include <octeontx_mbox.h>
>
> #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 <rte_branch_prediction.h>
>
> #include "ssovf_evdev.h"
> +#include <octeontx_mbox.h>
>
> 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 <rte_spinlock.h>
> #include <rte_mbuf.h>
>
> -#include <rte_pmd_octeontx_ssovf.h>
> +#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 <rte_debug.h>
> #include <rte_io.h>
> -
> -#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 <rte_io.h>
> #include <rte_spinlock.h>
>
> -#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 <rte_common.h>
>
> +#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 <rte_debug.h>
> +
> +#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 <rte_io.h>
> #include <rte_pci.h>
>
> -#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 <stddef.h>
> #include <stdint.h>
>
> -#include <rte_pmd_octeontx_ssovf.h>
> +#include <octeontx_mbox.h>
>
> #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 <stdint.h>
>
> -#include <rte_pmd_octeontx_ssovf.h>
> +#include <octeontx_mbox.h>
>
> #define OCTEONTX_PKI_COPROC 5
>
> --
> 2.13.0
>
Reviewed-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool
2017-10-17 9:49 ` [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool Hemant Agrawal
@ 2017-10-21 9:51 ` Jerin Jacob
0 siblings, 0 replies; 8+ messages in thread
From: Jerin Jacob @ 2017-10-21 9:51 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: Santosh Shukla, dev, olivier.matz, thomas
-----Original Message-----
> Date: Tue, 17 Oct 2017 15:19:26 +0530
> From: Hemant Agrawal <hemant.agrawal@nxp.com>
> To: Santosh Shukla <santosh.shukla@caviumnetworks.com>, dev@dpdk.org
> CC: olivier.matz@6wind.com, thomas@monjalon.net,
> jerin.jacob@caviumnetworks.com
> Subject: Re: [PATCH v1 1/2] mempool/octeontx: move mbox from event to
> mempool
> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101
> Thunderbird/45.8.0
>
> Thanks! this patch solves the issue.
>
> Tested-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Thomas,
Can you merge this patch to master if there are no more review comments?
NXP's Eventdev Rx adapter patch is blocked on this. I would like pull
NXP's Eventdev Rx adapter series for RC2(It has dependency on this series
to be in master)
http://dpdk.org/dev/patchwork/project/dpdk/list/?submitter=Nipun
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v1 2/2] event/octeontx: bump library version
2017-10-16 13:42 ` [dpdk-dev] [PATCH v1 2/2] event/octeontx: bump library version Santosh Shukla
2017-10-17 9:50 ` Hemant Agrawal
@ 2017-10-23 14:38 ` Thomas Monjalon
1 sibling, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2017-10-23 14:38 UTC (permalink / raw)
To: Santosh Shukla; +Cc: dev, olivier.matz, jerin.jacob, hemant.agrawal
This change is rejected because this PMD has no API/ABI.
16/10/2017 15:42, Santosh Shukla:
> This commit bumps the library version to reflect the ABI change
> caused by removing the below function from event/octeontx:
> * octeontx_ssovf_info
> * octeontx_ssovf_bar
> * octeontx_ssovf_mbox_send
>
> And moved to mempool/octeontx area.
>
> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
> ---
> doc/guides/rel_notes/release_17_11.rst | 1 +
> drivers/event/octeontx/Makefile | 2 +-
> 2 files changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst
> index 8db35f5e4..eac2f677a 100644
> --- a/doc/guides/rel_notes/release_17_11.rst
> +++ b/doc/guides/rel_notes/release_17_11.rst
> @@ -377,6 +377,7 @@ The libraries prepended with a plus sign were incremented in this version.
> librte_table.so.2
> librte_timer.so.1
> librte_vhost.so.3
> + librte_pmd_octeontx_ssovf.so.2
>
>
> Tested Platforms
> diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile
> index 50434a384..08fc16775 100644
> --- a/drivers/event/octeontx/Makefile
> +++ b/drivers/event/octeontx/Makefile
> @@ -42,7 +42,7 @@ CFLAGS += -I$(RTE_SDK)/drivers/mempool/octeontx/
>
> EXPORT_MAP := rte_pmd_octeontx_ssovf_version.map
>
> -LIBABIVER := 1
> +LIBABIVER := 2
>
> #
> # all source are stored in SRCS-y
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool
2017-10-16 13:42 [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool Santosh Shukla
` (2 preceding siblings ...)
2017-10-18 4:46 ` Pavan Nikhilesh Bhagavatula
@ 2017-10-23 14:50 ` Thomas Monjalon
3 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2017-10-23 14:50 UTC (permalink / raw)
To: Santosh Shukla; +Cc: dev, olivier.matz, jerin.jacob, hemant.agrawal
16/10/2017 15:42, Santosh Shukla:
> 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 <hemant.agrawal@nxp.com>
> Signed-off-by: Santosh Shukla <santosh.shukla@caviumnetworks.com>
There is a 32-bit compilation issues:
- fpavf_log_dbg("buffer exist in pool cnt %ld\n", cnt);
+ fpavf_log_dbg("buffer exist in pool cnt %" PRId64 "\n", cnt);
Fixed when applying
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-10-23 14:50 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-16 13:42 [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool Santosh Shukla
2017-10-16 13:42 ` [dpdk-dev] [PATCH v1 2/2] event/octeontx: bump library version Santosh Shukla
2017-10-17 9:50 ` Hemant Agrawal
2017-10-23 14:38 ` Thomas Monjalon
2017-10-17 9:49 ` [dpdk-dev] [PATCH v1 1/2] mempool/octeontx: move mbox from event to mempool Hemant Agrawal
2017-10-21 9:51 ` Jerin Jacob
2017-10-18 4:46 ` Pavan Nikhilesh Bhagavatula
2017-10-23 14:50 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).