[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: Julien Grall <julien@xxxxxxx>
- From: Rahul Singh <Rahul.Singh@xxxxxxx>
- Date: Wed, 6 Jul 2022 11:57:57 +0000
- Accept-language: en-US
- Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
- Arc-message-signature: i=2; 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=2ir3P2/8WVexRwE51Kmdee/xJgZjqwnO7nCx9vvwS8w=; b=f7dwJKqCu7JSjWL1VchoZK/SKLAH6mOIQuzgTNBdoXXM3iJu1jx0gskbfqyKhnAPd4jWgyuRgc35SWP91TxNItL7AuO9kqupiOpCwzK6IgPBmiD92kPb4jWp33NdWBX68aNJ9wpK1qpRp09tzAWVf1sMyyEVgG7KI/m9QoOlC5Jb88aFhoJZq8Rt/2SJzwdj1SH53/ntmyBWnvpgHKQYwZxljkgbHTh86Pu4MBgyZx75LY72Vl3CDGox1xAs7LFtGvGyuGN/71WCHpHNs+8E9BYQKZ9Z+G4prNMkSTCeq7saZ0c6DOa5Z50XDO+mt4Vj/Cp9grGwwD40lMmtsMyWRg==
- 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=2ir3P2/8WVexRwE51Kmdee/xJgZjqwnO7nCx9vvwS8w=; b=PVF9WPoHWaLd7htjOv/dfEK1UmVxJRZSma0ye6xj206PyOo+nMqBc+xFtXtxuDv/P0BaMFQUKksc7pJo0qVV9cxm9RlQSO3kLMYKbiLo7z69OkB/3/eakrnPTBZu+tEr06EIk84Xa9pwwJ/3PcBp0RO0XxdqDb+ekrrP9W7miMSc9f7fgD3n99aIaJYPApRbVWYXKAig7REmtvZQng1YomHDh4+jLx9uAG04Z5GS/0CRvr/e7fZQQ+6kOQBMA+bQ27P9zVz6cxdCViElPm8PJ6LR8rPiDo+39V5OpEwLFrAI8GKMe6NJV5KqGn9ZKB1UzzYtwPSdwXveYkpXaBwYfA==
- Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=QAblQtGZEDVFY9RjGJ2AweEX5Ej+OJ0jg4i/ZIK8iT1hIPsvUKhBbZKsD/pFBDrJwV1AvVfWIAsvVBhxGSQYB3F+vOQyG0kVNhJaucgMC+nMm2Q6hn/0pIroFzBCz3B21z9WaWahYGcZFYYqAmmOAsEpnpb7icPqxLTWiMDGUPP6j2bXr59FdOyr8ywCeutSVwiMy2GWC2X8evajsfgLQR9LCkMyXyFSvXgTfaq6xI1ytBOw8FnrFKgp95fjWSRcBU2bZX6ogUDa6CQrsHs6zvmy5x0WtDOacK0CshTaO/RRc9x5bIasGRQaZLIu+8e0oXbKn1Z/9+S5xqc+jn2qUg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Bnj++qHnUZYFMkOAJaDV3jyy7yjZzDUMgZZkwc6Lz2C98N6ylf+7R+QSc6dOX44h90r7jGWrLSgO4xMS40ZPNuXENW+tyOlLTgRZqzO67RXRiE7rj5Yxs8qE/YLAY3eODc/WDDGHAK9jGtsfNvUp8AsURO7USq/ccAZrJCtMLXWFKEyKcriU02OvZAVraVAUsDIPuin8/qAg1HfavVVShtULfrN3llLc1xDWgdDFLe8XiciGyxfpbs6DvM6X2R6vWAMOfXyQssnUazeVSwbdA5MmcKE3M3Cfkl98MwyF/cpIdvVfHbHB/3AArKyT55WDsE62ChR+EiaqH7FGCRgVfQ==
- Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Cc: Jan Beulich <jbeulich@xxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- Delivery-date: Wed, 06 Jul 2022 11:58:29 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
- Thread-index: AQHYhkXgFvoQlpdPN0O1CKuVc36nOK1v9mEAgAADLoCAAVkogA==
- Thread-topic: [PATCH 3/8] xen/evtchn: modify evtchn_bind_interdomain to allocate specified port
Hi Julien,
> On 5 Jul 2022, at 4:22 pm, Julien Grall <julien@xxxxxxx> wrote:
>
> Hi Jan,
>
> On 05/07/2022 16:11, Jan Beulich wrote:
>> 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).
>
> I think the code below would be suitable. I can send it or Rahul can re-use
> the commit [1]:
Thanks for the code. I will include this patch in next version.
Regards,
Rahul
|