From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50041.outbound.protection.outlook.com [40.107.5.41]) by dpdk.org (Postfix) with ESMTP id C29E21B2C7 for ; Tue, 23 Jan 2018 19:43:51 +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=4q4QCx7A4B66Eco3nicxbwBVxPsp2dj3yUvP19lvrxE=; b=jq/5G87yjIW5aIdFL3fesTsJsmfR/NXbZNyeAYohbp8+NHZUoKvuJRn9OcNRwloJoPqnNAYl+AliV7pLV/36s27wTkOJUaFiQrRLv+tzGrwJkhfjpNHCbo8Np/Bcy0vBLZo7e65e6atnY68ns7UFdOofHWD6Ufqi8yqrkcXY90o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=motih@mellanox.com; Received: from mellanox.com (37.142.13.130) by HE1PR05MB3211.eurprd05.prod.outlook.com (2603:10a6:7:36::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Tue, 23 Jan 2018 18:43:45 +0000 From: Moti Haimovsky To: gaetan.rivet@6wind.com, ferruh.yigit@intel.com Cc: dev@dpdk.org, Moti Haimovsky Date: Tue, 23 Jan 2018 20:43:20 +0200 Message-Id: <1516733000-1850-4-git-send-email-motih@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1516733000-1850-1-git-send-email-motih@mellanox.com> References: <1516354344-13495-2-git-send-email-motih@mellanox.com> <1516733000-1850-1-git-send-email-motih@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: DB3PR0202CA0025.eurprd02.prod.outlook.com (2603:10a6:8:1::38) To HE1PR05MB3211.eurprd05.prod.outlook.com (2603:10a6:7:36::33) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 86b84d89-ed91-4528-f3ce-08d562913c10 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:HE1PR05MB3211; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3211; 3:fWQ/TnY+VotNl0C7QPUEhPZG7NZqfFxfFs+iuC0G7A6zqqZoIqgpwcxgNGWrJBBCLuqPYFSAVgt/Jz4xY8C5hZ5Mce36+u86onhf12WmBgNaxpB/F6hR9Q4hdIEc0BAOKedBuhlb/1EX2y+oOC6t22k5phJy226q2NGm3r2SoJ7EbuZ3+feGasHp8E2pWfze2vbdndHIToKKjIxB4p9HePd4/SihbBnBXfTrMDxmPh1iOgurPLLCKGaps1rOgD4H; 25:Cf9vb8h4R0AcaPKgQhO1+CxWQfZG0w24czKXJKqotOXeMKYoHGRRuzSSBO6x5mieCHJQ6zprXv10vSIsm5mCkjC2AMx1fNCHS4b9kbDx98C0d4gf3aakw6UMk0gCr8ED+HwfQA5ZvbWLwtvY5RP08xmxO2jDLLqFUmyD1/q4zm/3LtBgTm6PPc0BH5cYwKsp64w8vvEcIjc9ZEt5dSToL93i2Pc+XgEIKadDNNIUnhPXNUoyup3fGHkUoB5D5GH4g1lFyFTXfCyXV4YaUCElMZhOKRf01JGXig2Cd1ZFR7EAg4T/oW8UfXpcYqn/PUGP8ccfp76fcl+H3G8rf2d9Jg==; 31:axNixmcOpFz7UjYxJ0Szk8DrhGpeTLVbWKDvSYTnxIbx9Om5H0VNYL7LOSzQ4vqji2w+O+ChrftbW4CRsuKNgNRUwWvb+vEHS32GBb4PTrtm00QWBBjgHgnqKu5PgU3xZ3gqJZGTWGlepxDMf/9lv1VkqkbkF9My+DxJeiMq+t4SyM1rt6AiyzcyrQL8FWOzKl9iSXcfe2exrOkyCYB4KkKDD86m+QCLAKBfdEkLO8s= X-MS-TrafficTypeDiagnostic: HE1PR05MB3211: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3211; 20:IxmVtYRX2RckiyxNb9oavFanq8I0YH9CyodBTcp+djr27yWHmkaEQhjHzHReJhli6mZjIgkuLMpXptXmdEL/VAoQXFB+dJcAY1mQPKDpV98C0k3F31QCGzlQ/jhaOGezkWIIRqFLduAQLK885Wb2YVX3upU5lZxWuR3J84Qx4WZZHNztsF4CnxiI27MCYpLOfROaIsHdusmmXcJ9qdnHMHX6ymsiHkVI1QTDNh01XOfQTJey4yHrz6FlHjq4c2XvBKRzx+7fy5TNO0FQqTVFVJ5aeM5UQOjRrHnDiG7vwHCYMGaVy9F73SRf+/3wW7DVP/DelxFl0fK9bF6dF2YLuB6Cd7yk8T3k4vQVxKjHE3MXtLff+69r5zn9nSXiiJEt+HfZqEDMiH+P2pSKt5loW6GnFfw0He/zOf3btVTRBWZSrWByp6LZAkUvsaNFQIMHp0LMWuy2LqlouT9VjSPIy4M8LXKC4EoTcLLq8o/Pnw9DEd0qpRqqyPV4uSftNCRW; 4:YxuolzIAsRPlP/ofBuO8Mcp3UBv0EHJGDHH248kl1saweaI57LizErmNm4Hf1FmWoQmdm6h8vCjWm0ORP5fzc8mWUDqKxqLKrjYt5I/KG7cqBENfPCxI600FLj7OBk8DVkTib97tVvV5i+IGwXHazf2r1PhvhvDvheh/Mfk/TWqiG+DQ6WxizNilOtCjbtVCN7azv2ny6hvAuJEhVQKWtTN4sJfo8blweBFAL/k0MWRwc3VdTl/H1iiZYEumM18ufDIOkdXyEDkiSFU+cIZnqR7HDAh/IgP5lF7oV8DQZU8azvnW+YE/uxs0QxK26S9Q 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)(93006095)(93001095)(10201501046)(3002001)(6055026)(6041288)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(6072148)(201708071742011); SRVR:HE1PR05MB3211; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR05MB3211; X-Forefront-PRVS: 05610E64EE X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(39380400002)(376002)(366004)(396003)(199004)(189003)(7696005)(21086003)(16526018)(52116002)(51416003)(68736007)(3846002)(6116002)(25786009)(76176011)(66066001)(106356001)(86362001)(26005)(55016002)(53936002)(7736002)(386003)(69596002)(316002)(47776003)(59450400001)(97736004)(81166006)(81156014)(4720700003)(8676002)(8936002)(5660300001)(50466002)(105586002)(2950100002)(6666003)(50226002)(305945005)(478600001)(16586007)(2906002)(48376002)(33026002)(107886003)(4326008)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB3211; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; HE1PR05MB3211; 23:T1Pip4s4kZ8XyZdqpaoFASSzzt8NnBp9obDjkzQlJ?= =?us-ascii?Q?7q3w5ptavET5oK+ccVjfzcLE3Woi5od6JpIlo73LFCJlbEnhsYmF6H8AJqKZ?= =?us-ascii?Q?fMXbjGW6kShSUYMKTiYgnwcu16bpGKz5WCrloJ/jear0pr+ac7ixSLb4uzxa?= =?us-ascii?Q?b6xYnf2B+jf75uywNMvpBl31B7srOjwbmLqrEC/oOUVORWohQvgWO7E57tOc?= =?us-ascii?Q?XeWup7mVwFALPryp1wEmM2q8rwCqdJsI05I9rtfyZNbkkGNG8dKIMVZ2zjRz?= =?us-ascii?Q?7F832FTZYVoZMYCEzY7i/JscmRTx3891IaXOTY1eZ1BGhR5fI9Q289XxalsK?= =?us-ascii?Q?5lMcfVOHBDrQC0t6DD7oa8HyR/TCVqfKB4YJp2L7CpzemQcCrCLkiXk639VN?= =?us-ascii?Q?KSh602DINJpHviZjZ5W9XXAReReKsZOVCGWxQYkJcz9zA5e2VyNxrh3bhgNm?= =?us-ascii?Q?duZDe/LptdsHjWz85JlPamlqFBALAuyO98Jrj9WRQYaGaBpWPI/O56u22eZI?= =?us-ascii?Q?y6P18gyXQMmZxTEJLOm7VBNgRU85ac96cEOjJQeHKMr7N1KsXuFGl0x2bbXt?= =?us-ascii?Q?IDkMp+d+n/Lykn/uZTE9gr+wqC/jM3c3LozsW5PcRb/AUIvHJUcGsukTZ2R3?= =?us-ascii?Q?P6BNB+hAdLNXOcReM3CK4CF29iwpMOANQQ2xXex1+9mfFyySL65sqAyZDmZC?= =?us-ascii?Q?9aIjuUqF81JC8ufY4fM3U+rajsxornAByiDvKwtjhGXpKpB5rAIqE6w1FbvD?= =?us-ascii?Q?45o7EZh19oZg34XSRRnJWJZvARgF9yzDdAgLwi3VwAJ6Ury91KGfoblL9tA5?= =?us-ascii?Q?wehxTagrQ78wKl4OSOham61AVj9T5I93yzde3P4Ew6UJq/78dacsTwmWlc5T?= =?us-ascii?Q?p49DO6AE/SbbAUEJWt39SGe+WfdfSxxC/xf6PmtjVSqXmJXHMRQGwUpJUNJe?= =?us-ascii?Q?jrmosRFCAmx0+19FciC2RTOkzRHKSli9WrWO+GRuoi7da3tqnMUWOByvo9yA?= =?us-ascii?Q?KwaEAWojvoboZoR0krjWGYHyswmWILj8EYFQ4dcCJ2tj60pk32ay6n7f+SwX?= =?us-ascii?Q?cKZ8BhXqXcieLyV1ym8bgaD/zAYGsuMne2F9W9DKLTKI4VMbJ4son9bw1apJ?= =?us-ascii?Q?LwV01UAtQ6s7jSVMTHnzB0WstUYUTlmTfg2pkehhCFa3LiBlejh1Xr4ZXdDE?= =?us-ascii?Q?QUXYUb5UdchN0s=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3211; 6:+9u5TQGDL0hHwbBkxxEtujTGOYhWsQcqQoK90c7OR8TwMOIIIhj1EZ1llHEP08Gseii9KLzfLaW2EWyTcavJlV5S8aSigdIv1MnSEAVbWor9XXssZcHEpeMy9rvLn6EfpcCWZs36allF2cZQZ6YqiMVMq3IYX/akwBUqYjmkL9aozJ8PTHx1bxTLh3+xbEhHvzEVhVLHX+bsAdvB8h/wDvl4GOYupowCFIlmfolCTrjvRMqij1QlImUikwuHlPiTVI0COWcfHIqDeQ69PTnN41K1Kop0ZByBeoI1/0eVpRnoefpXfvnOPxOO6W0YHsEU0DLtC5R0q2rY1iVcNqleMH6V2nonPG5+1sHN/iLenU4=; 5:e3gLXpI6HPV7ycDMiN8r6LfaW1dQhdH7bsdoOpRDnNnhQr+SKGVHvS8DvdD3MtoOLNmnQj7hTGZpCKPwP+oFCZIXC9fgNwrcN/kaGgPvHVVzVhCZuvS9P+8b6xTCFaIsisWqSd0CCihhCYlnB4+saY/nHjpLlR8IQk3XeWMMZjo=; 24:a1P46QIdgndB9eX38lrSPP7FX4+Ro6kMeZHqzhaI+HouWLyiPX3D1plVjJmzwV4v0oli1n/Iacj/mTatswZCz222eeDeSfrXeo0Nmbcgk8s=; 7:iaJTGVt240ABH4PHRvjcN7iNS0UZ8vq3NIga2h4EcscLCLxyG6G2UAfo7+9YqHPog/e7UqJcIxG67eH16w+8cD3f7SJAue4U/JOIKUYr/NVc8g2pcnHpijNKAQyrKel5M4BptV8zQfIgF3YhUCqALppZt0dPtzK9nucedgCVFFf5roHb8/MagrS+C9eHxi6LBLSQW9IK7A/TFrYYF1gPSuwcjmlqX7EWEpl+09RLgeQenavCz3hi9cMYQ/2VFAaG SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2018 18:43:45.0473 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 86b84d89-ed91-4528-f3ce-08d562913c10 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB3211 Subject: [dpdk-dev] [PATCH v5 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: Tue, 23 Jan 2018 18:43:52 -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 --- 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 | 164 ++++++++++++++++++++++++++++++++ drivers/net/failsafe/failsafe_ops.c | 6 ++ drivers/net/failsafe/failsafe_private.h | 17 +++- 3 files changed, 186 insertions(+), 1 deletion(-) diff --git a/drivers/net/failsafe/failsafe_intr.c b/drivers/net/failsafe/failsafe_intr.c index 2f18b3d..2a84e81 100644 --- a/drivers/net/failsafe/failsafe_intr.c +++ b/drivers/net/failsafe/failsafe_intr.c @@ -10,11 +10,170 @@ #include #include +#include +#include +#include +#include +#include +#include +#include + #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 = data; + struct rxq *rxq; + struct rte_epoll_event *events = priv->rxp.evec; + uint64_t u64 = 1; + int i, n, rc = 0; + + 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 = rte_service_lcore_count(); + int ret = 0; + + 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 +206,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) { @@ -189,6 +352,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