From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gNzfj-0005c5-Pp for qemu-devel@nongnu.org; Sat, 17 Nov 2018 07:26:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gNzfj-00032n-44 for qemu-devel@nongnu.org; Sat, 17 Nov 2018 07:25:59 -0500 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]:35557) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gNzfi-00030v-Th for qemu-devel@nongnu.org; Sat, 17 Nov 2018 07:25:59 -0500 Received: by mail-wm1-x342.google.com with SMTP id t15-v6so1054592wmt.0 for ; Sat, 17 Nov 2018 04:25:58 -0800 (PST) References: <20181113071336.6242-1-yuval.shaia@oracle.com> <20181113071336.6242-23-yuval.shaia@oracle.com> From: Marcel Apfelbaum Message-ID: Date: Sat, 17 Nov 2018 14:25:55 +0200 MIME-Version: 1.0 In-Reply-To: <20181113071336.6242-23-yuval.shaia@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Subject: Re: [Qemu-devel] [PATCH v3 22/23] hw/rdma: Do not call rdma_backend_del_gid on an empty gid List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yuval Shaia , dmitry.fleytman@gmail.com, jasowang@redhat.com, eblake@redhat.com, armbru@redhat.com, pbonzini@redhat.com, qemu-devel@nongnu.org, shamir.rabinovitch@oracle.com, cohuck@redhat.com On 11/13/18 9:13 AM, Yuval Shaia wrote: > 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 > --- > 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 35a96d9a64..e3f6b2f6ea 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 < 0) { Reviewed-by: Marcel Apfelbaum Thanks, Marcel