[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210311230035.24450-1-andyhsu@amazon.com>
Date: Thu, 11 Mar 2021 23:00:35 +0000
From: ChiaHao Hsu <andyhsu@...zon.com>
To: <netdev@...r.kernel.org>
CC: <wei.liu@...nel.org>, <paul@....org>, <davem@...emloft.net>,
<kuba@...nel.org>, <andyhsu@...zon.com>,
<xen-devel@...ts.xenproject.org>
Subject: [net-next 2/2] xen-netback: add module parameter to disable dynamic multicast control
In order to support live migration of guests between kernels
that do and do not support 'feature-dynamic-multicast-control',
we add a module parameter that allows the feature to be disabled
at run time, instead of using hardcode value.
The default value is enable.
Signed-off-by: ChiaHao Hsu <andyhsu@...zon.com>
---
drivers/net/xen-netback/common.h | 1 +
drivers/net/xen-netback/netback.c | 7 +++++++
drivers/net/xen-netback/xenbus.c | 14 ++++++++------
3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index bfb7a3054917..c166ebb5a81f 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -415,6 +415,7 @@ static inline pending_ring_idx_t nr_pending_reqs(struct xenvif_queue *queue)
irqreturn_t xenvif_interrupt(int irq, void *dev_id);
extern bool control_ring;
+extern bool dynamic_multicast_control;
extern bool separate_tx_rx_irq;
extern bool provides_xdp_headroom;
diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index a119ae673862..d369428ea5bb 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -54,6 +54,13 @@
bool control_ring = true;
module_param(control_ring, bool, 0644);
+/* Provide an option to extend multicast control protocol. This allows
+ * request-multicast-control to be set by the frontend at any time,
+ * the backend will watch the value and re-sample on watch events.
+ */
+bool dynamic_multicast_control = true;
+module_param(dynamic_multicast_control, bool, 0644);
+
/* Provide an option to disable split event channels at load time as
* event channels are limited resource. Split event channels are
* enabled by default.
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c
index 9801b8d10239..a7f487289bec 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -1094,12 +1094,14 @@ static int netback_probe(struct xenbus_device *dev,
goto abort_transaction;
}
- err = xenbus_printf(xbt, dev->nodename,
- "feature-dynamic-multicast-control",
- "%d", 1);
- if (err) {
- message = "writing feature-dynamic-multicast-control";
- goto abort_transaction;
+ if (dynamic_multicast_control) {
+ err = xenbus_printf(xbt, dev->nodename,
+ "feature-dynamic-multicast-control",
+ "%d", 1);
+ if (err) {
+ message = "writing feature-dynamic-multicast-control";
+ goto abort_transaction;
+ }
}
err = xenbus_transaction_end(xbt, 0);
--
2.23.3
Powered by blists - more mailing lists