From patchwork Thu Jun 9 07:33:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Het Gala X-Patchwork-Id: 12875612 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1F36C433EF for ; Thu, 9 Jun 2022 14:07:55 +0000 (UTC) Received: from localhost ([::1]:59634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nzIpH-0000Ia-21 for qemu-devel@archiver.kernel.org; Thu, 09 Jun 2022 10:07:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51898) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzCfV-0002Av-Jx for qemu-devel@nongnu.org; Thu, 09 Jun 2022 03:33:29 -0400 Received: from mx0a-002c1b01.pphosted.com ([148.163.151.68]:32070) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nzCfR-0007u2-1o for qemu-devel@nongnu.org; Thu, 09 Jun 2022 03:33:25 -0400 Received: from pps.filterd (m0127840.ppops.net [127.0.0.1]) by mx0a-002c1b01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25964I86001909; Thu, 9 Jun 2022 00:33:13 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nutanix.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=proofpoint20171006; bh=2+tW6qFI88gqNpzs9PTDNs1XxIiCRp/LBNHS5egfIRo=; b=vuA9Jm5LAaOX+RIwguE3UR4oSo0ryDIbD3y3jkOXBKcIow1IifREGs32ejpWpcrrN33M Mc68Ixl8zrrvDdJ7nfdHkNCw2JsqLMUK25QwQVyWq55A/eZkWsY0KbSLgLJuXyrwTKAN sIcckM7aYCkpvrotFP/MsNfWVprtjJED4k2Dd3AphUkPFZJb3xYSmEXFgylF0LbMK8U2 02buhYkRjlG+/e0nMiTgKiE8TE1ZefUyzKmDu2c8iiYIAg4wHLj0Y5ahKrAMYOUNeFfc 4XN/fkv3ECAgP3+kE35LlPys33hxLXEyRPJxfcJLQQtGVZby/M1fbd34RehkWmVWpQ6S 9Q== Received: from nam04-mw2-obe.outbound.protection.outlook.com (mail-mw2nam04lp2170.outbound.protection.outlook.com [104.47.73.170]) by mx0a-002c1b01.pphosted.com (PPS) with ESMTPS id 3gg3qvtaxx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 09 Jun 2022 00:33:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RHv6eAV0Rp/SXkQErwMDZZRaBaS4GFiv1p6Dd1FX2vm3KKQ70fHB97Z1+fKLe1OSZ8IuWjOGgflfb4HAXQq9+owSivNTX+wATMTEL8GVPTRtzAMgT4sbv2S2GEv4Fs8Mnb8QSmLSUhy9VINjtfuFtPkgfgp9js88w5UYGAhmgDR+oW1LF6fMTyuvmEXMT2zvaPwSjpj0w0Y7OhanQq5ck+Kc8slCCKvj3wREcKrBTIAPlalfJYT8cKol4gw7hVIpID0IVLoWGqU4izERUpHW+5Se+9jIb6R+Q9wVG4bhbRhuKnGbDVuio98d4ajw5XGTpX/dV3/zF3AC+dRp9ANcyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=2+tW6qFI88gqNpzs9PTDNs1XxIiCRp/LBNHS5egfIRo=; b=CH4E9IzYcBPVQcfxvsJUCnUkiZUWpKPNgQurzGe4CV4KFQ+rn3+zhvzp8sGho02WFDKEI8xAYiFJ3+RMetIOhDdsBeegmhVktBXat/B9Q/cd8CWHsIkZ0QjvE5IhOkK15Mpr1yB98Cr3yy69j1MwRpmEAqv6k1p2XKECJ8CjrIjo6UWR5rDMz+Rp7SzDKINLSa74jsiOXtGWDE/5OEJ1VWuFNVOoXmOZOhMDsqWdOkCttOyl4FVpcWrkSxKAawtoPrvIJ9D1aI1/arj4W9mFq/zLqU6o+jzof6uFP+5jSQNeK9y5UJSF4ADqulOaI/M7mhGWOUlcSUqs4qwTXRuB9w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nutanix.com; dmarc=pass action=none header.from=nutanix.com; dkim=pass header.d=nutanix.com; arc=none Received: from BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) by SA1PR02MB8639.namprd02.prod.outlook.com (2603:10b6:806:1fe::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.13; Thu, 9 Jun 2022 07:33:11 +0000 Received: from BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::1493:404b:3242:8e0f]) by BYAPR02MB4343.namprd02.prod.outlook.com ([fe80::1493:404b:3242:8e0f%5]) with mapi id 15.20.5314.019; Thu, 9 Jun 2022 07:33:10 +0000 From: Het Gala To: qemu-devel@nongnu.org Cc: quintela@redhat.com, dgilbert@redhat.com, pbonzini@redhat.com, berrange@redhat.com, armbru@redhat.com, eblake@redhat.com, Het Gala Subject: [PATCH 0/4] Multiple interface support on top of Multi-FD Date: Thu, 9 Jun 2022 07:33:01 +0000 Message-Id: <20220609073305.142515-1-het.gala@nutanix.com> X-Mailer: git-send-email 2.22.3 X-ClientProxiedBy: BY5PR04CA0002.namprd04.prod.outlook.com (2603:10b6:a03:1d0::12) To BYAPR02MB4343.namprd02.prod.outlook.com (2603:10b6:a03:57::18) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c2e05c7a-b154-4cbe-84ab-08da49ea4dfa X-MS-TrafficTypeDiagnostic: SA1PR02MB8639:EE_ X-Microsoft-Antispam-PRVS: x-proofpoint-crosstenant: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eXybWYmTMelYgA+QriG8b2QTNr+e7LqVXQndmHDq4MNns3j3nz/bpyP59IlaEYyM/4/w7t5ajHYBCwt3y6ViGDcI2JMJJWL1AW9BnGgat9ntgr+jGHe6SpXkgW1/j8wp207Mic5xHlEh3ecHPbLJgNPmhHuSLJ91Vm4gjZTGccjGuwU3qDlFKDehAJdfOHEzbAt5nHyILOQ3vxzUgq41clQFGRmZBIeE8LtfUpC/c71DHMjj148xjG9RXc2in1b6nog02GAPHQplpE7/Xr1wjcV6DbaJa35Va2SVodNy+qhqtnOaQ31Wq4FZicf8vCq0msdeXeqFHXwt0Nfvn1n8OHdGxIhkrIr4ly/hy0CGRTRB7L89i3SYgWNUG06J3zJh8Km1rIBiLmz3a+6mGBIQx5ANd6lKbt2cYny948Vb74sYGt+U7HylrUrgylPVyjERzHBVfnaCBVjq3xp+Y1XUXFY/UYNotHrD2yAZpienb3hFxPvyK0A6F5jYBz+Mi2THWUtmoUcX8nbuPNmbKmSV5OSTndOlfQTo2OKsbcHGc21+7DyASvW1A16oLPYwRGIrws5dtWmCIVtEpHuHcVQ58GZPhZeuzz1pEVTGOUcTe8lI2tPInT91npsbIajmsCLyLF+QYGuMIte+hRnqv4JsvAyZjkSDopyuPs7Nacc94hs3qv3+ZnBBK43vo9oqFhZ/ZVRDqtmiokvWIlwkkbOhNg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BYAPR02MB4343.namprd02.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(508600001)(107886003)(6666004)(1076003)(2906002)(8936002)(52116002)(86362001)(6506007)(186003)(5660300002)(83380400001)(6486002)(44832011)(38350700002)(26005)(38100700002)(36756003)(6512007)(2616005)(316002)(66556008)(66946007)(4326008)(6916009)(8676002)(66476007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?6j7eFEz+0hB0nJyfcW909p8I5EiQ?= =?utf-8?q?+58Wd8qL/dZLHtXpVWs3Jc1Ent379+naGH02Ha7ZHq/qsdJTY2GrOSlYm7QXNlKk8?= =?utf-8?q?ruEygTAEoV6BX232he443r97KWxcUeOXF1/JGjI0YtOStgAd1rpINid5QQ7LK44lT?= =?utf-8?q?molZ0TOgvrtz2e3WphZsgZ5Rjwg9ZeQb2ajxX/bh2RGfQqXmbUycKun2Iij3KHKfM?= =?utf-8?q?QLP6MRO+hxR8Dgfz8F4AXuTqf47Ez9Sgqlcc24r/BiSFom3rnEayrDKdTsG91x9z+?= =?utf-8?q?0v6QEAmFJtlaXkjkVPKSC3uG5OZbKB1HqDIqewx0ToyHFPrJ6ncEKqU5ItClu+Kxx?= =?utf-8?q?4uKk97BknySCOF0O/uOdz5HV8PWp03BbLQ457Su5E67SS1FTqfMMijyA1I9jIiI7k?= =?utf-8?q?NCwpojuOI/3KpGGFnVA6SgDpfFeVGaMaxHmiEzow5a8oldfgV+gtaNR/5ivwyBmtO?= =?utf-8?q?bifbwmDNPgvSa8x/WYfXFwj+n3Jep8/OrrS3roT5SBoFxnwaWhUGIbzfxaLAO8vts?= =?utf-8?q?9Xvcx/kgJ3QFLBV4QhCNL/T8xk14VwIl1AAVj2DrdUprbMqACTDujqxwpKJImcrFP?= =?utf-8?q?Om6GHxWUtttmkI0tNSPhS8tjzZx1CM3ql3va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SPAhmJp+aB9+90ZMQPZ6FgWDx66+flweDq?= =?utf-8?q?UWXHyR/YKmNFo3EP5XnCzPhwlsswH/3sk6l3KiiP+0/EZzcZH7g1CKsWIkfvBZOLi?= =?utf-8?q?WYiMgm4LjpRSAU2pXT+i2yVA8Y65Yc2yuzNHjLdTo+3NYfZxQ4hVW51jpxNhcHEHG?= =?utf-8?q?NjuE/1FZJiWAFfFrcjdaumQQSijlTvar4CQllN9Pn+jZMs+xL6Xfg=3D?= X-OriginatorOrg: nutanix.com X-MS-Exchange-CrossTenant-Network-Message-Id: c2e05c7a-b154-4cbe-84ab-08da49ea4dfa X-MS-Exchange-CrossTenant-AuthSource: BYAPR02MB4343.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jun 2022 07:33:10.6878 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: bb047546-786f-4de1-bd75-24e5b6f79043 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: WHUdBZIl61ubhUZtXDRZL81y3QFyY2PAavf6hFhI2/z4ksplU4QSsoGWroPWpdFGgeooyRgyiuzxWkFHwC9L/g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR02MB8639 X-Proofpoint-ORIG-GUID: eFMXHO4QSUrGHj4Ap1I7AN8U1A1aLlZD X-Proofpoint-GUID: eFMXHO4QSUrGHj4Ap1I7AN8U1A1aLlZD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-09_07,2022-06-07_02,2022-02-23_01 X-Proofpoint-Spam-Reason: safe Received-SPF: pass client-ip=148.163.151.68; envelope-from=het.gala@nutanix.com; helo=mx0a-002c1b01.pphosted.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 09 Jun 2022 09:30:28 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" As of now, the multi-FD feature supports connection over the default network only. This Patchset series is a Qemu side implementation of providing multiple interfaces support for multi-FD. This enables us to fully utilize dedicated or multiple NICs in case bonding of NICs is not possible. Introduction ------------- Multi-FD Qemu implementation currently supports connection only on the default network. This forbids us from advantages like: - Separating VM live migration traffic from the default network. - Fully utilize all NICs’ capacity in cases where creating a LACP bond (Link Aggregation Control Protocol) is not supported. Multi-interface with Multi-FD ----------------------------- Multiple-interface support over basic multi-FD has been implemented in the patches. Advantages of this implementation are: - Able to separate live migration traffic from default network interface by creating multiFD channels on ip addresses of multiple non-default interfaces. - Can optimize the number of multi-FD channels on a particular interface depending upon the network bandwidth limit on a particular interface. Implementation -------------- Earlier the 'migrate' qmp command: { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } } Modified qmp command: { "execute": "migrate", "arguments": { "uri": "tcp:0:4446", "multi-fd-uri-list": [ { "source-uri": "tcp::6900", "destination-uri": "tcp:0:4480", "multifd-channels": 4}, { "source-uri": "tcp:10.0.0.0: ", "destination-uri": "tcp:11.0.0.0:7789", "multifd-channels": 5} ] } } ------------------------------------------------------------------------------ Earlier the 'migrate-incoming' qmp command: { "execute": "migrate-incoming", "arguments": { "uri": "tcp::4446" } } Modified 'migrate-incoming' qmp command: { "execute": "migrate-incoming", "arguments": {"uri": "tcp::6789", "multi-fd-uri-list" : [ {"destination-uri" : "tcp::6900", "multifd-channels": 4}, {"destination-uri" : "tcp:11.0.0.0:7789", "multifd-channels": 5} ] } } ------------------------------------------------------------------------------ Introduced a new flag while spawning a qemu process for 'migrate-incoming' ip addresses (-multi-fd-incoming flag): -multi-fd-incoming "tcp::6900:4,tcp:11.0.0.0:7789:5" --- Het Gala (4): Modifying ‘migrate’ qmp command to add multi-FD socket on particular source and destination pair Adding multi-interface support for multi-FD on destination side Establishing connection between any non-default source and destination pair Adding support for multi-FD connections dynamically chardev/char-socket.c | 4 +- include/io/channel-socket.h | 26 ++-- include/qapi/util.h | 10 ++ include/qemu/sockets.h | 6 +- io/channel-socket.c | 50 +++++-- migration/migration.c | 211 ++++++++++++++++++++++------ migration/migration.h | 3 +- migration/multifd.c | 42 +++--- migration/socket.c | 119 ++++++++++++---- migration/socket.h | 24 +++- monitor/hmp-cmds.c | 68 ++++----- nbd/client-connection.c | 2 +- qapi/migration.json | 92 +++++++++--- qapi/qapi-util.c | 27 ++++ qemu-nbd.c | 4 +- qemu-options.hx | 18 +++ scsi/pr-manager-helper.c | 1 + softmmu/vl.c | 30 +++- tests/unit/test-char.c | 8 +- tests/unit/test-io-channel-socket.c | 4 +- tests/unit/test-util-sockets.c | 16 +-- ui/input-barrier.c | 2 +- ui/vnc.c | 3 +- util/qemu-sockets.c | 71 +++++++--- 24 files changed, 626 insertions(+), 215 deletions(-)