[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/5] vPCI/MSI-X: fold clearing of entry->updated


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 28 Dec 2020 18:43:04 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1DkWZnDB5Vb49IecYhR41T3/sayS+eDaI6ygtN9QVTY=; b=Pj8HV3nq0gW4Ovq4zWbwwD6vNZY/Jy91XLsqFJz1o22BxsiEdhSXvdWqnwT6zNAP9v38bomgBXZUX3drppyGTZiXYBA5cLDgQFRxrm5HKu1chKmwUa22HtynWdlvpBn6C0WdeS2aYivnAqY8RPQaxeRIN0d6ovLujLdfWE9qMyEPii48/GPtjQSasD0p1ueB/KSedf9aXfn+O4bQjBOFdQHjp6tFes7uVHpyChX8t2BBrQXrYWppHK/ERoffTjRQfVWzZJUNVMe0bLtKJhekn0+FdE4QpPJK2x8x7S2f0NbrYeJGxXEZcdzm7Pa3X+LH7jsoegeZt1CcWUV9Bv3v5w==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=G7uxKkjGJc1nIg84dBBa1Din7JaChr5d3X1wM7UfCVUrmvGyTxjUON4tGrPGPBawraagRLU+WPuP5ZsThRdlEuj6FOwIN7LWubdK1MJDPAJughcW24JUMT4xeyw92OY7K2p++e3i1/LGyPjnvGrPWe22zn9DyTl2sYfNiEEqoX5+J+P7ESMCXNF/0vj0hlgmZXBcZeCI9bM43czt8ppoiALSpa70/NRUIQHUGM+3iPXzSt8yyCcFPDPrrVYJYA3W5Y9FOH/STBaAxRBJZCWPD1QSMllpLjq1wauNHp31Rb3zAE4CZkEoKha2Yvm6qE1hfgGpV1PDe1Jtvbqnx6WtZA==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Andrew Cooper" <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 28 Dec 2020 17:43:21 +0000
  • Ironport-sdr: Pq+LK4usiSH/rLe3Q30nypa0tyHGmIdOYXH6qWCxlJ4XnNAyR81ZKT70Vv0wOK1OYJVXxcWz3v iYQeSxU2kPjZ8AZ6vWHnUBOOqvHswBoMM0Kx3sa/ZzR9u5ayLnGiJ9CGQOB1L5Fq0vTepZwKLI RgP86G6PvVywCjRY15fyIXvtuvrYteWoV7f96kHsSy4wFhJD9gsrm6svO4joX/K1F7c6DvpiPg xTwvrMeJayQa9rH24nZaia+ttGmUi2Q+3I+FLDJE0q/UZcNtJlEfRnL0MaUbSZqc3uf/QdA78v LNI=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, Dec 07, 2020 at 11:37:51AM +0100, Jan Beulich wrote:
> Both call sites clear the flag after a successfull call to
> update_entry(). This can be simplified by moving the clearing into the
> function, onto its success path.

The point of returning a value was to set the updated field, as there
was no failure log message printed by the callers.

> Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
> ---
> As a result it becomes clear that the return value of the function is of
> no interest to either of the callers. I'm not sure whether ditching it
> is the right thing to do, or whether this rather hints at some problem.

I think you should make the function void as part of this change,
there's a log message printed by update_entry in the failure case
which IMO should be enough.

There's not much else callers can do AFAICT.

> --- a/xen/drivers/vpci/msix.c
> +++ b/xen/drivers/vpci/msix.c
> @@ -64,6 +64,8 @@ static int update_entry(struct vpci_msix
>          return rc;
>      }
>  
> +    entry->updated = false;
> +
>      return 0;
>  }
>  
> @@ -92,13 +94,8 @@ static void control_write(const struct p
>      if ( new_enabled && !new_masked && (!msix->enabled || msix->masked) )
>      {
>          for ( i = 0; i < msix->max_entries; i++ )
> -        {
> -            if ( msix->entries[i].masked || !msix->entries[i].updated ||
> -                 update_entry(&msix->entries[i], pdev, i) )
> -                continue;
> -
> -            msix->entries[i].updated = false;
> -        }
> +            if ( !msix->entries[i].masked && msix->entries[i].updated )
> +                update_entry(&msix->entries[i], pdev, i);
>      }
>      else if ( !new_enabled && msix->enabled )
>      {
> @@ -365,10 +362,7 @@ static int msix_write(struct vcpu *v, un
>               * data fields Xen needs to disable and enable the entry in order
>               * to pick up the changes.
>               */
> -            if ( update_entry(entry, pdev, vmsix_entry_nr(msix, entry)) )
> -                break;
> -
> -            entry->updated = false;
> +            update_entry(entry, pdev, vmsix_entry_nr(msix, entry));
>          }

You can also drop this braces now if you feel like.

Thanks, Roger.



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.