From: Juan Quintela Subject: Re: [PATCH] vhost-net: fix reversed logic in mask notifiers Date: Tue, 25 May 2010 17:30:26 +0200 Message-ID: References: <20100525140043.GA19688@redhat.com> <20100525144239.GA26284@redhat.com> <20100525151913.GA26706@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: kvm@vger.kernel.org, amit.shah@redhat.com, kraxel@redhat.com To: "Michael S. Tsirkin" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:7775 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757090Ab0EYPac (ORCPT ); Tue, 25 May 2010 11:30:32 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o4PFUWru029463 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 25 May 2010 11:30:32 -0400 In-Reply-To: <20100525151913.GA26706@redhat.com> (Michael S. Tsirkin's message of "Tue, 25 May 2010 18:19:13 +0300") Sender: kvm-owner@vger.kernel.org List-ID: "Michael S. Tsirkin" wrote: > On Tue, May 25, 2010 at 04:58:15PM +0200, Juan Quintela wrote: >> "Michael S. Tsirkin" wrote: >> > On Tue, May 25, 2010 at 04:37:36PM +0200, Juan Quintela wrote: >> >> >> we have: >> >> >> >> if (msix_is_masked()) >> >> return 0 >> >> r = msix_mask_notifier(....., !msix_is_masked()); >> >> >> >> i.e. at that point msix_is_masked() is false, or we really, really needs >> >> locking. >> >> >> >> Puttting a !foo, when we know that it needs to be an 1 looks strange. >> >> >> >> Later, Juan. >> >> >> >> PD. Yes, I already asked in a previous version to just have two >> >> methods, mask/unmask. we now at call time which one we need. >> > >> > >> > I find msix_is_masked clearer here than true since you don't need >> > to look up definition to understand what this 'true' stands for. >> > The value is clear from code above. What do you think? >> >> I preffer the change, but it is up to you. >> >> at that point, we are using !msix_masked() to mean "true" >> >> i.e. we know that msix_masked() is false. What you want to do is "mask". >> >> Later, Juan. > > Right. I guess I'll keep it as is, when I look at it with a fresh mind > next time, I'll clean it all up. ok with me.