DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [RFC 3/3] examples/ethtool: add control interface support to the application
Date: Fri, 15 Jan 2016 16:18:04 +0000	[thread overview]
Message-ID: <1452874684-12750-4-git-send-email-ferruh.yigit@intel.com> (raw)
In-Reply-To: <1452874684-12750-1-git-send-email-ferruh.yigit@intel.com>

Control interface APIs added into the sample application.

To have the support corresponding kernel module (KCP) needs to be inserted.
If kernel module is not there, application will run as it is without
kernel control path support.

When KCP module inserted, running application creates a virtual Linux
network interface (dpdk$) per DPDK port. This interface can be used by
traditional Linux tools.

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
 examples/ethtool/ethtool-app/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/ethtool/ethtool-app/main.c b/examples/ethtool/ethtool-app/main.c
index e21abcd..bfa2128 100644
--- a/examples/ethtool/ethtool-app/main.c
+++ b/examples/ethtool/ethtool-app/main.c
@@ -44,6 +44,7 @@
 #include <rte_memory.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
+#include <rte_ctrl_if.h>
 
 #include "ethapp.h"
 
@@ -54,7 +55,6 @@
 #define PKTPOOL_EXTRA_SIZE 512
 #define PKTPOOL_CACHE 32
 
-
 struct txq_port {
 	uint16_t cnt_unsent;
 	struct rte_mbuf *buf_frames[MAX_BURST_LENGTH];
@@ -254,6 +254,8 @@ static int slave_main(__attribute__((unused)) void *ptr_data)
 			}
 			rte_spinlock_unlock(&ptr_port->lock);
 		} /* end for( idx_port ) */
+		rte_eth_control_interface_process_msg(
+				RTE_ETHTOOL_CTRL_IF_PROCESS_MSG, 0);
 	} /* end for(;;) */
 
 	return 0;
@@ -293,6 +295,8 @@ int main(int argc, char **argv)
 	id_core = rte_get_next_lcore(id_core, 1, 1);
 	rte_eal_remote_launch(slave_main, NULL, id_core);
 
+	rte_eth_control_interface_create();
+
 	ethapp_main();
 
 	app_cfg.exit_now = 1;
@@ -301,5 +305,7 @@ int main(int argc, char **argv)
 			return -1;
 	}
 
+	rte_eth_control_interface_destroy();
+
 	return 0;
 }
-- 
2.5.0

  parent reply	other threads:[~2016-01-15 16:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-15 16:18 [dpdk-dev] [RFC 0/3] Use common Linux tools to control DPDK ports Ferruh Yigit
2016-01-15 16:18 ` [dpdk-dev] [RFC 1/3] rte_ctrl_if: add control interface library Ferruh Yigit
2016-01-15 16:18 ` [dpdk-dev] [RFC 2/3] kcp: add kernel control path kernel module Ferruh Yigit
2016-01-15 16:18 ` Ferruh Yigit [this message]
2016-01-18 16:20 ` [dpdk-dev] [RFC 0/3] Use common Linux tools to control DPDK ports Aaron Conole
2016-01-19  9:59   ` Ferruh Yigit
2016-01-19 11:29     ` Panu Matilainen
2016-02-04 13:30       ` Ferruh Yigit
2016-02-04 13:38         ` Ferruh Yigit
2016-02-04 14:40         ` Aaron Conole
2016-02-04 16:28           ` Ferruh Yigit
2016-01-18 23:12 ` Stephen Hemminger
2016-01-18 23:48   ` Jay Rolette
2016-01-19  1:36     ` Stephen Hemminger
2016-01-19 10:08     ` Ferruh Yigit

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=1452874684-12750-4-git-send-email-ferruh.yigit@intel.com \
    --to=ferruh.yigit@intel.com \
    --cc=dev@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).