From patchwork Thu Mar 11 22:59:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hsu, Chiahao" X-Patchwork-Id: 12133187 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 117FCC433E0 for ; Thu, 11 Mar 2021 23:00:19 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE85D64F8E for ; Thu, 11 Mar 2021 23:00:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE85D64F8E Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.96754.183391 (Exim 4.92) (envelope-from ) id 1lKUHq-000157-TO; Thu, 11 Mar 2021 23:00:10 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 96754.183391; Thu, 11 Mar 2021 23:00:10 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lKUHq-000150-QK; Thu, 11 Mar 2021 23:00:10 +0000 Received: by outflank-mailman (input) for mailman id 96754; Thu, 11 Mar 2021 23:00:09 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lKUHp-00014v-Tb for xen-devel@lists.xenproject.org; Thu, 11 Mar 2021 23:00:09 +0000 Received: from smtp-fw-4101.amazon.com (unknown [72.21.198.25]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id a79dd51f-88e1-4309-b5ae-93e36f2cb113; Thu, 11 Mar 2021 23:00:09 +0000 (UTC) Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-2b-c300ac87.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-4101.iad4.amazon.com with ESMTP; 11 Mar 2021 23:00:00 +0000 Received: from EX13D12EUA002.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2b-c300ac87.us-west-2.amazon.com (Postfix) with ESMTPS id 1C690A22E0; Thu, 11 Mar 2021 22:59:59 +0000 (UTC) Received: from dev-dsk-andyhsu-1c-d6833dcf.eu-west-1.amazon.com (10.43.160.27) by EX13D12EUA002.ant.amazon.com (10.43.165.103) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 11 Mar 2021 22:59:55 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Inumbo-ID: a79dd51f-88e1-4309-b5ae-93e36f2cb113 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1615503609; x=1647039609; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=f4kw6VKDxqZ6aK5je+CShKYL/i9tWOOhWCfFur47MZU=; b=UGUGIPn3RL2Wn973dCqB/OjjJ4bfP7W5bmGnhUToh/mPXPZsqFGU1baG ISbwkSoVNRVbIguZmtKNU+POg04oHzvFwG4JyTFi4ucA8DozH+JT/z9Dy gMO7yeBowP+S/4yghbpOc52VEcXv9SgLCELVdk6e+tet+L/7U6ZCnQR71 g=; IronPort-HdrOrdr: A9a23:hblugKnnQPn8kG+AHnwCCxgN7sfpDfKS3DAbvn1ZSRFFG/Gwve rGppsm/DXzjyscX2xlpMuJP7OOTWiZ2Zl+54QQOrnKZniChEKDKoZ+4Yz+hwDxAiGWzJ846Y 5Me7VzYeeQMXFUlsD/iTPUL/8F4P2qtJ+lnv3fyXAFd3AJV4hF4x1iAgiWVm1aLTMnObMBD5 aX6sdKoDCtEE5nF/iTPXUOU+jdq9CjrvuPCnQ7LiQ64wqDhy7A0tDHOiWfty1zbxp/hZ0m8W TDjjXj4LSiv/yR2nbnpgnuxqUTvNPgz9dZbfb86fQ9G3HLkQanZINoRr2EsnQUmYiUmTEXrO U= X-IronPort-AV: E=Sophos;i="5.81,241,1610409600"; d="scan'208";a="92295156" From: ChiaHao Hsu To: CC: , , , , , Subject: [net-next 1/2] xen-netback: add module parameter to disable ctrl-ring Date: Thu, 11 Mar 2021 22:59:44 +0000 Message-ID: <20210311225944.24198-1-andyhsu@amazon.com> X-Mailer: git-send-email 2.23.3 MIME-Version: 1.0 X-Originating-IP: [10.43.160.27] X-ClientProxiedBy: EX13D42UWB003.ant.amazon.com (10.43.161.45) To EX13D12EUA002.ant.amazon.com (10.43.165.103) Precedence: Bulk 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 Reviewed-by: Paul Durrant --- drivers/net/xen-netback/common.h | 2 ++ drivers/net/xen-netback/netback.c | 6 ++++++ drivers/net/xen-netback/xenbus.c | 23 ++++++++++++++--------- 3 files changed, 22 insertions(+), 9 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 39a01c2a3058..a119ae673862 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -48,6 +48,12 @@ #include +/* 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..9801b8d10239 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c @@ -755,10 +755,12 @@ static void connect(struct backend_info *be) xen_register_watchers(dev, be->vif); read_xenbus_vif_flags(be); - err = connect_ctrl_ring(be); - if (err) { - xenbus_dev_fatal(dev, err, "connecting control ring"); - return; + if (be->ctrl_ring_enabled) { + err = connect_ctrl_ring(be); + if (err) { + xenbus_dev_fatal(dev, err, "connecting control ring"); + return; + } } /* Use the number of queues requested by the frontend */ @@ -1123,11 +1125,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); From patchwork Thu Mar 11 23:00:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Hsu, Chiahao" X-Patchwork-Id: 12133189 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5BDD2C433DB for ; Thu, 11 Mar 2021 23:01:06 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EC10C64F8E for ; Thu, 11 Mar 2021 23:01:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EC10C64F8E Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amazon.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.96758.183403 (Exim 4.92) (envelope-from ) id 1lKUId-0001CV-Aw; Thu, 11 Mar 2021 23:00:59 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 96758.183403; Thu, 11 Mar 2021 23:00:59 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lKUId-0001CO-6v; Thu, 11 Mar 2021 23:00:59 +0000 Received: by outflank-mailman (input) for mailman id 96758; Thu, 11 Mar 2021 23:00:58 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lKUIc-0001CH-04 for xen-devel@lists.xenproject.org; Thu, 11 Mar 2021 23:00:58 +0000 Received: from smtp-fw-6001.amazon.com (unknown [52.95.48.154]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 4cda18ce-dbdd-4ad9-aefb-6434ec5c7403; Thu, 11 Mar 2021 23:00:56 +0000 (UTC) Received: from iad12-co-svc-p1-lb1-vlan2.amazon.com (HELO email-inbound-relay-2b-a7fdc47a.us-west-2.amazon.com) ([10.43.8.2]) by smtp-border-fw-out-6001.iad6.amazon.com with ESMTP; 11 Mar 2021 23:00:50 +0000 Received: from EX13D12EUA002.ant.amazon.com (pdx1-ws-svc-p6-lb9-vlan2.pdx.amazon.com [10.236.137.194]) by email-inbound-relay-2b-a7fdc47a.us-west-2.amazon.com (Postfix) with ESMTPS id 9067DC09A4; Thu, 11 Mar 2021 23:00:48 +0000 (UTC) Received: from dev-dsk-andyhsu-1c-d6833dcf.eu-west-1.amazon.com (10.43.161.87) by EX13D12EUA002.ant.amazon.com (10.43.165.103) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 11 Mar 2021 23:00:44 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-Inumbo-ID: 4cda18ce-dbdd-4ad9-aefb-6434ec5c7403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1615503657; x=1647039657; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=EelXUHyPTnNZzAoNgrkrCTVUBcXgQAjuKcfSXbijb4s=; b=Vg9ZTU4KiF+zOsfP4FyrInY6PuG5KmLDMKbuBULHYe33poF5y8U74FZi P7gEAEXGePBU8qM1rt172viMi/j+4sPaxam7rlRO7S+B6/RtnykZtxRtV HJV0TthvoxwTFy+7GzZIwMW3ZWHynYJAXGuY3LAZBAC6u8o6tTAhefr61 8=; IronPort-HdrOrdr: A9a23:qg3et6sX97996S7pax9t1/hP7skDyNV00zAX/kB9WHVpW+az/v rAoN0w0xjohDENHEw6kdebN6WaBV/a/5h54Y4eVI3SOTXOkm2uMY1k8M/e0yTtcheOktJ1+K 98f8FFaeHYIkN9ia/BjTWQN/YF7J25/LuzheHYpk0dLz1CT6179Q92BkK6PyRNJDVuPIE0Hp aQ6s1Mq1ObCA0qR/+2DHUEQOTPzuej/PmNXTc9GxUl5AOS5AnH1JfGFXGjsis2YndkxLcv9n X9iArp5qmvmOHT8G6760bjq7BfmN7s0bJ4da+xo/lQDC7thAaubJlgXLPHnAldmpDJ1GoX X-IronPort-AV: E=Sophos;i="5.81,241,1610409600"; d="scan'208";a="98053995" From: ChiaHao Hsu To: CC: , , , , , Subject: [net-next 2/2] xen-netback: add module parameter to disable dynamic multicast control Date: Thu, 11 Mar 2021 23:00:35 +0000 Message-ID: <20210311230035.24450-1-andyhsu@amazon.com> X-Mailer: git-send-email 2.23.3 MIME-Version: 1.0 X-Originating-IP: [10.43.161.87] X-ClientProxiedBy: EX13D05UWC004.ant.amazon.com (10.43.162.223) To EX13D12EUA002.ant.amazon.com (10.43.165.103) Precedence: Bulk 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 Reviewed-by: Paul Durrant --- 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);