From nobody Mon May 20 15:50:04 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=ionos.com ARC-Seal: i=1; a=rsa-sha256; t=1645167416; cv=none; d=zohomail.com; s=zohoarc; b=RBNRfwGZHLqeyfdmaP1fMcSrW/ZMu6WXQLPi2YT5GufiSvEhRHRkFqDfAczBawAf+J8oz5K1jJoFYOXmTwt/CqeMHzfGnc59GzlNAmxSazg17kBtwv3vxa6PiAXIgHbsmTY+sK8PmMVPRhOMuFMNSOVwNBevR+6vCEcURWWIlMc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645167416; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=0Q4b8+cVjcRileKxrSlELVlgdaMDz31UhUctSWRv9rA=; b=Wj0/fd6lH3wzMWrrRb6NG3SeV8Q0Z3mWP0JDsHGWzxPgj+GUre8s9x5EE/hbs5kJda9IO9gWjF/CGSsuUDr7Xm1jGdhrvYsSz4vxg+yXqnHTwkvvHJUM9/s6TTv3lLHX0yquEZO2cDIYRs9Ukg2rLRKm9iaAWJyV0B0eC2GepZc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 164516741655635.000597689026904; Thu, 17 Feb 2022 22:56:56 -0800 (PST) Received: from localhost ([::1]:57594 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nKxCH-0004tX-LI for importer@patchew.org; Fri, 18 Feb 2022 01:56:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nKx8F-0003fE-58 for qemu-devel@nongnu.org; Fri, 18 Feb 2022 01:52:43 -0500 Received: from [2a00:1450:4864:20::535] (port=36839 helo=mail-ed1-x535.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nKx8B-0004gm-3L for qemu-devel@nongnu.org; Fri, 18 Feb 2022 01:52:42 -0500 Received: by mail-ed1-x535.google.com with SMTP id cm8so4130555edb.3 for ; Thu, 17 Feb 2022 22:52:37 -0800 (PST) Received: from jwang-Latitude-5491.fritz.box (200116b845b0f800acc0184cb7906b69.dip.versatel-1u1.de. [2001:16b8:45b0:f800:acc0:184c:b790:6b69]) by smtp.gmail.com with ESMTPSA id q5sm1888442ejc.115.2022.02.17.22.52.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Feb 2022 22:52:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0Q4b8+cVjcRileKxrSlELVlgdaMDz31UhUctSWRv9rA=; b=Fur8FUnQhZSRz9xdbUwg8kNJXTuS6Pfmz6gpNjVFAytYHwILBERdpm0z3WydlSQJvV ZXqXW16blB60yPUsVq/OB/otWhvHU3Kf4pQO+5xiskC3DmB4OUW7k3b1S1aSZuL+meFe aaMQmf2Y4ITWcxKy7oRlaxri3MN/vWvPfALeD+vcKcSL7clZf0wuM0oRhgzVkDDeLlLC cqVEjAGrDGkxOdXO9meW0ScAsrdsz0FQ6LKGJBguGEgaaTgiEBFNvdvhal0FsCrGT77T oZU3OrGMZwrVJ5MbXYJImk4+irk6rR5GwdfJ1P1e7d2rkhOndYXkcZ15JkMeo5nFR88+ fHIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0Q4b8+cVjcRileKxrSlELVlgdaMDz31UhUctSWRv9rA=; b=P06jJqSLqER26hIe7cuYYnB58av+QVLBWdD+HJM7z3bK+NXMFBdc1gSnOR5xUsd6cm XgFh/5i58MjE3l5UcpdrYi55tWa8k7iGa3GWJqlQPBt2hk4jpNmcAkVoeXnlxUt9a+do DzQqCygUtps9lB6B7ab4SnnhX9B5d450o9ECMhdu3xKq4+3Qk4ik5TqQSHbGyu9zUyTI wlCSRx1ZbT8FYcsZZCkSICdx24h/I0p0jnee4pcqSi0HwAndOX2tqqYhE+gInWXfDaeG D2O/v/Y/TO66HZJr747EFAcJtQXaAln/9Nt+9czwlrSxJykfPnVjWkI10VA3/GuDqwiO Rr4Q== X-Gm-Message-State: AOAM533KH0TavjHS4Bcpxy0zCTvICIfDLOWo9HHkyE9ZLD/Xdko6AS1k ck8Vg0+KvAm8hhDuH7kK3DJZpw== X-Google-Smtp-Source: ABdhPJw4SBRlOTGLyvaMGKKjdaBl8fKV8UZdYqQvDRzqCvWMYN5h+qSFTeSmIc7WtC7H4JsWV/b2tw== X-Received: by 2002:a05:6402:13c2:b0:410:8140:3178 with SMTP id a2-20020a05640213c200b0041081403178mr6507440edx.299.1645167155976; Thu, 17 Feb 2022 22:52:35 -0800 (PST) From: Jack Wang To: quintela@redhat.com, dgilbert@redhat.com Subject: [PATCH v3] migration/rdma: set the REUSEADDR option for destination Date: Fri, 18 Feb 2022 07:52:34 +0100 Message-Id: <20220218065234.7630-1-jinpu.wang@ionos.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::535 (failed) Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: permerror client-ip=2a00:1450:4864:20::535; envelope-from=jinpu.wang@ionos.com; helo=mail-ed1-x535.google.com X-Spam_score_int: -5 X-Spam_score: -0.6 X-Spam_bar: / X-Spam_report: (-0.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_PERMERROR=0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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: , Cc: qemu-devel@nongnu.org, pankaj.gupta@ionos.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @ionos.com) X-ZM-MESSAGEID: 1645167419695100001 Content-Type: text/plain; charset="utf-8" We hit following error during testing RDMA transport: in case of migration error, mgmt daemon pick one migration port, incoming rdma:[::]:8089: RDMA ERROR: Error: could not rdma_bind_addr Then try another -incoming rdma:[::]:8103, sometime it worked, sometimes need another try with other ports number. Set the REUSEADDR option for destination, This allow address could be reused to avoid rdma_bind_addr error out. Signed-off-by: Jack Wang Reviewed-by: Pankaj Gupta --- v3: add reviewed-by tags from David and Pankaj. v2: extend commit message as discussed with Pankaj and David --- migration/rdma.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/migration/rdma.c b/migration/rdma.c index c7c7a384875b..663e1fbb096d 100644 --- a/migration/rdma.c +++ b/migration/rdma.c @@ -2705,6 +2705,7 @@ static int qemu_rdma_dest_init(RDMAContext *rdma, Err= or **errp) char ip[40] =3D "unknown"; struct rdma_addrinfo *res, *e; char port_str[16]; + int reuse =3D 1; =20 for (idx =3D 0; idx < RDMA_WRID_MAX; idx++) { rdma->wr_data[idx].control_len =3D 0; @@ -2740,6 +2741,12 @@ static int qemu_rdma_dest_init(RDMAContext *rdma, Er= ror **errp) goto err_dest_init_bind_addr; } =20 + ret =3D rdma_set_option(listen_id, RDMA_OPTION_ID, RDMA_OPTION_ID_REUS= EADDR, + &reuse, sizeof reuse); + if (ret) { + ERROR(errp, "Error: could not set REUSEADDR option"); + goto err_dest_init_bind_addr; + } for (e =3D res; e !=3D NULL; e =3D e->ai_next) { inet_ntop(e->ai_family, &((struct sockaddr_in *) e->ai_dst_addr)->sin_addr, ip, sizeof= ip); --=20 2.25.1