summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorLiron Himi <lironh@marvell.com>2019-03-26 20:40:10 +0200
committerThomas Monjalon <thomas@monjalon.net>2019-03-30 00:59:59 +0100
commitff1e35fb5f8330f89d13f58c9fb767b5bd188940 (patch)
treee848cbfe43222159104d43ccd6c807ad0af67ee1 /kernel
parent23d5455517568966ca8cac216941128ed3d3a455 (diff)
downloaddpdk-draft-windows-ff1e35fb5f8330f89d13f58c9fb767b5bd188940.zip
dpdk-draft-windows-ff1e35fb5f8330f89d13f58c9fb767b5bd188940.tar.gz
dpdk-draft-windows-ff1e35fb5f8330f89d13f58c9fb767b5bd188940.tar.xz
kni: calculate MTU from mbuf size
- mbuf_size and mtu are now being calculated according to the given mb-pool. - max_mtu is now being set according to the given mtu the above two changes provide the ability to work with jumbo frames Signed-off-by: Liron Himi <lironh@marvell.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/linux/kni/compat.h4
-rw-r--r--kernel/linux/kni/kni_misc.c3
2 files changed, 7 insertions, 0 deletions
diff --git a/kernel/linux/kni/compat.h b/kernel/linux/kni/compat.h
index 3c575c7..562d8bf 100644
--- a/kernel/linux/kni/compat.h
+++ b/kernel/linux/kni/compat.h
@@ -114,6 +114,10 @@
#define ndo_change_mtu ndo_change_mtu_rh74
#endif
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0)
+#define HAVE_MAX_MTU_PARAM
+#endif
+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
#define HAVE_SIGNAL_FUNCTIONS_OWN_HEADER
#endif
diff --git a/kernel/linux/kni/kni_misc.c b/kernel/linux/kni/kni_misc.c
index 522ae23..04c78eb 100644
--- a/kernel/linux/kni/kni_misc.c
+++ b/kernel/linux/kni/kni_misc.c
@@ -459,6 +459,9 @@ kni_ioctl_create(struct net *net, uint32_t ioctl_num,
if (dev_info.mtu)
net_dev->mtu = dev_info.mtu;
+#ifdef HAVE_MAX_MTU_PARAM
+ net_dev->max_mtu = net_dev->mtu;
+#endif
ret = register_netdev(net_dev);
if (ret) {