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

Re: [PATCH 3/8] xen/evtchn: modify evtchn_bind_interdomain to allocate specified port


  • To: Rahul Singh <rahul.singh@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 5 Jul 2022 17:11:12 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=q7cFpSc752YWFu6Rl59QKu7tT3qs8s+cHdzmIBFCvyg=; b=iuKCcGwqK/YHa4YV1XiYqi5RrNOsgkHfYvQG06CrrQpdhyHB/qsw66EjvUOhkv+zFyna74FzJkR9pgcs0ZxLMbPIYxaoX5Pexpm7Cfg+7BdxY5I5gEdnnHca/9CGGCbRqHrm6NX9Ip7euXPzpG/jqVkzPNLur8zEqS7KW5bwAbsabpwsDSWYIoD3Q8IkIOHdUBm7WitnVoIT/BmWc7DrXv1Nwk/gqsIwESFB6xjxG6bV4IEdVmTI7DPUtTi4Q58R2sJ0CRN/qXA4I4fDQZsjObcU6lfidDqrTCb+SYfuqOV6mjpa1SqsIpXvTuq00V7dHVOl8BFY6IkEGANQP+KAqQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m9+ZGyeTh+2/tFa1HxQiZFfANxidxlg+z1py2DZn4GzrAQVcliRnewG5xYpPewcLetSNPsvRzJ2KjCItWMpb+KlyS+sFRvqJmpF9F3g97NJwL1cx3QK0p2/yNIqHd+sWg/TcboadENR3VRR3q8N0JJ0TjRZPJmvoOYaXU0XOIiWZ+lfVzjRv10lkTO0LyHUZ/PsXQevIjBPmi1Co5YWHVcWMvZjfDN3+FE7h2TsxUM97mcknujYwVGr9wNA0VXvQvP3cnjkVyhHapedSgbJVRf3r5vEC++LFAK+KRmSFNyQdmJ5WUuWp3s2sFL/NvXL/A2E2z9qhRva7G8soTpPYfw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: bertrand.marquis@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 05 Jul 2022 15:11:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 22.06.2022 16:38, Rahul Singh wrote:
> @@ -387,8 +392,19 @@ int evtchn_bind_interdomain(evtchn_bind_interdomain_t 
> *bind)
>          spin_lock(&ld->event_lock);
>      }
>  
> -    if ( (lport = get_free_port(ld)) < 0 )
> -        ERROR_EXIT(lport);
> +    if ( lport != 0 )
> +    {
> +        if ( (rc = evtchn_allocate_port(ld, lport)) != 0 )
> +            ERROR_EXIT_DOM(rc, ld);
> +    }
> +    else
> +    {
> +        int alloc_port = get_free_port(ld);
> +
> +        if ( alloc_port < 0 )
> +            ERROR_EXIT_DOM(alloc_port, ld);
> +        lport = alloc_port;
> +    }

This is then the 3rd instance of this pattern. I think the logic
wants moving into get_free_port() (perhaps with a name change).

And of course like in the earlier patch the issue with sparse port
numbers needs to be resolved.

Jan



 


Rackspace

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