sys-kernel/*: fix mtu regression on aws on 4.16.13

Upstream commit f599c64fdf7d9c108e8717fb04bc41c680120da4 introduced a
regression preventing setting jumbo frames on aws.
This commit is contained in:
Andrew Jeddeloh 2018-05-30 18:00:37 -07:00
parent 027067922e
commit a1d7bc7b45
9 changed files with 170 additions and 12 deletions

View File

@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=5 EAPI=5
COREOS_SOURCE_REVISION="" COREOS_SOURCE_REVISION="-r1"
inherit coreos-kernel inherit coreos-kernel
DESCRIPTION="CoreOS Linux kernel" DESCRIPTION="CoreOS Linux kernel"

View File

@ -2,7 +2,7 @@
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
EAPI=5 EAPI=5
COREOS_SOURCE_REVISION="" COREOS_SOURCE_REVISION="-r1"
inherit coreos-kernel savedconfig inherit coreos-kernel savedconfig
DESCRIPTION="CoreOS Linux kernel modules" DESCRIPTION="CoreOS Linux kernel modules"

View File

@ -40,4 +40,5 @@ UNIPATCH_LIST="
${PATCH_DIR}/z0003-tools-objtool-Makefile-Don-t-fail-on-fallthrough-wit.patch \ ${PATCH_DIR}/z0003-tools-objtool-Makefile-Don-t-fail-on-fallthrough-wit.patch \
${PATCH_DIR}/z0004-Revert-random-use-a-different-mixing-algorithm-for-a.patch \ ${PATCH_DIR}/z0004-Revert-random-use-a-different-mixing-algorithm-for-a.patch \
${PATCH_DIR}/z0005-Revert-random-fix-crng_ready-test.patch \ ${PATCH_DIR}/z0005-Revert-random-fix-crng_ready-test.patch \
${PATCH_DIR}/z0006-Revert-xen-netfront-Fix-race-between-device-setup-an.patch \
" "

View File

@ -1,7 +1,7 @@
From 406cf32cc9a42c02714c270d4158972525d0b283 Mon Sep 17 00:00:00 2001 From 406cf32cc9a42c02714c270d4158972525d0b283 Mon Sep 17 00:00:00 2001
From: Vito Caputo <vito.caputo@coreos.com> From: Vito Caputo <vito.caputo@coreos.com>
Date: Wed, 25 Nov 2015 02:59:45 -0800 Date: Wed, 25 Nov 2015 02:59:45 -0800
Subject: [PATCH 1/5] kbuild: derive relative path for KBUILD_SRC from CURDIR Subject: [PATCH 1/6] kbuild: derive relative path for KBUILD_SRC from CURDIR
This enables relocating source and build trees to different roots, This enables relocating source and build trees to different roots,
provided they stay reachable relative to one another. Useful for provided they stay reachable relative to one another. Useful for
@ -26,5 +26,5 @@ index 146e527a5e06..10057078b233 100644
# Leave processing to above invocation of make # Leave processing to above invocation of make
-- --
2.14.3 2.14.1

View File

@ -1,7 +1,7 @@
From d25b1ad577bba0861ff76fcb244beac9f6c641b6 Mon Sep 17 00:00:00 2001 From d25b1ad577bba0861ff76fcb244beac9f6c641b6 Mon Sep 17 00:00:00 2001
From: Geoff Levand <geoff@infradead.org> From: Geoff Levand <geoff@infradead.org>
Date: Fri, 11 Nov 2016 17:28:52 -0800 Date: Fri, 11 Nov 2016 17:28:52 -0800
Subject: [PATCH 2/5] Add arm64 coreos verity hash Subject: [PATCH 2/6] Add arm64 coreos verity hash
Signed-off-by: Geoff Levand <geoff@infradead.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
--- ---
@ -25,5 +25,5 @@ index 613fc3000677..fdaf86c78332 100644
/* /*
* The debug table is referenced via its Relative Virtual Address (RVA), * The debug table is referenced via its Relative Virtual Address (RVA),
-- --
2.14.3 2.14.1

View File

@ -1,7 +1,7 @@
From 647f63bb965113f925c1b2063c84c818bbb90e21 Mon Sep 17 00:00:00 2001 From 647f63bb965113f925c1b2063c84c818bbb90e21 Mon Sep 17 00:00:00 2001
From: David Michael <david.michael@coreos.com> From: David Michael <david.michael@coreos.com>
Date: Thu, 8 Feb 2018 21:23:12 -0500 Date: Thu, 8 Feb 2018 21:23:12 -0500
Subject: [PATCH 3/5] tools/objtool/Makefile: Don't fail on fallthrough with Subject: [PATCH 3/6] tools/objtool/Makefile: Don't fail on fallthrough with
new GCCs new GCCs
--- ---
@ -23,5 +23,5 @@ index 95563b8e1ad7..307652c42a7b 100644
CFLAGS += -I$(srctree)/tools/include/ CFLAGS += -I$(srctree)/tools/include/
-- --
2.14.3 2.14.1

View File

@ -1,7 +1,7 @@
From b6be7c4e22349ffc406700c7a26619cac584cebb Mon Sep 17 00:00:00 2001 From b6be7c4e22349ffc406700c7a26619cac584cebb Mon Sep 17 00:00:00 2001
From: Jeremy Cline <jeremy@jcline.org> From: Jeremy Cline <jeremy@jcline.org>
Date: Wed, 2 May 2018 15:16:29 -0400 Date: Wed, 2 May 2018 15:16:29 -0400
Subject: [PATCH 4/5] Revert "random: use a different mixing algorithm for Subject: [PATCH 4/6] Revert "random: use a different mixing algorithm for
add_device_randomness()" add_device_randomness()"
This reverts commit 89b59f050347d376c2ace8b1ceb908a218cfdc2e. This reverts commit 89b59f050347d376c2ace8b1ceb908a218cfdc2e.
@ -92,5 +92,5 @@ index 8f4e11842c60..aa5b04af86c6 100644
trace_add_device_randomness(size, _RET_IP_); trace_add_device_randomness(size, _RET_IP_);
spin_lock_irqsave(&input_pool.lock, flags); spin_lock_irqsave(&input_pool.lock, flags);
-- --
2.14.3 2.14.1

View File

@ -1,7 +1,7 @@
From 890071b67cafa1d9540aa55bc69ed6c0f75862e0 Mon Sep 17 00:00:00 2001 From 890071b67cafa1d9540aa55bc69ed6c0f75862e0 Mon Sep 17 00:00:00 2001
From: Jeremy Cline <jeremy@jcline.org> From: Jeremy Cline <jeremy@jcline.org>
Date: Wed, 2 May 2018 15:18:03 -0400 Date: Wed, 2 May 2018 15:18:03 -0400
Subject: [PATCH 5/5] Revert "random: fix crng_ready() test" Subject: [PATCH 5/6] Revert "random: fix crng_ready() test"
This reverts commit cd8d7a5778a4abf76ee8fe8f1bfcf78976029f8d. This reverts commit cd8d7a5778a4abf76ee8fe8f1bfcf78976029f8d.
@ -60,5 +60,5 @@ index aa5b04af86c6..ef05cc685b74 100644
return; return;
} }
-- --
2.14.3 2.14.1

View File

@ -0,0 +1,157 @@
From 4d873796c4f77e0b9eb3881ed2524bba3402c361 Mon Sep 17 00:00:00 2001
From: Andrew Jeddeloh <andrew.jeddeloh@coreos.com>
Date: Wed, 30 May 2018 17:50:37 -0700
Subject: [PATCH 6/6] Revert "xen-netfront: Fix race between device setup and
open"
This reverts commit f599c64fdf7d9c108e8717fb04bc41c680120da4.
This causes failures to set mtu > 1500 on some aws instances.
---
drivers/net/xen-netfront.c | 46 ++++++++++++++++++++++------------------------
1 file changed, 22 insertions(+), 24 deletions(-)
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index 3127bc8633ca..5a37ee2372a3 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -351,9 +351,6 @@ static int xennet_open(struct net_device *dev)
unsigned int i = 0;
struct netfront_queue *queue = NULL;
- if (!np->queues)
- return -ENODEV;
-
for (i = 0; i < num_queues; ++i) {
queue = &np->queues[i];
napi_enable(&queue->napi);
@@ -1361,8 +1358,18 @@ static int netfront_probe(struct xenbus_device *dev,
#ifdef CONFIG_SYSFS
info->netdev->sysfs_groups[0] = &xennet_dev_group;
#endif
+ err = register_netdev(info->netdev);
+ if (err) {
+ pr_warn("%s: register_netdev err=%d\n", __func__, err);
+ goto fail;
+ }
return 0;
+
+ fail:
+ xennet_free_netdev(netdev);
+ dev_set_drvdata(&dev->dev, NULL);
+ return err;
}
static void xennet_end_access(int ref, void *page)
@@ -1730,6 +1737,8 @@ static void xennet_destroy_queues(struct netfront_info *info)
{
unsigned int i;
+ rtnl_lock();
+
for (i = 0; i < info->netdev->real_num_tx_queues; i++) {
struct netfront_queue *queue = &info->queues[i];
@@ -1738,6 +1747,8 @@ static void xennet_destroy_queues(struct netfront_info *info)
netif_napi_del(&queue->napi);
}
+ rtnl_unlock();
+
kfree(info->queues);
info->queues = NULL;
}
@@ -1753,6 +1764,8 @@ static int xennet_create_queues(struct netfront_info *info,
if (!info->queues)
return -ENOMEM;
+ rtnl_lock();
+
for (i = 0; i < *num_queues; i++) {
struct netfront_queue *queue = &info->queues[i];
@@ -1761,7 +1774,7 @@ static int xennet_create_queues(struct netfront_info *info,
ret = xennet_init_queue(queue);
if (ret < 0) {
- dev_warn(&info->xbdev->dev,
+ dev_warn(&info->netdev->dev,
"only created %d queues\n", i);
*num_queues = i;
break;
@@ -1775,8 +1788,10 @@ static int xennet_create_queues(struct netfront_info *info,
netif_set_real_num_tx_queues(info->netdev, *num_queues);
+ rtnl_unlock();
+
if (*num_queues == 0) {
- dev_err(&info->xbdev->dev, "no queues\n");
+ dev_err(&info->netdev->dev, "no queues\n");
return -EINVAL;
}
return 0;
@@ -1813,7 +1828,6 @@ static int talk_to_netback(struct xenbus_device *dev,
goto out;
}
- rtnl_lock();
if (info->queues)
xennet_destroy_queues(info);
@@ -1824,7 +1838,6 @@ static int talk_to_netback(struct xenbus_device *dev,
info->queues = NULL;
goto out;
}
- rtnl_unlock();
/* Create shared ring, alloc event channel -- for each queue */
for (i = 0; i < num_queues; ++i) {
@@ -1921,10 +1934,8 @@ static int talk_to_netback(struct xenbus_device *dev,
xenbus_transaction_end(xbt, 1);
destroy_ring:
xennet_disconnect_backend(info);
- rtnl_lock();
xennet_destroy_queues(info);
out:
- rtnl_unlock();
device_unregister(&dev->dev);
return err;
}
@@ -1954,15 +1965,6 @@ static int xennet_connect(struct net_device *dev)
netdev_update_features(dev);
rtnl_unlock();
- if (dev->reg_state == NETREG_UNINITIALIZED) {
- err = register_netdev(dev);
- if (err) {
- pr_warn("%s: register_netdev err=%d\n", __func__, err);
- device_unregister(&np->xbdev->dev);
- return err;
- }
- }
-
/*
* All public and private state should now be sane. Get
* ready to start sending and receiving packets and give the driver
@@ -2153,14 +2155,10 @@ static int xennet_remove(struct xenbus_device *dev)
xennet_disconnect_backend(info);
- if (info->netdev->reg_state == NETREG_REGISTERED)
- unregister_netdev(info->netdev);
+ unregister_netdev(info->netdev);
- if (info->queues) {
- rtnl_lock();
+ if (info->queues)
xennet_destroy_queues(info);
- rtnl_unlock();
- }
xennet_free_netdev(info->netdev);
return 0;
--
2.14.1