diff mbox series

[net-next,2/2] xen-netback: add module parameter to disable dynamic multicast control

Message ID 20210311230035.24450-1-andyhsu@amazon.com (mailing list archive)
State New, archived
Headers show
Series [net-next,1/2] xen-netback: add module parameter to disable ctrl-ring | expand

Commit Message

Hsu, Chiahao March 11, 2021, 11 p.m. UTC
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@amazon.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(-)

Comments

Paul Durrant March 12, 2021, 7:35 a.m. UTC | #1
On 11/03/2021 23:00, ChiaHao Hsu wrote:
> 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@amazon.com>

Reviewed-by: Paul Durrant <paul@xen.org>
diff mbox series

Patch

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);