From: Yasufumi Ogawa <yasufum.o@gmail.com>
To: spp@dpdk.org, ferruh.yigit@intel.com, yasufum.o@gmail.com
Subject: [spp] [PATCH 2/2] spp_nfv: move util funcs for ports to shared
Date: Tue, 15 Oct 2019 03:44:19 +0900 [thread overview]
Message-ID: <20191014184419.26302-3-yasufum.o@gmail.com> (raw)
In-Reply-To: <20191014184419.26302-1-yasufum.o@gmail.com>
This update is to move util functions for managing ports to shared lib
because enable to be used from other processes including spp_primary.
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
---
src/nfv/main.c | 2 +-
.../nfv_utils.h => shared/port_manager.h} | 20 ++++++++++---------
2 files changed, 12 insertions(+), 10 deletions(-)
rename src/{nfv/nfv_utils.h => shared/port_manager.h} (83%)
diff --git a/src/nfv/main.c b/src/nfv/main.c
index dbefba4..ac82139 100644
--- a/src/nfv/main.c
+++ b/src/nfv/main.c
@@ -21,7 +21,7 @@
#include "params.h"
#include "init.h"
#include "nfv_status.h"
-#include "nfv_utils.h"
+#include "shared/port_manager.h"
#include "commands.h"
#define RTE_LOGTYPE_SPP_NFV RTE_LOGTYPE_USER1
diff --git a/src/nfv/nfv_utils.h b/src/shared/port_manager.h
similarity index 83%
rename from src/nfv/nfv_utils.h
rename to src/shared/port_manager.h
index 9d4f9dd..9756864 100644
--- a/src/nfv/nfv_utils.h
+++ b/src/shared/port_manager.h
@@ -3,10 +3,12 @@
* Copyright(c) 2019 Nippon Telegraph and Telephone Corporation
*/
-#ifndef _NFV_NFV_UTILS_H_
-#define _NFV_NFV_UTILS_H_
+#ifndef __SHARED_PORT_MANAGER_H__
+#define __SHARED_PORT_MANAGER_H__
-#define RTE_LOGTYPE_SPP_NFV RTE_LOGTYPE_USER1
+#define RTE_LOGTYPE_SHARED RTE_LOGTYPE_USER1
+
+#include "shared/basic_forwarder.h"
static void
forward_array_remove(int port_id)
@@ -78,11 +80,11 @@ add_patch(uint16_t in_port, uint16_t out_port)
ports_fwd_array[out_port].rx_func = &rte_eth_rx_burst;
ports_fwd_array[out_port].tx_func = &rte_eth_tx_burst;
- RTE_LOG(DEBUG, SPP_NFV, "STATUS: in port %d in_port_id %d\n", in_port,
+ RTE_LOG(DEBUG, SHARED, "STATUS: in port %d in_port_id %d\n", in_port,
ports_fwd_array[in_port].in_port_id);
- RTE_LOG(DEBUG, SPP_NFV, "STATUS: in port %d patch out port id %d\n",
+ RTE_LOG(DEBUG, SHARED, "STATUS: in port %d patch out port id %d\n",
in_port, ports_fwd_array[in_port].out_port_id);
- RTE_LOG(DEBUG, SPP_NFV, "STATUS: outport %d in_port_id %d\n", out_port,
+ RTE_LOG(DEBUG, SHARED, "STATUS: outport %d in_port_id %d\n", out_port,
ports_fwd_array[out_port].in_port_id);
return 0;
@@ -97,8 +99,8 @@ forward_array_reset(void)
for (i = 0; i < RTE_MAX_ETHPORTS; i++) {
if (ports_fwd_array[i].in_port_id != PORT_RESET) {
ports_fwd_array[i].out_port_id = PORT_RESET;
- RTE_LOG(INFO, SPP_NFV, "Port ID %d\n", i);
- RTE_LOG(INFO, SPP_NFV, "out_port_id %d\n",
+ RTE_LOG(INFO, SHARED, "Port ID %d\n", i);
+ RTE_LOG(INFO, SHARED, "out_port_id %d\n",
ports_fwd_array[i].out_port_id);
}
}
@@ -116,4 +118,4 @@ static enum port_type get_port_type(char *portname)
return UNDEF;
}
-#endif // _NFV_COMMAND_UTILS_H_
+#endif // __SHARED_PORT_MANAGER_H__
--
2.17.1
prev parent reply other threads:[~2019-10-14 18:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-14 18:44 [spp] [PATCH 0/2] Move forward functions " Yasufumi Ogawa
2019-10-14 18:44 ` [spp] [PATCH 1/2] spp_nfv: move forward func to be shared Yasufumi Ogawa
2019-10-14 18:44 ` Yasufumi Ogawa [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191014184419.26302-3-yasufum.o@gmail.com \
--to=yasufum.o@gmail.com \
--cc=ferruh.yigit@intel.com \
--cc=spp@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).