From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20081.outbound.protection.outlook.com [40.107.2.81]) by dpdk.org (Postfix) with ESMTP id 647081B01D for ; Thu, 4 Jan 2018 20:51:25 +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=6EgoUqs0XU4b7/VS7klH/ynQtpnEVySL2eEvPPSlkoU=; b=cb3RM8b4JdYysjClAaKm1Pxzy1yT2oo9cI/33ZN9xHXQhETLoVJXOMW+vMBV5aysn0yE9PhVmDNn7lBjspXSR09dmzhYqf6v2+82B3cST+CTgp7V8r6zXyMtiZtRXTRou3sex3ooJZKAAiXITSgKmOVporAF+K/3Olq7gZ51wEc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=motih@mellanox.com; Received: from mellanox.com (37.142.13.130) by DB6PR05MB3208.eurprd05.prod.outlook.com (2603:10a6:6:1b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Thu, 4 Jan 2018 19:51:23 +0000 From: Moti Haimovsky To: gaetan.rivet@6wind.com Cc: dev@dpdk.org, Moti Haimovsky Date: Thu, 4 Jan 2018 21:50:57 +0200 Message-Id: <1515095458-186363-2-git-send-email-motih@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1515095458-186363-1-git-send-email-motih@mellanox.com> References: <1515094264-185657-2-git-send-email-motih@mellanox.com> <1515095458-186363-1-git-send-email-motih@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: VI1PR0501CA0020.eurprd05.prod.outlook.com (2603:10a6:800:92::30) To DB6PR05MB3208.eurprd05.prod.outlook.com (2603:10a6:6:1b::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c1032243-991b-4ecf-77e8-08d553ac88f5 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060); SRVR:DB6PR05MB3208; X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3208; 3:hlCtWV/CQeulcztf4uU6mUIQL5+NKTWVN8hNe33UmM7ednx7qGOaqk8c9pYtTvlDytwZXZI7ejvasRKrqpjV+XCL8omWItSmrePDEwUztw4He9ccJFwPqg98MtfkNHb+1wcFTIoalrguWTzA9f9UwEpg23B0Wc0DJPwL3MH25mu5gNxI+1jCgV1iXBkzPo+3ALYf0R65jG/Wd3dRTH6fzM5NbXROHwaRnDHiSYUCwTwn6FYKF9D6KulXN/UGT27n; 25:YNntkYMA0iwG0T5XNxAJYrwfOQ6Bf+gBnCOqCrKPzeMDLUriH3ADUKZeQ9Zj875HXg9jY2iRkWWP4EgkpGDlPnzcSvpm7f67Cjx2uw8HvXPQ0k6InMtD6zNgyhkX3wvSGyHQOzW2SqVO9QxD02TJzHiQdpV9c2F11XCG8IQ/Q8xhaP8FUCnmIwjuNTeEELINj6tH0oXRQeonITBD1LZnV3EswArd+013i6vCLBOKjhJ2xqSe6zjnjHxgDTVA5IQeTxAuOu0ajNqBWXKnpZ92y6hAgNdsHmILTulDGqJbzooMk6JTRAtj+xLJxYe3JBsehRQAwotM78zHM0T5zFDDHg==; 31:8YWTJUjomUXalzYsqRlAMSZ6XpGS0U48fnRLJTJnEHxVbG0WHabKa53hIBUtDH6DNY06F6RfPFqj975OsvDC4kDgy/UdU40YtDt/AgK6UUJTU+rPz4+ApV8xSXFAImvcmCk7xXo5skJ9/gsvEXc2eCdvzV8guxeWgtNEBh1QWSqd3JR08KHAJ3LHCfcy8UuIOHLozDdqi+F4dlJVlKfMhDuTI2u7ew4PHm2hr5GrLZ0= X-MS-TrafficTypeDiagnostic: DB6PR05MB3208: X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3208; 20:0ZC6u3zns36uFRzJDqQ16CWOVhhjZT7Ef8mBU+l7K1v7iyUOg3xiu6cDoGJn1zbqML0+3pir3vm87x4KnAPL00XyPBXzZYyIqgzQbKJFa7nZVO+4xPp5+Q07ISlesrYGc3v404DsoixylRi9Symw2aJGna9MxH9OpkwcsN/lA9IqAQvd4GuW0Xvq2YfTsl7K1b4jnk6i2Qp6Boio3HzLwiPtGxxaJrKeQmkfqoCS3NbNlna8mJf7vCJ1S1Eisq1Tfn/k/1UvDJJDTs0YLE8tke0ckpW3KB0AujXr0PrDTWSD1FoEvMCtYHhGsm0yijV1yWz6dC6svxW96OiDYgExaepERsTQ4qMOpA0HZZMNZaOXdiTa9Rt6P98J8plIwCpNLsi37Bjt8x91ecfzfyZvJ56XULNjpT40j+T7FajnBj6Qf39PL8Ay6ftxzUXmWSN1qpCzxWN6mULnwlWF6Xf9LoNxeDtgiB7iS0bHpVKoj2T2KKHqWAWMvHYSs1jqCiPk; 4:ruFwT8XYA5T3YaqRe6QKVZo02rSUigk3UubBJ7auHLGlrT7gfeA2wmidHrNBWJcWTO3/by3FJLYOy7YEXkbXErHmEHRCN0fBSv1R9+zZEz1UUtJmPasb2t8OHYPTrLuIetfyzMoaGBwyjJ+FtdZX+JcalF9j/vn3vfVJXTEPuErNgcO8QtJ3z5cIUW09GsFK+9y5Uobh30ITvFD4Tuu3tOwjKdJjpFSl4qp96k/2PqHAkfVJLTl2Tjc2dsiKp0C+FfaX5rbYR62kCHgav68oIncBGyYUWmbqiCR+Vq2RlJYYFTyqSkzAHQlqRRCAvfEB X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231023)(944501075)(93006095)(93001095)(6055026)(6041268)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:DB6PR05MB3208; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DB6PR05MB3208; X-Forefront-PRVS: 054231DC40 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(396003)(346002)(366004)(39380400002)(39860400002)(199004)(189003)(51416003)(2950100002)(6916009)(36756003)(59450400001)(52116002)(386003)(7696005)(6666003)(69596002)(478600001)(76176011)(97736004)(107886003)(7736002)(3846002)(8676002)(6116002)(86362001)(81166006)(2906002)(5660300001)(33026002)(66066001)(4720700003)(4326008)(16526018)(8936002)(305945005)(50226002)(25786009)(81156014)(21086003)(2361001)(50466002)(2351001)(47776003)(316002)(53936002)(68736007)(16586007)(55016002)(48376002)(106356001)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR05MB3208; 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; DB6PR05MB3208; 23:9d9fnHHQiE5ykDk8/bdldsNOyibSs9OW+PQi6xk2Y?= =?us-ascii?Q?EYvDjw5Eu0RRyemCrd6koyWOn4ayOIgK7lNCRwCLl1nYTIqaH88hogjCp2W4?= =?us-ascii?Q?Dnc30o3/ruvVoADnmbUbneZzKQemLxfyXkZ3GaOqU41525Cvp4qtTvxCivRm?= =?us-ascii?Q?NNDtCAILhnUqLDHdfQp2QaZBEvJyOStLnP/uUfnfHsFpk4+idrq9/tH9zqxh?= =?us-ascii?Q?PQvSDuBZOr1gKrhqeI6HC11QBMjGLvo04Xq2l+euCgJ8Lx8+VMQVl45g127T?= =?us-ascii?Q?5b7rKfjlWcz3F8LRX1xY0A8oy4yHk7ZT2BG2KMi2ZazUuZV5tacebiJCMnwj?= =?us-ascii?Q?vjbBLJZCz9fDkr3N5LWPTecKdjXdKdb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?= X-Microsoft-Exchange-Diagnostics: 1; DB6PR05MB3208; 6:fdS8Lg4USgH37CQfPD1MOu46dQZArCAM1vyyoawouD6BrLfhvAV4vbCNuelaGGWM2RHIFDo2B7aKUe0s8R/ZekB0668aBAxzrBqpSf4NEOJnjB4O5z2/m/cSuOjClPDWGSMWYiHvO1x4DqUVtrRxLfdWZgSd/KD2OalexGIoagiJNayx4FQz/Xygw/jSeubsBKR9C/JlDxiRsPRbELn90L0rZjVwPn+leO9W2YtzRz6ILbYDOrMSLwRewOFkFf078FYmknouQmAzedLMfRM0nokFvNtxQ5pOQ4etldieK1iKhiJ4s/5dJRTvG/oclUPuj8WGwr6v6uHEq4BVLLprUiAzbS0kjltmgr58b9i6fxU=; 5:bRCFJIWBR3E9lM4lefbdDrKjXfd9boYHXkZcTIiUWqoxkJCvXm+QI9RuUJSjmXSyloRvyb/EZOEOS6VoxbwE9A+zATTx7gUZbB3O9s+7GKkqZvakvo1tFUtcXtnDvDHFR1IAj708xdnrgUsm0pl2dHc2gKZkdeCoH1yL0Chap/Q=; 24:Wz4YyrwDhaY7Xt59UbpTtoxiErZDFtcsNORvLAlnXh9YBO2y8DpwM448SXMRZSPLLF00WGWMMp9NqprFiM0ZFcmQiESJUchfD8KEdLjI6fo=; 7:f4v4nQPYl4HXSFIAaJg3iu1S6d1z2sTBJQrzHwQEXz8EKLhup/jmqJKLtaJnOCzVWZhgo9QuvsbuBlVfxDrrt9bWi0mRdrBj0sEcZXn0LlXWbWieOTaYbGqOPkHFnbfRsLJWXP915Yew52CibLcX0X1zn3jMGtl2gRnM9AweGkNTaPgNCNvDYKUECOuNSrg94cYpwzadBT60wVx7I5vPlE4aDqT5VkbuhKEcHFPrhtvG6ME0XBiq7NgCLz14NwRj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2018 19:51:23.4124 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1032243-991b-4ecf-77e8-08d553ac88f5 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR05MB3208 Subject: [dpdk-dev] [PATCH V2 1/2] net/failsafe: convert to new Tx offloads API 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, 04 Jan 2018 19:51:25 -0000 Ethdev Tx offloads API has changed since: commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") This commit adds support for the new Tx offloads API. Signed-off-by: Moti Haimovsky --- V2: * Fixed coding style warnings. --- drivers/net/failsafe/failsafe_ops.c | 45 +++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index e16a590..e498c49 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -31,6 +31,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include @@ -77,6 +78,7 @@ DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_TCP_LRO, .tx_offload_capa = 0x0, + .tx_queue_offload_capa = 0x0, .flow_type_rss_offloads = 0x0, }; @@ -84,9 +86,18 @@ fs_dev_configure(struct rte_eth_dev *dev) { struct sub_device *sdev; + uint64_t supp_tx_offloads = PRIV(dev)->infos.tx_offload_capa; + uint64_t tx_offloads = dev->data->dev_conf.txmode.offloads; uint8_t i; int ret; + if ((tx_offloads & supp_tx_offloads) != tx_offloads) { + rte_errno = ENOTSUP; + ERROR("Some Tx offloads are not supported, " + "requested 0x%lx supported 0x%lx\n", + tx_offloads, supp_tx_offloads); + return -rte_errno; + } FOREACH_SUBDEV(sdev, i, dev) { int rmv_interrupt = 0; int lsc_interrupt = 0; @@ -311,6 +322,22 @@ return ret; } +static bool +fs_txq_are_offloads_valid(struct rte_eth_dev *dev, uint64_t offloads) +{ + uint64_t port_offloads = dev->data->dev_conf.txmode.offloads; + uint64_t queue_supp_offloads = PRIV(dev)->infos.tx_queue_offload_capa; + uint64_t port_supp_offloads = PRIV(dev)->infos.tx_offload_capa; + + if ((offloads & (queue_supp_offloads | port_supp_offloads)) != + offloads) + return false; + /* Verify we have no conflict with port offloads */ + if ((port_offloads ^ offloads) & port_supp_offloads) + return false; + return true; +} + static void fs_tx_queue_release(void *queue) { @@ -347,6 +374,22 @@ fs_tx_queue_release(txq); dev->data->tx_queues[tx_queue_id] = NULL; } + /* + * Don't verify queue offloads for applications which + * use the old API. + */ + if (tx_conf != NULL && + !!(tx_conf->txq_flags & ETH_TXQ_FLAGS_IGNORE) && + !fs_txq_are_offloads_valid(dev, tx_conf->offloads)) { + rte_errno = ENOTSUP; + ERROR("%p: Tx queue offloads 0x%lx don't match port " + "offloads 0x%lx or supported offloads 0x%lx", + (void *)dev, tx_conf->offloads, + dev->data->dev_conf.txmode.offloads, + PRIV(dev)->infos.tx_offload_capa | + PRIV(dev)->infos.tx_queue_offload_capa); + return -rte_errno; + } txq = rte_zmalloc("ethdev TX queue", sizeof(*txq) + sizeof(rte_atomic64_t) * PRIV(dev)->subs_tail, @@ -559,6 +602,8 @@ PRIV(dev)->infos.rx_offload_capa = rx_offload_capa; PRIV(dev)->infos.tx_offload_capa &= default_infos.tx_offload_capa; + PRIV(dev)->infos.tx_queue_offload_capa &= + default_infos.tx_queue_offload_capa; PRIV(dev)->infos.flow_type_rss_offloads &= default_infos.flow_type_rss_offloads; } -- 1.8.3.1