From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10088.outbound.protection.outlook.com [40.107.1.88]) by dpdk.org (Postfix) with ESMTP id 8C6791B16F for ; Thu, 25 Jan 2018 09:07:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=+95vRD9g0/smNnoMfkD09ACPgK5VvbzXOBppqhd2LkE=; b=m/oh6yDG57ts69pp3O4uvURoWM03MF/AcDBHdp4N4i9+0lEozfLvA449ZtS+oUuOV42dykUY64wsLUtp9pi5sGTJLxmMK2uvBoRB48ZkVLWlZNpg3irjgJdGGx3eBNohk/tTltNS9tJXqiCXA9MJtRg8lDypjVPqhzQ5J7jN0ug= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=motih@mellanox.com; Received: from mellanox.com (37.142.13.130) by DB6PR05MB3206.eurprd05.prod.outlook.com (2603:10a6:6:1a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.444.14; Thu, 25 Jan 2018 08:07:34 +0000 From: Moti Haimovsky To: gaetan.rivet@6wind.com, ferruh.yigit@intel.com Cc: dev@dpdk.org, Moti Haimovsky Date: Thu, 25 Jan 2018 10:07:15 +0200 Message-Id: <1516867635-67104-4-git-send-email-motih@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1516867635-67104-1-git-send-email-motih@mellanox.com> References: <1516810328-39383-3-git-send-email-motih@mellanox.com> <1516867635-67104-1-git-send-email-motih@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0102CA0036.eurprd01.prod.exchangelabs.com (2603:10a6:802::49) To DB6PR05MB3206.eurprd05.prod.outlook.com (2603:10a6:6:1a::32) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d861ba10-2a16-4874-55a1-08d563cab15a X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603307)(7153060)(7193020); SRVR:DB6PR05MB3206; X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3206; 3:HOHWyesqqC4H+VjoBwRKnB2aK95KCAozSBJwUdYVKdXs7ue3EKBnIaa+EnMVHfCPXZjnRm8+Ko0h44EDFSL9T3M/SJIL7rtL9UVtnsZfjcDb3QQ78ZGhc1C03hlpQ0r9Ez0Xh9JZRP86HYIm/EUzG2KyoGy7jfTLEgzLQHzQCjj/aPd7HaPFHvRpfAyrcNbSLWOVU8FPqnUpd59W+iqtw4OwAjHYK6dnC4hSnRl5k+fS9Ys+nL3gHcP1hAvx6ds/; 25:b1u1Tqt40S7YEaiB4a6S3NOW06DOrFa2DBPLhyOKl5o2E6vqEwZcyqEBYOobLefd/sjxFK88+uV/w4Xb3EiRLHn2pH2Y88h9TBvax9BBojtilffOkzx1+H/bSB2EQS4th3HPruKg/A0mvpXd35eLHde2FRJx2XGtFftZob8SwzI9uNE7qQHAplcfvIvJ6+XXEYL4Ej4DAuLaoVqkqXMIwLEvkY71GSStXXljF8IKHULODmy0aFnAY7hrdFyvl3zfhWdnTKkXE8Uq/CUDQJqAFBOIqYXFBLF7LOxd3ta0XwmEFEMjMhMiIvkNrWxt0R9E4htxMwKsOCg0uoXLtFawZA==; 31:LGY0ry0HQ95zaegbRYRo2XdwVal6EykT7EKSw8tvKre/Q+ctpdca6l1jnksNJJfrTrC9eqBpDSLs+qOyO3Kq1BrVGRYga+f8hHQ0dw+RGMjcxUWfYGtS5kXhotIs4QiJ0YXJJAqKzTs3ACDK+Ps/ulILev4/7z+dZutZpNp9cdAZ1Pcs3Vsoog12T4jra3dx0t0IwI5ipdsJX/Zqln6hWsUPPBFcnUQCRblNdQ0r1Nk= X-MS-TrafficTypeDiagnostic: DB6PR05MB3206: X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3206; 20:Wkb9FLSJSq2/Jvnub2CnPfBkv3UivZi5BCr45eMxkCV2SiWLnstON8on7xHlLpVV78RPCYzvaV013dxWhCoEEjLWTmVUQqP0BYfO9KMhkD715tSJawcjlhiLtUUcZhgrQnlHEaspNQa646KBuXWNNZzYqjQBE4m2i/qilyL/+63752QIEeBNbqSNQydbno3aodTLEtbAIMjrYqNjdbNiAqKPvpX7AZW+bnx+BiBUX26SFfokBtp3+VU2BkdexTc9wGeze0lwcChbFm6NvLgfJpUd9zET/OkxjJgEOQjzC9liWAROZEXsMOpoODud4zs74Gg2B00M7wQcZ46990U52mIBSqXe2t7dLrA5uq7UyGn0hlqGV5u5keyUAennRSka/GnCRmiHGBjRCM8Sdu1OemlmTxH4V8zyxnzifqw3HzMEOa/5Uoyara7zPh5bo+YtWDYlWHR2BrMt+PAPz6o4eoHbryt/jOhXvQVDYjxRDtD1o2marPBkaVBLfTQWlWpf; 4:bBPsRfwrG5cem9kF//BbqQ93TdxulM7x+u9YbnMUjXZN8RwT+pRYnpMbpOskQ5lAUqN2HbOTxwyg7YlhR+TBndTxeSngRk5w8N87s8t7vS9yTFWI/eXca4Bg9E9G8BYv0IRPx3FVxff8O5M//RWNAG0wbD5+a2GuUI4AXGw3Cpx9BwbD3GgsYiAi3ShQKiu1fu4z/s/8yyvdjZKknwfvasCPHiytn4KolbjKZ3dQ4L6xY82t53gz6UUX2SuouMbOanyMsT+D+x6yrDCvts7F3N3cOfPJRcMdTOSJRpn4GQIxEsvhceG9l+XDGeFOtSNn X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3231023)(2400081)(944501161)(10201501046)(3002001)(93006095)(93001095)(6055026)(6041288)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB6PR05MB3206; BCL:0; PCL:0; RULEID:; SRVR:DB6PR05MB3206; X-Forefront-PRVS: 0563F2E8B7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39380400002)(376002)(396003)(366004)(39860400002)(189003)(199004)(36756003)(26005)(69596002)(2906002)(305945005)(6116002)(7736002)(5660300001)(3846002)(76176011)(97736004)(7696005)(52116002)(16526018)(51416003)(316002)(59450400001)(386003)(86362001)(6666003)(16586007)(105586002)(4326008)(21086003)(107886003)(8936002)(50226002)(8676002)(81166006)(81156014)(2950100002)(106356001)(68736007)(33026002)(53936002)(66066001)(4720700003)(47776003)(48376002)(478600001)(50466002)(25786009)(55016002)(186003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR05MB3206; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR05MB3206; 23:d0FppClsibeVXTWioqzVbcwd4mZnjWX4Q5ArhqBLV?= =?us-ascii?Q?w6sxGbHbLPcW5qWXKsuiJdjnuPsL7dv/4NExGUg1zaDaTOwZMeEhHinrnXDV?= =?us-ascii?Q?+6DwFPPNaXQAo+6xIGH57+FHOzqEJTnkZ9qTil5PiYg7e+K2i77vddwE0dlp?= =?us-ascii?Q?3xwNHkpmdFi1gYg73YpQSd4ULj0Z/uF7kg+H+ButEuWcRh8PhYeFGJdZiqIf?= =?us-ascii?Q?KVBkubm1bTO8DcuS1+ZQ13X//xKAJpKn0kezz61JW37PHqJBooenMQOYNgTY?= =?us-ascii?Q?AGOS/nTAmOB5YOgM2aKa2DjygIEhxP3LX174wm+ckHSR9AhgG1jwnWowcgMf?= =?us-ascii?Q?qC0H8hR170ilG/AC/xKCHXfQ4jgXHH4vpW6vqfXJYMmhgaX42hf+Mv23pEvE?= =?us-ascii?Q?hGmqqdHZ0TNi9vA5PhgVNxH2/p5V5qeVQBqwkk+k5paCFEN4Pxu7eOzSENrp?= =?us-ascii?Q?J7bhv9q6Wwl7C1AnIzjuJgLH2gg+l7PF+Ov3NYuej9TRb28n9VmFTu3Mvlyc?= =?us-ascii?Q?nMmcPm8+VZ6Bcogjz6h41pEVec6mt8cvLVsilEHn7cNELNxfcsGIcCH9aQ0g?= =?us-ascii?Q?UcbN7I9hdeXN1Rvw8TLW/noXWoCIChCtiD0D6bomIp/MbANBI+UadohdgDeU?= =?us-ascii?Q?mnokQz7jTXwsGdEH2bAombLVGg0Gc/cZJ1j7vIefVOHeRNabCOg76Ml6b8j3?= =?us-ascii?Q?adZOeVWJ7j0A08ckhqJbPRe/iQQQsir7tS0KLeAZvSD/C2KrMM9HJi+lnxi5?= =?us-ascii?Q?VSG+WG2e7VKiWB9xkvQe/xcB//6DG6/kEHX525f3gta9dZf7yWgb473V2IWT?= =?us-ascii?Q?lOEBhwLZDSnorwLAOwpi+it4ZqV4G0C0WuFLfyqQimZZL6IaU8cUbmGHX1De?= =?us-ascii?Q?coff8J3J9l2Infwt4Fnv+WMd8+5Jvd7pUNYie336hk4IK4gvxjhK//t/Niu1?= =?us-ascii?Q?vaasemP3adAauCzSsWbECll/nq3I4X6Ug1fJitWUS2x3S7vO6VOE6fgQs25E?= =?us-ascii?Q?maLbigpCpfgb9RvwgvnKFvVoHXrqmYEHVj0xkLjb6MqWW5nE6VZYiXv6xwWX?= =?us-ascii?Q?z6RmicJGY3ZetZo7CjB4w9OazwvwJLSD69mr9dS8OeFayXAnV2L1e+Om2vVG?= =?us-ascii?Q?6G1pJKKzwlIe9rwGC51W6L5fCb60M6Kw8abbrhABAm6MqG38F0N4PF/XeLR2?= =?us-ascii?Q?xZnsvUtn5DK1ozGDJY2RXFChwxVD07TqNE/?= X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3206; 6:0VXjPq4/gIBCVp8tC4jp9nIOeKEZ3g9mYaSWndFPJRTcIzCkd0AO5V5bfr07s1j1ZqwaxaXGtKNvjcmLBdH3owyzfrHxmEMvaj5iKxmYVE8B2fw/v4VELdMOLTeLDcoj/SVuUk6nirSSvZDHD4Ge9hf91G1gsY4o8h58nSuH9m4xJ/BdZzs7c7eNJDzh85F8vuH7KWW/jAPJKCLk6++D6KUSza4qo6i1YMy4rd3HwWHt1m6pgIA9RZCU/PJQA1t+omeJoWbng0beLH1c7iAWLwkuVfM9HmVjGQXvtXlK9ydNmESh3zWsw/7GDf5DIp5++YxV281up6vxxNRKxaguMDSIg857McmzIY8YmXzOlyg=; 5:OKY8Xx+pmBnO48htpOb/EQ5UKj4LlvV3MJU1V9LFN8m9KuBvJpsRPu5ifBV2Fk8WhrSN7o+kWMtw30fSzf5yFYRh/2Zm90o0SIRzBb3hXTcYMbMvwebmbX/k0Kz8qdUl6s6sXXSJZixwLJ7BTkBbdlzeG6exDCX4ar+W/Vj2+2g=; 24:hZ/f21PIZQHHvqxnbfGrDH1bkFHSolO9wvquSv2CMy637402z0K4rHX8TPLm88qRsmf2GwcSaPOrRVl+OQNNtpFTh9wuCxfsnml/sqTJo4k=; 7:Xtv6eqa/5T7TJuGLIUj3qOmLUfMYEMBxMo74IgpTLJfPAxhfFngYJE44lpFo/n0gJ1DexsPltMiIonPJKgmsFXhAq+vKz6wdnL0ky2HKPDXIvEduEPVk1BxDu5PNsCBN+ci52hpDjQ+h1Qo0wGF9a9DfFt0legEBgWS8VB29f1rakdIkwboqHl7c7w3TlAjZD1fIhZ1yajSkletjQ4anxFHgDDmEvkm4f0JugpcvHiTaEZy3EGeMrd68123cuY9U SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2018 08:07:34.4074 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d861ba10-2a16-4874-55a1-08d563cab15a X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR05MB3206 Subject: [dpdk-dev] [PATCH v7 3/3] net/failsafe: add Rx interrupts X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jan 2018 08:07:38 -0000 This patch is the last patch in the series of patches aimed to add support for registering and waiting for Rx interrupts in failsafe PMD. This allows applications to wait for Rx events from the PMD using the DPDK rte_epoll subsystem. The failsafe PMD presents to the application a facade of a single device to be handled by the application while internally it manages several devices on behalf of the application including packets transmission and reception. The Proposed failsafe Rx interrupt scheme follows this approach. The failsafe PMD will present the application with a single set of Rx interrupt vectors representing the failsafe Rx queues, while internally it will serve as an interrupt proxy for its subdevices. will allow applications to wait for Rx traffic from the failsafe PMD by registering and waiting for Rx events from its Rx queues. In order to support this the following is suggested: * Every Rx queue in the failsafe (virtual) device will be assigned * a Linux event file descriptor (efd) and an enable_interrupts flag. * The failsafe PMD will fill in its rte_intr_handle structure with the Rx efds assigned previously and register them with the EAL. * The failsafe driver will create a private epoll fd (epfd) and * will allocate enough space to handle all the Rx events from all its subdevices. * Acting as an application, for each Rx queue in each active subdevice the failsafe will: o Register the Rx queue with the EAL. o Pass the EAL the failsafe private epoll fd as the epfd to register the Rx queue event on. o Pass the EAL, as a parameter, the pointer to the failsafe Rx queue that handles this Rx queue. o Using the DPDK service callbacks, the failsafe PMD will launch an Rx proxy service that will Wait on the epoll fd for Rx events from the sub-devices. o For each Rx event received the proxy service will - Retrieve the pointer to failsafe Rx queue that handles this subdevice Rx queue from the user info returned by the EAL. - Trigger a failsafe Rx event on that queue by writing to the event fd unless interrupts are disabled for that queue. * The failsafe pmd will also implement the rx_queue_intr_enable * and rx_queue_intr_disable routines that will enable and disable Rx interrupts respectively on both on the failsafe and its subdevices. Signed-off-by: Moti Haimovsky --- V6: Separated between routines' variables definition and initialization according to guidelines from Gaetan Rivet. V5: Modified code and split the patch into three patches in accordance to inputs from Gaetan Rivet in reply to 1516354344-13495-2-git-send-email-motih@mellanox.com V4: Fixed merge conflicts found during integration with other failsafe patches (See cover letter). V3: Fixed build failures in FreeBSD10.3_64 V2: Modifications according to inputs from Stephen Hemminger: * Removed unneeded (void *) casting. Fixed coding style warning. --- drivers/net/failsafe/failsafe_intr.c | 169 ++++++++++++++++++++++++++++++++ drivers/net/failsafe/failsafe_ops.c | 6 ++ drivers/net/failsafe/failsafe_private.h | 17 +++- 3 files changed, 191 insertions(+), 1 deletion(-) diff --git a/drivers/net/failsafe/failsafe_intr.c b/drivers/net/failsafe/failsafe_intr.c index 8f8f129..c58289b 100644 --- a/drivers/net/failsafe/failsafe_intr.c +++ b/drivers/net/failsafe/failsafe_intr.c @@ -9,12 +9,176 @@ #include +#include +#include +#include +#include +#include +#include +#include + #include "failsafe_epoll.h" #include "failsafe_private.h" #define NUM_RX_PROXIES (FAILSAFE_MAX_ETHPORTS * RTE_MAX_RXTX_INTR_VEC_ID) /** + * Install failsafe Rx event proxy service. + * The Rx event proxy is the service that listens to Rx events from the + * subdevices and triggers failsafe Rx events accordingly. + * + * @param priv + * Pointer to failsafe private structure. + * @return + * 0 on success, negative errno value otherwise. + */ +static int +fs_rx_event_proxy_routine(void *data) +{ + struct fs_priv *priv; + struct rxq *rxq; + struct rte_epoll_event *events; + uint64_t u64; + int i, n; + int rc = 0; + + u64 = 1; + priv = data; + events = priv->rxp.evec; + n = rte_epoll_wait(priv->rxp.efd, events, NUM_RX_PROXIES, -1); + for (i = 0; i < n; i++) { + rxq = events[i].epdata.data; + if (rxq->enable_events && rxq->event_fd != -1) { + if (write(rxq->event_fd, &u64, sizeof(u64)) != + sizeof(u64)) { + ERROR("Failed to proxy Rx event to socket %d", + rxq->event_fd); + rc = -EIO; + } + } + } + return rc; +} + +/** + * Uninstall failsafe Rx event proxy service. + * + * @param priv + * Pointer to failsafe private structure. + */ +static void +fs_rx_event_proxy_service_uninstall(struct fs_priv *priv) +{ + /* Unregister the event service. */ + switch (priv->rxp.sstate) { + case SS_RUNNING: + rte_service_map_lcore_set(priv->rxp.sid, priv->rxp.scid, 0); + /* fall through */ + case SS_READY: + rte_service_runstate_set(priv->rxp.sid, 0); + rte_service_set_stats_enable(priv->rxp.sid, 0); + rte_service_component_runstate_set(priv->rxp.sid, 0); + /* fall through */ + case SS_REGISTERED: + rte_service_component_unregister(priv->rxp.sid); + /* fall through */ + default: + break; + } +} + +/** + * Install the failsafe Rx event proxy service. + * + * @param priv + * Pointer to failsafe private structure. + * @return + * 0 on success, negative errno value otherwise. + */ +static int +fs_rx_event_proxy_service_install(struct fs_priv *priv) +{ + struct rte_service_spec service; + int32_t num_service_cores; + int ret = 0; + + num_service_cores = rte_service_lcore_count(); + if (num_service_cores <= 0) { + ERROR("Failed to install Rx interrupts, " + "no service core found"); + return -ENOTSUP; + } + /* prepare service info */ + memset(&service, 0, sizeof(struct rte_service_spec)); + snprintf(service.name, sizeof(service.name), "%s_Rx_service", + priv->dev->data->name); + service.socket_id = priv->dev->data->numa_node; + service.callback = fs_rx_event_proxy_routine; + service.callback_userdata = (void *)priv; + + if (priv->rxp.sstate == SS_NO_SERVICE) { + uint32_t service_core_list[num_service_cores]; + + /* get a service core to work with */ + ret = rte_service_lcore_list(service_core_list, + num_service_cores); + if (ret <= 0) { + ERROR("Failed to install Rx interrupts, " + "service core list empty or corrupted"); + return -ENOTSUP; + } + priv->rxp.scid = service_core_list[0]; + ret = rte_service_lcore_add(priv->rxp.scid); + if (ret && ret != -EALREADY) { + ERROR("Failed adding service core"); + return ret; + } + /* service core may be in "stopped" state, start it */ + ret = rte_service_lcore_start(priv->rxp.scid); + if (ret && (ret != -EALREADY)) { + ERROR("Failed to install Rx interrupts, " + "service core not started"); + return ret; + } + /* register our service */ + int32_t ret = rte_service_component_register(&service, + &priv->rxp.sid); + if (ret) { + ERROR("service register() failed"); + return -ENOEXEC; + } + priv->rxp.sstate = SS_REGISTERED; + /* run the service */ + ret = rte_service_component_runstate_set(priv->rxp.sid, 1); + if (ret < 0) { + ERROR("Failed Setting component runstate\n"); + return ret; + } + ret = rte_service_set_stats_enable(priv->rxp.sid, 1); + if (ret < 0) { + ERROR("Failed enabling stats\n"); + return ret; + } + ret = rte_service_runstate_set(priv->rxp.sid, 1); + if (ret < 0) { + ERROR("Failed to run service\n"); + return ret; + } + priv->rxp.sstate = SS_READY; + /* map the service with the service core */ + ret = rte_service_map_lcore_set(priv->rxp.sid, + priv->rxp.scid, 1); + if (ret) { + ERROR("Failed to install Rx interrupts, " + "could not map service core"); + return ret; + } + priv->rxp.sstate = SS_RUNNING; + } + return 0; +} + +/** * Install failsafe Rx event proxy subsystem. * This is the way the failsafe PMD generates Rx events on behalf of its * subdevices. @@ -47,6 +211,10 @@ rc = -ENOMEM; goto error; } + if (fs_rx_event_proxy_service_install(priv) < 0) { + rc = -rte_errno; + goto error; + } return 0; error: if (priv->rxp.efd >= 0) { @@ -191,6 +359,7 @@ void failsafe_rx_intr_uninstall_subdevice(struct sub_device *sdev) static void fs_rx_event_proxy_uninstall(struct fs_priv *priv) { + fs_rx_event_proxy_service_uninstall(priv); if (priv->rxp.evec != NULL) { free(priv->rxp.evec); priv->rxp.evec = NULL; diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index 2ea9cdd..840024c 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -435,6 +435,12 @@ rte_errno = EINVAL; return -rte_errno; } + /* Fail if proxy service is nor running. */ + if (PRIV(dev)->rxp.sstate != SS_RUNNING) { + ERROR("failsafe interrupt services are not running"); + rte_errno = EAGAIN; + return -rte_errno; + } rxq->enable_events = 1; FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_ACTIVE) { ret = rte_eth_dev_rx_intr_enable(PORT_ID(sdev), idx); diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h index ff78b9f..5d328ff 100644 --- a/drivers/net/failsafe/failsafe_private.h +++ b/drivers/net/failsafe/failsafe_private.h @@ -61,6 +61,13 @@ #define DEVARGS_MAXLEN 4096 +enum rxp_service_state { + SS_NO_SERVICE = 0, + SS_REGISTERED, + SS_READY, + SS_RUNNING, +}; + /* TYPES */ struct rx_proxy { @@ -68,6 +75,11 @@ struct rx_proxy { int efd; /* event vector to be used by epoll */ struct rte_epoll_event *evec; + /* rte service id */ + uint32_t sid; + /* service core id */ + uint32_t scid; + enum rxp_service_state sstate; }; struct rxq { @@ -169,7 +181,10 @@ struct fs_priv { * Rx interrupts/events proxy. * The PMD issues Rx events to the EAL on behalf of its subdevices, * it does that by registering an event-fd for each of its queues with - * the EAL. + * the EAL. A PMD service thread listens to all the Rx events from the + * subdevices, when an Rx event is issued by a subdevice it will be + * caught by this service with will trigger an Rx event in the + * appropriate failsafe Rx queue. */ struct rx_proxy rxp; unsigned int pending_alarm:1; /* An alarm is pending */ -- 1.8.3.1