All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] xen-netback: add module parameter to disable ctrl-ring
@ 2021-02-25 12:29 ChiaHao Hsu
  2021-03-09 14:10 ` Hsu, Chiahao
  0 siblings, 1 reply; 5+ messages in thread
From: ChiaHao Hsu @ 2021-02-25 12:29 UTC (permalink / raw)
  To: xen-devel; +Cc: andyhsu

In order to support live migration of guests between kernels
that do and do not support 'feature-ctrl-ring', 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  |  2 ++
 drivers/net/xen-netback/netback.c |  6 ++++++
 drivers/net/xen-netback/xenbus.c  | 13 ++++++++-----
 3 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
index 4a16d6e33c09..bfb7a3054917 100644
--- a/drivers/net/xen-netback/common.h
+++ b/drivers/net/xen-netback/common.h
@@ -276,6 +276,7 @@ struct backend_info {
 	u8 have_hotplug_status_watch:1;
 
 	const char *hotplug_script;
+	bool ctrl_ring_enabled;
 };
 
 struct xenvif {
@@ -413,6 +414,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 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 e5c73f819662..20d858f0456a 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -48,6 +48,12 @@
 
 #include <asm/xen/hypercall.h>
 
+/* Provide an option to disable control ring which is used to pass
+ * large quantities of data from frontend to backend.
+ */
+bool control_ring = true;
+module_param(control_ring, 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 a5439c130130..8a9169cff9c5 100644
--- a/drivers/net/xen-netback/xenbus.c
+++ b/drivers/net/xen-netback/xenbus.c
@@ -1123,11 +1123,14 @@ static int netback_probe(struct xenbus_device *dev,
 	if (err)
 		pr_debug("Error writing multi-queue-max-queues\n");
 
-	err = xenbus_printf(XBT_NIL, dev->nodename,
-			    "feature-ctrl-ring",
-			    "%u", true);
-	if (err)
-		pr_debug("Error writing feature-ctrl-ring\n");
+	be->ctrl_ring_enabled = READ_ONCE(control_ring);
+	if (be->ctrl_ring_enabled) {
+		err = xenbus_printf(XBT_NIL, dev->nodename,
+				    "feature-ctrl-ring",
+				    "%u", true);
+		if (err)
+			pr_debug("Error writing feature-ctrl-ring\n");
+	}
 
 	backend_switch_state(be, XenbusStateInitWait);
 
-- 
2.23.3



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] xen-netback: add module parameter to disable ctrl-ring
  2021-02-25 12:29 [PATCH 1/2] xen-netback: add module parameter to disable ctrl-ring ChiaHao Hsu
@ 2021-03-09 14:10 ` Hsu, Chiahao
  2021-03-09 14:34   ` Paul Durrant
  0 siblings, 1 reply; 5+ messages in thread
From: Hsu, Chiahao @ 2021-03-09 14:10 UTC (permalink / raw)
  To: xen-devel



On 25.02.21, 13:29, "Hsu, Chiahao" <andyhsu@amazon.com> wrote:

    In order to support live migration of guests between kernels
    that do and do not support 'feature-ctrl-ring', 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  |  2 ++
     drivers/net/xen-netback/netback.c |  6 ++++++
     drivers/net/xen-netback/xenbus.c  | 13 ++++++++-----
     3 files changed, 16 insertions(+), 5 deletions(-)

    diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
    index 4a16d6e33c09..bfb7a3054917 100644
    --- a/drivers/net/xen-netback/common.h
    +++ b/drivers/net/xen-netback/common.h
    @@ -276,6 +276,7 @@ struct backend_info {
     	u8 have_hotplug_status_watch:1;

     	const char *hotplug_script;
    +	bool ctrl_ring_enabled;
     };

     struct xenvif {
    @@ -413,6 +414,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 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 e5c73f819662..20d858f0456a 100644
    --- a/drivers/net/xen-netback/netback.c
    +++ b/drivers/net/xen-netback/netback.c
    @@ -48,6 +48,12 @@

     #include <asm/xen/hypercall.h>

    +/* Provide an option to disable control ring which is used to pass
    + * large quantities of data from frontend to backend.
    + */
    +bool control_ring = true;
    +module_param(control_ring, 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 a5439c130130..8a9169cff9c5 100644
    --- a/drivers/net/xen-netback/xenbus.c
    +++ b/drivers/net/xen-netback/xenbus.c
    @@ -1123,11 +1123,14 @@ static int netback_probe(struct xenbus_device *dev,
     	if (err)
     		pr_debug("Error writing multi-queue-max-queues\n");

    -	err = xenbus_printf(XBT_NIL, dev->nodename,
    -			    "feature-ctrl-ring",
    -			    "%u", true);
    -	if (err)
    -		pr_debug("Error writing feature-ctrl-ring\n");
    +	be->ctrl_ring_enabled = READ_ONCE(control_ring);
    +	if (be->ctrl_ring_enabled) {
    +		err = xenbus_printf(XBT_NIL, dev->nodename,
    +				    "feature-ctrl-ring",
    +				    "%u", true);
    +		if (err)
    +			pr_debug("Error writing feature-ctrl-ring\n");
    +	}

     	backend_switch_state(be, XenbusStateInitWait);

    -- 
    2.23.3

Gentle ping.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] xen-netback: add module parameter to disable ctrl-ring
  2021-03-09 14:10 ` Hsu, Chiahao
@ 2021-03-09 14:34   ` Paul Durrant
  2021-03-09 19:21     ` Wei Liu
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Durrant @ 2021-03-09 14:34 UTC (permalink / raw)
  To: xen-devel; +Cc: wl

On 09/03/2021 14:10, Hsu, Chiahao wrote:
> On 25.02.21, 13:29, "Hsu, Chiahao" <andyhsu@amazon.com> wrote:
> 
>      In order to support live migration of guests between kernels
>      that do and do not support 'feature-ctrl-ring', 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>

You should directly CC maintainers, and also I don't see netdev in the 
To list... Did you send it there? I suspect not, since I don't see 
'net-next' in the prefix.

   Paul

>      ---
>       drivers/net/xen-netback/common.h  |  2 ++
>       drivers/net/xen-netback/netback.c |  6 ++++++
>       drivers/net/xen-netback/xenbus.c  | 13 ++++++++-----
>       3 files changed, 16 insertions(+), 5 deletions(-)
> 
>      diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
>      index 4a16d6e33c09..bfb7a3054917 100644
>      --- a/drivers/net/xen-netback/common.h
>      +++ b/drivers/net/xen-netback/common.h
>      @@ -276,6 +276,7 @@ struct backend_info {
>       	u8 have_hotplug_status_watch:1;
> 
>       	const char *hotplug_script;
>      +	bool ctrl_ring_enabled;
>       };
> 
>       struct xenvif {
>      @@ -413,6 +414,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 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 e5c73f819662..20d858f0456a 100644
>      --- a/drivers/net/xen-netback/netback.c
>      +++ b/drivers/net/xen-netback/netback.c
>      @@ -48,6 +48,12 @@
> 
>       #include <asm/xen/hypercall.h>
> 
>      +/* Provide an option to disable control ring which is used to pass
>      + * large quantities of data from frontend to backend.
>      + */
>      +bool control_ring = true;
>      +module_param(control_ring, 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 a5439c130130..8a9169cff9c5 100644
>      --- a/drivers/net/xen-netback/xenbus.c
>      +++ b/drivers/net/xen-netback/xenbus.c
>      @@ -1123,11 +1123,14 @@ static int netback_probe(struct xenbus_device *dev,
>       	if (err)
>       		pr_debug("Error writing multi-queue-max-queues\n");
> 
>      -	err = xenbus_printf(XBT_NIL, dev->nodename,
>      -			    "feature-ctrl-ring",
>      -			    "%u", true);
>      -	if (err)
>      -		pr_debug("Error writing feature-ctrl-ring\n");
>      +	be->ctrl_ring_enabled = READ_ONCE(control_ring);
>      +	if (be->ctrl_ring_enabled) {
>      +		err = xenbus_printf(XBT_NIL, dev->nodename,
>      +				    "feature-ctrl-ring",
>      +				    "%u", true);
>      +		if (err)
>      +			pr_debug("Error writing feature-ctrl-ring\n");
>      +	}
> 
>       	backend_switch_state(be, XenbusStateInitWait);
> 
>      --
>      2.23.3
> 
> Gentle ping.
> 



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] xen-netback: add module parameter to disable ctrl-ring
  2021-03-09 14:34   ` Paul Durrant
@ 2021-03-09 19:21     ` Wei Liu
  2021-03-09 19:23       ` Wei Liu
  0 siblings, 1 reply; 5+ messages in thread
From: Wei Liu @ 2021-03-09 19:21 UTC (permalink / raw)
  To: paul; +Cc: xen-devel, wl

On Tue, Mar 09, 2021 at 02:34:56PM +0000, Paul Durrant wrote:
> On 09/03/2021 14:10, Hsu, Chiahao wrote:
> > On 25.02.21, 13:29, "Hsu, Chiahao" <andyhsu@amazon.com> wrote:
> > 
> >      In order to support live migration of guests between kernels
> >      that do and do not support 'feature-ctrl-ring', 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>
> 
> You should directly CC maintainers, and also I don't see netdev in the To
> list... Did you send it there? I suspect not, since I don't see 'net-next'
> in the prefix.

I think it would be better to resend this series.

See Documentation/networking/netdev-FAQ.rst.

Wei.

> 
>   Paul


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/2] xen-netback: add module parameter to disable ctrl-ring
  2021-03-09 19:21     ` Wei Liu
@ 2021-03-09 19:23       ` Wei Liu
  0 siblings, 0 replies; 5+ messages in thread
From: Wei Liu @ 2021-03-09 19:23 UTC (permalink / raw)
  To: paul, andyhsu; +Cc: xen-devel, wl

+ the author

On Tue, Mar 09, 2021 at 07:21:22PM +0000, Wei Liu wrote:
> On Tue, Mar 09, 2021 at 02:34:56PM +0000, Paul Durrant wrote:
> > On 09/03/2021 14:10, Hsu, Chiahao wrote:
> > > On 25.02.21, 13:29, "Hsu, Chiahao" <andyhsu@amazon.com> wrote:
> > > 
> > >      In order to support live migration of guests between kernels
> > >      that do and do not support 'feature-ctrl-ring', 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>
> > 
> > You should directly CC maintainers, and also I don't see netdev in the To
> > list... Did you send it there? I suspect not, since I don't see 'net-next'
> > in the prefix.
> 
> I think it would be better to resend this series.
> 
> See Documentation/networking/netdev-FAQ.rst.
> 
> Wei.
> 
> > 
> >   Paul


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-03-09 19:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-25 12:29 [PATCH 1/2] xen-netback: add module parameter to disable ctrl-ring ChiaHao Hsu
2021-03-09 14:10 ` Hsu, Chiahao
2021-03-09 14:34   ` Paul Durrant
2021-03-09 19:21     ` Wei Liu
2021-03-09 19:23       ` Wei Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.