From patchwork Sat Dec 22 09:50:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcel Apfelbaum X-Patchwork-Id: 10741289 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9F2AF6C2 for ; Sat, 22 Dec 2018 10:14:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DD782894E for ; Sat, 22 Dec 2018 10:14:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8267028952; Sat, 22 Dec 2018 10:14:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.7 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 720722894E for ; Sat, 22 Dec 2018 10:14:33 +0000 (UTC) Received: from localhost ([::1]:39581 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gaeIi-00083I-Jt for patchwork-qemu-devel@patchwork.kernel.org; Sat, 22 Dec 2018 05:14:32 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41796) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gadwN-0006Zb-D1 for qemu-devel@nongnu.org; Sat, 22 Dec 2018 04:51:28 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gadwI-0006hn-PW for qemu-devel@nongnu.org; Sat, 22 Dec 2018 04:51:26 -0500 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]:36113) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gadwE-0006Zw-R6 for qemu-devel@nongnu.org; Sat, 22 Dec 2018 04:51:19 -0500 Received: by mail-wm1-x344.google.com with SMTP id p6so7872086wmc.1 for ; Sat, 22 Dec 2018 01:51:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=nDuB47FVILPnmCoO2u7YwnDtswJQciP8HVfrc0G/x8E=; b=AyDFLZA3Q6ejTLMvYRSltlCS55tbCFrsp7QpJjO0ACxc0cW6mShY1JB1kSdKALlGgY LVjGsz7q+q9uU1cQFDNhUcNu8qrohFaHgWY9dBJpkYCo87mDrrFGgs7CIsbMSoHGEJmG pTb9jAtHBzw3p10UvTcVJUcTkuGrkPWoKaZUTRpb/S0LCfx1ShJSYNmdUn7WLxuYdSQX 83SwX9V3FvKPaW7LMV0PESgL4WVfwijWkZZsCxwv6FglCHj2iuf73C2qP7LXTq67qQ6T UfZUaLT+D5Jwq5aq1Z0Q6EbbbLmWAjzB9BjeWSj83Z7ENDNXKxwMA0PJ1ZQv65eyRr6e 4vCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=nDuB47FVILPnmCoO2u7YwnDtswJQciP8HVfrc0G/x8E=; b=WsgQKRyRpuFDRid9TdS3jj3LmLW+5PGBjEa6c2KlmRv2pVWI/sQvnIRf28/RprtryG hvLRvTE2AVDQPc9gumTv84bhFGTh/iiH67DLta8zK6f047ERGnOKR7tB2Yew8R1HHXfX ASS7HA2RyS0FeLwmCO0E4NH5hqt9kWMLRUlA+lSfbKZ+AQCgULrmDwfVypIb9/6Kl3JP n3xHmWHHXvC7xVs6lYrIS7wBj/a7YjDi4zts2x/rlUqknSc6CXIX1y4C5/Eg9Z90Rmyg bw+V3ALMQXg4bZ7OqoBZFPL13Kv+HjhiPtIrrnoafTENctVyuFYf4S1JWC6rSQYj8ICi PMrA== X-Gm-Message-State: AJcUukdL+dFtnOPXz+aSmNZPi6+0YpTUE6lFBNI0cdtpZy9VfNW1tlPl KFunETxF/MYoAtJFJ2VR8NZwvCHA X-Google-Smtp-Source: AFSGD/WVGvHBH4i0zqNzz7ajheTlg1mubRwFdDbRvL1WsBEZ+u6quhrS4Th8muz3gpDSgpQcxztI/g== X-Received: by 2002:a1c:aa0f:: with SMTP id t15mr5804089wme.108.1545472272663; Sat, 22 Dec 2018 01:51:12 -0800 (PST) Received: from localhost.localdomain ([176.228.155.165]) by smtp.gmail.com with ESMTPSA id s3sm9557371wmj.23.2018.12.22.01.51.11 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 22 Dec 2018 01:51:12 -0800 (PST) From: Marcel Apfelbaum To: qemu-devel@nongnu.org, peter.maydell@linaro.org Date: Sat, 22 Dec 2018 11:50:28 +0200 Message-Id: <20181222095036.29743-24-marcel.apfelbaum@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181222095036.29743-1-marcel.apfelbaum@gmail.com> References: <20181222095036.29743-1-marcel.apfelbaum@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::344 Subject: [Qemu-devel] [PATCH PULL 23/31] hw/rdma: Do not call rdma_backend_del_gid on an empty gid X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: yuval.shaia@oracle.com, pjp@fedoraproject.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Yuval Shaia When device goes down the function fini_ports loops over all entries in gid table regardless of the fact whether entry is valid or not. In case that entry is not valid we'd like to skip from any further processing in backend device. Signed-off-by: Yuval Shaia Reviewed-by: Marcel Apfelbaum Signed-off-by: Marcel Apfelbaum --- hw/rdma/rdma_rm.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/rdma/rdma_rm.c b/hw/rdma/rdma_rm.c index ca127c8c26..f5b1295890 100644 --- a/hw/rdma/rdma_rm.c +++ b/hw/rdma/rdma_rm.c @@ -555,6 +555,10 @@ int rdma_rm_del_gid(RdmaDeviceResources *dev_res, RdmaBackendDev *backend_dev, { int rc; + if (!dev_res->port.gid_tbl[gid_idx].gid.global.interface_id) { + return 0; + } + rc = rdma_backend_del_gid(backend_dev, ifname, &dev_res->port.gid_tbl[gid_idx].gid); if (rc) {