From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0050.outbound.protection.outlook.com [104.47.0.50]) by dpdk.org (Postfix) with ESMTP id 059A01B213 for ; Wed, 10 Jan 2018 15:40:54 +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=B/7x1jGf2PBQJA3QqGyB/ihH1ygB/LceP8jCY7+04uo=; b=HSZxOoPJEY0XT02ZLmjlDD3+qJRSPHoP6+f0oO1Rts5zkxASZobsh3uTAGV0Cmu/61Nh4sjF1uPh99dlE2/nZ0RUKHhRehjlEnBki6QcqY+XRO6SUl426KKd+nacstSpnDezd0YbtqoetR5CfDkGzBAu0dVdPqE4d795rzusKVA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=motih@mellanox.com; Received: from mellanox.com (37.142.13.130) by VI1PR05MB3213.eurprd05.prod.outlook.com (2603:10a6:802:1b::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.386.5; Wed, 10 Jan 2018 14:40:50 +0000 From: Moti Haimovsky To: ferruh.yigit@intel.com, stephen@networkplumber.org Cc: gaetan.rivet@6wind.com, dev@dpdk.org, Moti Haimovsky Date: Wed, 10 Jan 2018 16:40:23 +0200 Message-Id: <1515595223-36144-2-git-send-email-motih@mellanox.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1515595223-36144-1-git-send-email-motih@mellanox.com> References: <1515095458-186363-2-git-send-email-motih@mellanox.com> <1515595223-36144-1-git-send-email-motih@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [37.142.13.130] X-ClientProxiedBy: HE1PR06CA0155.eurprd06.prod.outlook.com (2603:10a6:7:16::42) To VI1PR05MB3213.eurprd05.prod.outlook.com (2603:10a6:802:1b::30) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ee268dd7-fbee-4c1b-0fda-08d5583825c1 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020052)(4652020)(5600026)(4604075)(48565401081)(2017052603307)(7153060)(7193020); SRVR:VI1PR05MB3213; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3213; 3:GuaPtxzyjHuJK7PtaZMzNrjgwTh/2I4bF+sJpxtHexKCO5XdLy38U36OmpQZiSg0k6CVTGjyLNhu8pFD48uGGpFTNQaQkO0fkojPviejbj3eL1mt4OvsPzUYjG5zZIpb4c5QobNJWdyInadLaH7sRDIsTFsc+jsOhVZ4HbskgRtHYKvvn35xZ+2rUFVTSgqxc4/eMMwrPND8n0jUt9Q2zKR+dli9B9KAtQzrNBiW14j+iVfS2zk1UHLGHDiRQhzj; 25:X0Qes3ftMJV/W+p+IogxlJofn6PoWZvLhV+fSFHDa0rDD9QXACG+GPFlZwf/MP7GbKxSsE2VrYvFXHjd97G0zbt8QSjvlrdq0FUB0szHe2hhEJSvVzxVu5cmmvvtL+3FNhY8tfzwzNWuO3YyFgi6bDn6myOiZrDjsZadscPz1JoqYB9EfTnbGm7uM6NbdOh33rjd/fPefcDmeMCDq6M8stLcYhOGGWHRm7sLPMYmh28OYcBrtBpV9ea2QaaX0J/4aDLPu6K/3XD5MSxObfsS//TqiOkE7K/NpaV/GOiL9ZUVQ2RkA7OaTFNoXcg/JHwuJFeK7XyYDi/6fVYod+heCQ==; 31:mrxc0cG0peX6E/yB0mT+JnGY1oYgq9fiPh7/WYZcd3ARSALYA9mh1Z3oozS+eXOPpq7BUnw6JzvktsrsBiGr80gem3G7733U+k1zN20rTzLuUG4SOqYbHejeUNP/vutEAcAQavuBs9OjgJhTZPaxTBnFdWe2kTmUw1FF5mYlVeMjcVOx9MPaA6so/4ZVntgmPc/L8TvVwtYHOu0d53x9whLLoy2xWUXEHwUqGMdIf+8= X-MS-TrafficTypeDiagnostic: VI1PR05MB3213: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3213; 20:HPz+vW5dlMqDsCFI1Nz2XLoLKaO8LwtaxW1SuiwTj3J3hl+19MLe5m83mSthKkCsbotqCWu+Q3Af1fyPjAGTPjQEHm4JzkSbePO+hrvAZ35jQRekoPlHhPhD42N1s58Y/CDJjSJDZMOOe3vpZgCiv1cLFHvUAJTcNXfuvHCnK8uQ9WPbJcoIHSfXbMSGVIsRDE+bBWE5PJ/b/11/MCo/3cW2ACGdz+CvsU91wKB2Y6Kcz087HbKiVuaTTjO+nL31n7q6sf27lsTLCjle2UpGpeF+yKRdvV7RzLmF7apvCDHVnyzTfjR7PHClvWe0/2dg5MLdgdRZeO7UAIicjrs1mruTgP0HaOfmsXQVCZlk6qWzGAMlIQGv2hzjeXKUJ1+ETWRr1STnZjynHAjAOpr7swQZr9ibtOfhSRbst7v5EXQRAfG3vrYSiW8QQHmcNvip0wh3fIduxCe5+DLzo2LULKuYHT6taLijXofAXKinbnlQnVNhocafVe9iPq7HuM6n; 4:Qsi+goonDqr+jKq0InPWdylbB09z65YJ8EJWTtKBgT6wg/+9R0N7IODcrG6JX00sFeKSifgVwLA7uVZeCBgkKfI94pUMr0zgAfmGQBvue9YnC3IWCD+vUUzxnrMh3cVRgbSu7VZ3zQ8PuQK5WPKrtVog5MD0pJEpP+H4xdPfszAwT/++yl8Bm4XjbHgeNhO9CJLtPcDXAQ9mQd0tbOwRnYLnz6ntc8OR03KLc8SlJDX+b0uTWYA11r1AZgrkm0QCzt1ZWiAwYduYIwPWMOeiqw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231023)(944501119)(6055026)(6041268)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:VI1PR05MB3213; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3213; X-Forefront-PRVS: 0548586081 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(366004)(396003)(346002)(39380400002)(39860400002)(199004)(189003)(5660300001)(66066001)(16586007)(7736002)(50226002)(68736007)(50466002)(305945005)(8936002)(81156014)(316002)(81166006)(16526018)(106356001)(8676002)(47776003)(105586002)(33026002)(21086003)(2950100002)(86362001)(6666003)(69596002)(107886003)(2906002)(76176011)(59450400001)(386003)(4326008)(97736004)(55016002)(53936002)(36756003)(52116002)(51416003)(478600001)(25786009)(7696005)(48376002)(4720700003)(3846002)(6116002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3213; 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; VI1PR05MB3213; 23:FAOHB85igSxxoac2kNE/BzGXRsOB87ZjfgS1sB5hD?= =?us-ascii?Q?ktWa0YuwMPG1Wp9AUOeLC+MKFbBlqDV0EmA8necZWAGTYKr2HfNcXvrT8Pkh?= =?us-ascii?Q?QrBF4n050HWEvn84xNN/HoNnvkx8iK+IwUTU2fZEDqpdnvij9ul5D6MfTSzB?= =?us-ascii?Q?1+cYEwJGhez4VX8UCRWhDMNpou30jFqWxPNDAayWxvr2DjZdlozhaFuHcJAM?= =?us-ascii?Q?s1U0OLVNxmE3a80FE5lLKUo1ZxQppj6q5bG6M9zq133ho+z7ITcJh7Emb6fN?= =?us-ascii?Q?jltJdTVD27vF2UY+2ZgZFEcEyCqHM1bRTvDMsiyM+XUOmZyUp5EFvQgML1nQ?= =?us-ascii?Q?QrdjbnC2b9f3dSqeVJOxupfNL4DKxPE9RndKKXIhT1CeknPUcG1SlnB1WmCb?= =?us-ascii?Q?6AycmyLIx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oRuvc4SXb6k8pdvgXigFVN4T/8UnShKBpsOWfezA6qY/jao4qbhPAECDfUAgHrm1mm10TTyV/UqjsoIC8ydlZUi7cFaGUGLvhN5+a9lNaTyxBm6L5ozJYxjctKAAPfVVHaK99QZDbPoAoqA9GtGcldEl8lGyk5QkZU3C2LUmakhP1LuNfldHCfFOzyNik3VZI9EtEnCvAnp4Pn/sdy/Km7g6gJomVkGOFW1lwT7ZODFUuf+YfONiaS+VWLHz+5BdNUb8jixZDdlEgUWox37QywhF6K02M/itXzIM=; 5:2l6/aSz1u8e48jFLJJwy45xSVbSxpvHqlxBZalQSr913z6udYH9ay1/qFKaW0SVg9rn2vD1fK1oAvVX7bE8e+6y1jdwcG5zRKBKX+0JgAMONxp3IdYdD1snsQIwjgu8600Po5XB/PIN0DfDPwTEXDrtvi7XLHMLlzGQ+bxc8j7U=; 24:+BEg19uYEe7FsADeNRzZ+6PLrVPnRMTK6qJUYenewVJQ6A4nFetgterX53HPFYSNn3X8kgDVcH2pMBvtA76GBBw2cvqn0uyYbACWOtHz0Xk=; 7:UZI49BvEdF7Ktks0mVYDw2EKF2TRUodYoKEP4I46qslgdHb5Djk6On653GNRkF08sLXuKZDejIVZFoUxCMNJJW9J83OIlEvb+BK8kdRpA15o8fMxyFvSs1JfKKKANNNsMrdmOk0j2A/fXXpok5tNUP2SkpX/XXkiWH1jPyk58EAp4PEt2pbFEVWfsAe+GQpQux5ddX1eaFLS/ss+1JQdABtVqmm3SYayM6OzfN/2kTvuPCgCVH+NvM4yqnSJZmLo SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2018 14:40:50.7302 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee268dd7-fbee-4c1b-0fda-08d5583825c1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3213 Subject: [dpdk-dev] [PATCH V3 2/2] net/failsafe: convert to new Rx 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: Wed, 10 Jan 2018 14:40:55 -0000 Ethdev Rx offloads API has changed since: commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") This commit adds support for the new Rx offloads API. Signed-off-by: Moti Haimovsky --- V2: * Fixed coding style warnings. --- drivers/net/failsafe/failsafe_ops.c | 38 +++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/drivers/net/failsafe/failsafe_ops.c b/drivers/net/failsafe/failsafe_ops.c index fc1b85a..c2b01e9 100644 --- a/drivers/net/failsafe/failsafe_ops.c +++ b/drivers/net/failsafe/failsafe_ops.c @@ -77,6 +77,13 @@ DEV_RX_OFFLOAD_UDP_CKSUM | DEV_RX_OFFLOAD_TCP_CKSUM | DEV_RX_OFFLOAD_TCP_LRO, + .rx_queue_offload_capa = + DEV_RX_OFFLOAD_VLAN_STRIP | + DEV_RX_OFFLOAD_QINQ_STRIP | + DEV_RX_OFFLOAD_IPV4_CKSUM | + DEV_RX_OFFLOAD_UDP_CKSUM | + DEV_RX_OFFLOAD_TCP_CKSUM | + DEV_RX_OFFLOAD_TCP_LRO, .tx_offload_capa = 0x0, .flow_type_rss_offloads = 0x0, }; @@ -253,6 +260,22 @@ fs_dev_free_queues(dev); } +static bool +fs_rxq_are_offloads_valid(struct rte_eth_dev *dev, uint64_t offloads) +{ + uint64_t port_offloads = dev->data->dev_conf.rxmode.offloads; + uint64_t queue_supp_offloads = PRIV(dev)->infos.rx_queue_offload_capa; + uint64_t port_supp_offloads = PRIV(dev)->infos.rx_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_rx_queue_release(void *queue) { @@ -290,6 +313,17 @@ fs_rx_queue_release(rxq); dev->data->rx_queues[rx_queue_id] = NULL; } + /* Verify application offloads are valid for our port and queue. */ + if (!fs_rxq_are_offloads_valid(dev, rx_conf->offloads)) { + rte_errno = ENOTSUP; + ERROR("%p: Rx queue offloads 0x%lx don't match port " + "offloads 0x%lx or supported offloads 0x%lx", + (void *)dev, rx_conf->offloads, + dev->data->dev_conf.rxmode.offloads, + PRIV(dev)->infos.rx_offload_capa | + PRIV(dev)->infos.rx_queue_offload_capa); + return -rte_errno; + } rxq = rte_zmalloc(NULL, sizeof(*rxq) + sizeof(rte_atomic64_t) * PRIV(dev)->subs_tail, @@ -589,12 +623,16 @@ sizeof(default_infos)); } else { uint32_t rx_offload_capa; + uint32_t rxq_offload_capa; rx_offload_capa = default_infos.rx_offload_capa; + rxq_offload_capa = default_infos.rx_queue_offload_capa; FOREACH_SUBDEV_STATE(sdev, i, dev, DEV_PROBED) { rte_eth_dev_info_get(PORT_ID(sdev), &PRIV(dev)->infos); rx_offload_capa &= PRIV(dev)->infos.rx_offload_capa; + rxq_offload_capa &= + PRIV(dev)->infos.rx_queue_offload_capa; } sdev = TX_SUBDEV(dev); rte_eth_dev_info_get(PORT_ID(sdev), &PRIV(dev)->infos); -- 1.8.3.1