DPDK patches and discussions
 help / color / mirror / Atom feed
From: Hemant Agrawal <hemant.agrawal@nxp.com>
To: <ferruh.yigit@intel.com>
Cc: <dev@dpdk.org>
Subject: [dpdk-dev] [RFC PATCH 3/5] kni: init and change request for mtu
Date: Wed, 3 May 2017 16:51:10 +0530	[thread overview]
Message-ID: <1493810472-668-3-git-send-email-hemant.agrawal@nxp.com> (raw)
In-Reply-To: <1493810472-668-1-git-send-email-hemant.agrawal@nxp.com>

1. Configure initial mtu.
2. Message to userspace for mtu change

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
 lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h | 1 +
 lib/librte_eal/linuxapp/kni/kni_misc.c                        | 2 ++
 lib/librte_kni/rte_kni.c                                      | 1 +
 lib/librte_kni/rte_kni.h                                      | 1 +
 4 files changed, 5 insertions(+)

diff --git a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
index c04fefd..2cd7d9a 100644
--- a/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
+++ b/lib/librte_eal/linuxapp/eal/include/exec-env/rte_kni_common.h
@@ -172,6 +172,7 @@ struct rte_kni_device_info {
 
 	/* mbuf size */
 	unsigned mbuf_size;
+	unsigned int mtu;             /**< MTU */
 	char macaddr[6];              /**< Mac Address */
 };
 
diff --git a/lib/librte_eal/linuxapp/kni/kni_misc.c b/lib/librte_eal/linuxapp/kni/kni_misc.c
index 90879fa..4f99a5e 100644
--- a/lib/librte_eal/linuxapp/kni/kni_misc.c
+++ b/lib/librte_eal/linuxapp/kni/kni_misc.c
@@ -469,6 +469,8 @@ struct kni_net {
 		memcpy(net_dev->dev_addr, dev_info.macaddr, ETH_ALEN);
 	}
 
+	net_dev->mtu = dev_info.mtu;
+
 	ret = register_netdev(net_dev);
 	if (ret) {
 		pr_err("error %i registering device \"%s\"\n",
diff --git a/lib/librte_kni/rte_kni.c b/lib/librte_kni/rte_kni.c
index 8ae632f..a3aab9d 100644
--- a/lib/librte_kni/rte_kni.c
+++ b/lib/librte_kni/rte_kni.c
@@ -373,6 +373,7 @@ struct rte_kni *
 	dev_info.mbuf_size = conf->mbuf_size;
 
 	memcpy(dev_info.macaddr, conf->macaddr, ETH_ADDR_LEN);
+	dev_info.mtu = conf->mtu;
 
 	snprintf(ctx->name, RTE_KNI_NAMESIZE, "%s", intf_name);
 	snprintf(dev_info.name, RTE_KNI_NAMESIZE, "%s", intf_name);
diff --git a/lib/librte_kni/rte_kni.h b/lib/librte_kni/rte_kni.h
index 488db4b..3156e33 100644
--- a/lib/librte_kni/rte_kni.h
+++ b/lib/librte_kni/rte_kni.h
@@ -98,6 +98,7 @@ struct rte_kni_conf {
 	struct rte_pci_addr addr;
 	struct rte_pci_id id;
 	char macaddr[ETH_ADDR_LEN]; /* MAC address assigned to KNI */
+	uint16_t mtu;	/* Maximum transmission Unit of KNI*/
 
 	__extension__
 	uint8_t force_bind : 1; /* Flag to bind kernel thread */
-- 
1.9.1

  parent reply	other threads:[~2017-05-03 11:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-03 11:21 [dpdk-dev] [RFC PATCH 1/5] kni: change and configure mac address Hemant Agrawal
2017-05-03 11:21 ` [dpdk-dev] [RFC PATCH 2/5] kni: add support for promisc mode set Hemant Agrawal
2017-05-03 11:21 ` Hemant Agrawal [this message]
2017-05-03 11:21 ` [dpdk-dev] [RFC PATCH 4/5] kni: add support to get gso_size info Hemant Agrawal
2017-05-03 13:57   ` Alejandro Lucero
2017-05-05 11:43   ` Ferruh Yigit
2017-05-03 11:21 ` [dpdk-dev] [RFC PATCH 5/5] kni: support multiple userspace process working with kni module Hemant Agrawal
2017-05-05 13:08   ` Ferruh Yigit
2017-05-08  9:50     ` Hemant Agrawal
2017-05-05 11:28 ` [dpdk-dev] [RFC PATCH 1/5] kni: change and configure mac address Ferruh Yigit
2017-05-08  9:59   ` Hemant Agrawal
2017-11-28 22:31 ` Ferruh Yigit
2017-11-30  6:44   ` Hemant Agrawal

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=1493810472-668-3-git-send-email-hemant.agrawal@nxp.com \
    --to=hemant.agrawal@nxp.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    /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).