Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3785470ybh; Tue, 6 Aug 2019 01:17:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxV14q802XXWJi+pKbHAXqsLLf7Oo5eF1Jo3wABMuL70Z5cvFJZw5d4vyrMVr7d5H+tHpqK X-Received: by 2002:a17:902:724:: with SMTP id 33mr1918347pli.49.1565079438005; Tue, 06 Aug 2019 01:17:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565079437; cv=none; d=google.com; s=arc-20160816; b=ZKXrcZYZ/fEDRfgg2Ad+v0eEB11XjX+13roHB3GBkd6jwFV02mD51XoVg7BkP8PgSq 4BvvP9u7GFXp0+7ESN29ra3rkX8pitk+Mg1GBWnqYnd/npej4dkolpWucZc6nWbk+1Oy yIPBdV0H1Z1s+rK0u1PdpAVN5mUqSgfYrw1OddYFbxvPUMR9VV3HhNdofRwXfrSBlX03 /tGKt13UPIuvSXWHTfHh1HJcmkmbBJ5Iuwaog+p+eBsG206sPDH5t0koNEIp23hPRSby FRdxheg91impwDjDXjeoCyYVMW7dUen1P9w8f/gXKpkK2OfQcnCN8GO5kwKANbX0vKFA PF8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=gruBXRHHUg/bIreY7jXa+8MhrXLTqQ1roVYg6JoXPh0=; b=hxu/2f6iFPrPTIR/mCw574FKly6z70LskrU0wpjPdkdW6MgwzOeeK1TPdQAa4NFTbq 7g/FkKl2LPYx8nyyy8V8X4Tub9uJ/bDgc/hsyhH84JDzRfT6pLZ/4NAn0++6/clvNqyi x9BWeOMjgpos3ElHgp6vLR2KlGzj2sjgA2ZVHwXZ3BAxhzKiFRpuf+myE3J+kfMD9bI+ KFxZMrXNbxnsPoShrD/U7TXmKxp5gSGenzJX52rT7vB3J2+xSehxSsZ+gqJaj9PgD0d3 3+lLTIAw5xRcFQvxcZn6TDY6f5LBbMY3/y6BXGxrKwtj5cGCHsiVxMiweOHpWXG92CCM Sx2A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h10si47209834pfk.197.2019.08.06.01.16.38; Tue, 06 Aug 2019 01:17:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731789AbfHFIQE (ORCPT + 99 others); Tue, 6 Aug 2019 04:16:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49192 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727259AbfHFIQE (ORCPT ); Tue, 6 Aug 2019 04:16:04 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 09F9C2D6A3D; Tue, 6 Aug 2019 08:16:04 +0000 (UTC) Received: from gondolin (dhcp-192-181.str.redhat.com [10.33.192.181]) by smtp.corp.redhat.com (Postfix) with ESMTP id 583BC10016E8; Tue, 6 Aug 2019 08:15:58 +0000 (UTC) Date: Tue, 6 Aug 2019 10:15:56 +0200 From: Cornelia Huck To: Parav Pandit Cc: kvm@vger.kernel.org, wankhede@nvidia.com, linux-kernel@vger.kernel.org, alex.williamson@redhat.com, cjia@nvidia.com Subject: Re: [PATCH 1/2] vfio-mdev/mtty: Simplify interrupt generation Message-ID: <20190806101556.3ca75900.cohuck@redhat.com> In-Reply-To: <20190802065905.45239-2-parav@mellanox.com> References: <20190802065905.45239-1-parav@mellanox.com> <20190802065905.45239-2-parav@mellanox.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 06 Aug 2019 08:16:04 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2 Aug 2019 01:59:04 -0500 Parav Pandit wrote: > While generating interrupt, mdev_state is already available for which > interrupt is generated. > Instead of doing indirect way from state->device->uuid-> to searching > state linearly in linked list on every interrupt generation, > directly use the available state. > > Hence, simplify the code to use mdev_state and remove unused helper > function with that. > > Signed-off-by: Parav Pandit > --- > samples/vfio-mdev/mtty.c | 39 ++++++++------------------------------- > 1 file changed, 8 insertions(+), 31 deletions(-) This is sample code, so no high impact; but it makes sense to set a good example. Reviewed-by: Cornelia Huck