From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0068.outbound.protection.outlook.com [104.47.1.68]) by dpdk.org (Postfix) with ESMTP id 997F41B1D0 for ; Thu, 25 Jan 2018 17:20:04 +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=kvreIwlTx0PuI7qlRjVG3sB4S/a9QJWbWTcyh1Q0KFI=; b=Kwl8FjNyH6Y2ialF6fyEyzLGCV2gOaHLVKVFjF/36tNO+Y9RT/0Qax8sYd/FV4+5IRZutnkrpe4WxdKZ6ItpW9sorvyH8tVVmOikHbt+ViIuyOSXO1SWSWG2axJupTfXxWbu8JOMmrJ6QhlnbsJaYrkaNa6Dxd1tfSveAbJlXuA= Received: from mellanox.com (37.142.13.130) by AM4PR05MB3201.eurprd05.prod.outlook.com (2603:10a6:205:3::30) 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 16:20:03 +0000 From: Moti Haimovsky To: gaetan.rivet@6wind.com, ferruh.yigit@intel.com Cc: dev@dpdk.org, Moti Haimovsky Date: Thu, 25 Jan 2018 18:19:29 +0200 Message-Id: <1516897172-81448-1-git-send-email-motih@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1516867635-67104-4-git-send-email-motih@mellanox.com> References: <1516867635-67104-4-git-send-email-motih@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0202CA0008.eurprd02.prod.outlook.com (2603:10a6:803:14::21) To AM4PR05MB3201.eurprd05.prod.outlook.com (2603:10a6:205:3::30) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9d021896-ab4a-43e5-9e7d-08d5640f7dba X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:AM4PR05MB3201; X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3201; 3:drSUYilhq+2x7rLX/9URub7Ei4P0iGeYp5D6XpQfhI2VOfl9Asi2eNHf255PVZQ5aYHUl5euiialN5ZPv9fMUVtwpEc2Ljj1RDYEbjBY1xQFp+uU4+sWyKUnE0nG0+hCkGXg9kLotD/XNnJT5Vq37/+Tmf6TySpWDXJrsT4Pe+mYJkibUTYnrmHkso4adISgI33jV5PE5zqKrJdIxFbceuYQdaawwAxW06V6qnIIoW07O9yVsp3bzh4GO5JlF5iS; 25:q1fk+JmmBVM+3Cp/tQx11c6thyMmtx2fsp68BrodQV5fGClR94bmUs9ExrArhpeaVE1DNg5pRe4uFjj7szFBlr378T5S1Tva3zRrHvJNH7NB8TRwYiOdeBg1U8VJVdTfTtVAzKRFjGLLJfTInZhBdpsQcaTC9JwBlZjf+44G1PTT32j9Epf5wzR7eH10c5GYy7/16ZBwhWWx6NbBM0dG1ZJ+GPbrG3FTvzWPnotLi09Ddq/34tp1hEXhWgnLZraLdnhSjRecRdpLt0OAqvwcDIn5kUXyOlRdNJilRFcXi28JPwFGAmtIwah34vUadE2HWD1zRELKfRY9Qogg9+D6HQ==; 31:3zhl6qR8759YwnKm/mTNnWkGD8ep0xsVxHXXUfTPeKxAHTEDXK/I0BBjEnWqR080mfWb5Fh9LvrFHhlopDe2OJ4V28MhPveBO3Srlmxhr0/9rEcZKu2h8/7enIfKcCdvbT1fp1yVmniv+Bv2DGJWXER4DaFxP2vZKhZ5FDuw76j/u1gAQb0OPuH7mdZ7FuqeMTpgkcBy+65exO+JOMwvug5L01aQ8yNdYAAwHkwRip8= X-MS-TrafficTypeDiagnostic: AM4PR05MB3201: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=motih@mellanox.com; X-Microsoft-Exchange-Diagnostics: 1; AM4PR05MB3201; 20:7nmWoacWNF35MfW3MC5hEyBc0Sd25ovMHNd0hwPIppV8EKR0S/ePgCIwxC41LiNBRQGviuZRMXvng1R5TIowODm72s2MfxzYxqwr6JXYJNINsKH4xCsj07htfpD3HZxp2JoQEaW6tZHLQCU6TY++GUUhJN5rjxnxJcUkpEJB8FcAkcsMYi4BpbvmrTjSoKPnKTqVW0/HvIj5A1/2gbtiDcTe+M6Sq1EewxX1VBx5On0MrquxbI/qxMbzXilU5R7Ia3hVsJMwn8H1Hv4sO+QEgkh4bOdm9TU+RVn31i8i0Leoe9BpJEK1wrnTaDjWgx4b3ORORXFkiEbPr4Xq6lDtRDX7e1p1NuMFcMoxNi3unhAnBOCmK+yLXh75cUvM/m3FLMnrnm5hzjsB1bJ9BznRyl/ho75QWwbDxBOudbUMa/1ECIq7VNZVpoZxQhjCNhJMFa9zAYTnTYeZd3gdEeH/BwbeC8weXmWExdz+aeBVVQ52dHpCYnROh4z2v76B873p; 4:/1FBIk9qXWE463ez4kbOXn1rcC7OV6P+Rl3X86npPWjG6Wrf4l83Q+DiMkvjkggH8V4wAgRsV3ObIx2Ab7siZrpee1r9FgUgT/UJlgNp535pRj357HaOG3FuA5G1Kr2nPmo9S77QdJK2H9oaULRTvRTtCn5Ou6F5HfHbXCyTZF4xvvMYPf8l74wNNViZ4SVz+REvfbhHjrDi9vgVum9O4J24qAScI5L3L3jA8GjAJDbZrhkmOVsTXDlop4xbBUJxBKg5bUKcNeaRxtc/nt7XBEjjlZvOxT6R0EQ8IbOpt24h7T0mQmamsf9EjO2YuQHJ 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)(10201501046)(93006095)(93001095)(3002001)(3231056)(2400081)(944501161)(6055026)(6041288)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:AM4PR05MB3201; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB3201; X-Forefront-PRVS: 0563F2E8B7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(39380400002)(376002)(346002)(366004)(189003)(199004)(16526018)(97736004)(76176011)(52116002)(6116002)(3846002)(7696005)(106356001)(26005)(51416003)(4720700003)(68736007)(21086003)(316002)(16586007)(69596002)(105586002)(186003)(107886003)(478600001)(6666003)(2950100002)(5660300001)(33026002)(25786009)(48376002)(47776003)(66066001)(386003)(50466002)(55016002)(86362001)(8936002)(7736002)(59450400001)(2906002)(36756003)(4326008)(53936002)(50226002)(305945005)(81166006)(8676002)(81156014); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3201; 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; AM4PR05MB3201; 23:hTWRJgwsMrZUwkkAnF10TVf9ZGkUitPmYqZjojYqZ?= =?us-ascii?Q?iD+dSY8HSWVIsF2dYojVAvx41Pdk8bXYN2Jfcwz7u7ii9/n8yqhKVR0EbNfy?= =?us-ascii?Q?2aLrOpWsQbxDxGZZpVivWrZXN20vg6u+SZ/8ktdO7ur5I2lXPsCKPTGa7clI?= =?us-ascii?Q?EQjxrxdKRQHubJ2ammT0NFiAT+OW0lgBheCG0rI4f8HU1q5nVzAqGYQnlRVW?= =?us-ascii?Q?w1mlo4yHPFoP2RzJN0QmWTrSTEvUaq12S1tPHhzrGez1RKufYb06etqsnwiS?= =?us-ascii?Q?m6aO/+xkEfOgIJ2iENuRzON9yVOLbjQJjZh5XNuKOqxzoZnXydDmFwL8YrHb?= =?us-ascii?Q?QQ6c94ouACa//OugclbdTo5ACqgAr6s1LpTG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5f5QgIjMq8dF61iIlJaTBLYqhP2WNlSLb6prbxJRRYMd5A/1qIB86f5vpxONeNe0Siw69JSzhhYVPJ6nwhShuzpTmfgHfLF1Q1og5/UyuKvRCj3kwbFWkHPXta2HFCv83FWUYKIxJKraiL57eXHBwyFd3bwiQ03WSGZhvqJP2FiBbBldD+kdSVBjHg8I2FaX7MpcletRWn45ortbP6ycJcMUaZakQwEcoZG7WL8TYLvf8PbwNURp0m6JYABpxlCsaTEtYjGMR7Fgvy/bNOTdVJJbw7G0rFbNfFVSj3JfJvr6X83LsbFpsJOT8EYes0gLCbuXmReSmPKCxi13occo1h7iK/hGPqKj/Sh+UjWcrA=; 5:WISHc75EWolIJniTyTxavCriT5EpxfTAJFiDrPUOzTgzznIT5/KBDL06ROArhdKOd3mu06qXn0w/Oy+mMgSVBitlOghz8VwScNiyQ1WzDao+CEDAtd4QG1SdjUPuKrHXBgJdNmH5Uhf0q9FU1WBQNedJ+3UbObibIt0oPM1n5xs=; 24:7RUPojq3opZbnNZhGzxemELRTjZOwMKKXxOJBc+MsDXggCEMspcpQQeuOcTn93qk7eWoA+KPirxiJQQ6RA07dIYJUwWI52Sw40OvAXnImWU=; 7:1ucDkBmB77nFv//abh1LC9Qvq3cMGQGuRVKRUZ+aMxjswdo9OG+56UCWPMq8lmjjZXvEpNW4m1OXKaYgQgb93DwWJU8sYFh5HeXn0epwvonBr7ngqbC8mL0C+Nvy9Dk4rxdo8ey+MJc1WCTgGlNUeZWGHNi0WbMwK9K9KbIOiVqMqEB83HKupZgmFK4bACjnFThgimCbFhpJNZPCZXRNN0UhEyLfPT/4WQKPOuS0YR+4XLj56VZJwQKv6YY08aQz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jan 2018 16:20:03.1337 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9d021896-ab4a-43e5-9e7d-08d5640f7dba X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3201 Subject: [dpdk-dev] [PATCH v8 0/3] net/failsafe: add Rx interrupts support 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 16:20:04 -0000 These three patches 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. Moti Haimovsky (3): net/failsafe: register as an Rx interrupt mode PMD net/failsafe: slaves Rx interrupts registration net/failsafe: add Rx interrupts --- V8: Modifications according to inputs from Ferruh Yigit. See each patch for details. V7: Fixed compilation errors in FreeBSD. See 1516810328-39383-3-git-send-email-motih@mellanox.com V6: * Added a wrapper around epoll_create1 since it is not supported in FreeBSD. See: 1516193643-130838-1-git-send-email-motih@mellanox.com * 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. --- doc/guides/nics/features/failsafe.ini | 1 + drivers/net/failsafe/Makefile | 6 + drivers/net/failsafe/failsafe.c | 4 + drivers/net/failsafe/failsafe_ether.c | 1 + drivers/net/failsafe/failsafe_intr.c | 536 ++++++++++++++++++++++++++++++++ drivers/net/failsafe/failsafe_ops.c | 101 ++++++ drivers/net/failsafe/failsafe_private.h | 40 +++ 7 files changed, 689 insertions(+) create mode 100644 drivers/net/failsafe/failsafe_intr.c -- 1.8.3.1