Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp10324546pxu; Tue, 29 Dec 2020 22:36:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZniuzw28hj4giSffLdenMcLWNWSTCmTuB1+ZCLn5plOmsg2PQZJIgKm85j9HloeiQI8n7 X-Received: by 2002:a17:906:34c3:: with SMTP id h3mr48143111ejb.132.1609310194754; Tue, 29 Dec 2020 22:36:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609310194; cv=none; d=google.com; s=arc-20160816; b=NYhy91P7dGjxGQWoTm+zt4+Z+FHkYqhSW+zlFyIKXQXFdpnaDwDRH/y8NE+e+tP/aR zSwqnyNaPUdjogsqQdaVJnWKVKFpJQ+0BUmWuz9utoGli5GimURbiw0xuoYWFoa7Quxq qxUPIVs+PdMhOJDFnscdpD0SAfWm43C9wEBNILaIRrck8H3z268LCpXc/eFcJAb2q38V DPgQMUltWAalPipb6RUIUqJ2yb02ljViQivYKVrUGpdLCFiemyJNEnBRGu3J990FWVZY UFWoHMOO0LPqN/pqD3lROOQxEIP57pK+27CH9vXcOPtOSWVf5k6UkGGYcwJLIe5zJD71 xtDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=eBNGzwi7egS/zPmLxQnZGEadManYeUMP6ZIVWQPjrak=; b=0yjK4zOXjfd+z2qldsuph5F7/YbdEUgP1ujxIj00ma5ETryeM+j/fviZ9697TrFhgE 6fIRxCsB7IhdRdr2RWDPvqgsZsUeDvfH74tDi3dJ/omKS868jN3B2HRWePmQeDFhUSmO 4NZVv/8Zjtbz8aSzqwYBMF6NOyHlILDNd5U83AaHgSQIlMm2BAzNnq4ot/5Kberry75V VIkUSsLcoVFsYyyaZOT2UCtO8f4MEl1j95oCPGDPF/zCVl88FylZTZqdfT6ilyZlNLvg EsAcLSzASKtvkYb+tjxAuiJtJm2rEGjbH/lLvq0Frw5O8mRxu3W8bLvvuJgmp882gSrc conQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P5usXa+Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u4si22452986edo.323.2020.12.29.22.36.12; Tue, 29 Dec 2020 22:36:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=P5usXa+Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726504AbgL3Gfi (ORCPT + 99 others); Wed, 30 Dec 2020 01:35:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:33609 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726144AbgL3Gfi (ORCPT ); Wed, 30 Dec 2020 01:35:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1609310051; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eBNGzwi7egS/zPmLxQnZGEadManYeUMP6ZIVWQPjrak=; b=P5usXa+QmI3wcm6gEQ4w3yEGKaY+SLYN8O7projkTa7BCaEuQmidwT5WqsEK3Qg7qwSHMU 9+PlhA+l9+6yU/I28WlcTtVum5ZOjyJVc4gkUmJ31ybs8C95vlhSJ8Ae4DSK/hFCJA2VeQ ZpOwQOFj6CNPnDTadezgVtnbMi7Br3s= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-293-wWbJRowYPJ6KjjyT4C-i_Q-1; Wed, 30 Dec 2020 01:34:10 -0500 X-MC-Unique: wWbJRowYPJ6KjjyT4C-i_Q-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 550E11005504; Wed, 30 Dec 2020 06:34:08 +0000 (UTC) Received: from [10.72.13.30] (ovpn-13-30.pek2.redhat.com [10.72.13.30]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61882709B7; Wed, 30 Dec 2020 06:33:54 +0000 (UTC) Subject: Re: [PATCH 11/21] vhost-vdpa: introduce asid based IOTLB To: Eli Cohen Cc: mst@redhat.com, eperezma@redhat.com, kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, lulu@redhat.com, eli@mellanox.com, lingshan.zhu@intel.com, rob.miller@broadcom.com, stefanha@redhat.com, sgarzare@redhat.com References: <20201216064818.48239-1-jasowang@redhat.com> <20201216064818.48239-12-jasowang@redhat.com> <20201229120504.GE195479@mtl-vdi-166.wap.labs.mlnx> From: Jason Wang Message-ID: Date: Wed, 30 Dec 2020 14:33:53 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201229120504.GE195479@mtl-vdi-166.wap.labs.mlnx> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/12/29 下午8:05, Eli Cohen wrote: >> + >> +static int vhost_vdpa_remove_as(struct vhost_vdpa *v, u32 asid) > The return value is never interpreted. I think it should either be made > void or return values checked. Right, will make it void. > >> +{ >> + struct vhost_vdpa_as *as = asid_to_as(v, asid); >> + >> + /* Remove default address space is not allowed */ >> + if (asid == 0) >> + return -EINVAL; > Can you explain why? I think you have a memory leak due to this as no > one will ever free as with id 0. > Looks like a bug. Will remove this. Thanks