From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0083.outbound.protection.outlook.com [104.47.0.83]) by dpdk.org (Postfix) with ESMTP id EBB401B203 for ; Tue, 12 Dec 2017 13:27:45 +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=Xy7A9QnJ8aCh8ywl5be+CwHSJ5C22fKxxzaRaFBKbco=; b=nKKPcahOL9HkktkYbhw3GqK2trvvke2RsApNDbZxqms5U9sj+YhN7dD6OiRJJcpXLUmjrTRQY1z5Sm3MsYtMQSbZ3qSAm+sH8/Q4QMgkKo8odVobcvtLmb00Su+fQVygPbTygaz1/4xlSdL1+P8mkhgHNwv52+UYnrRRYPRYV50= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by VI1PR05MB3149.eurprd05.prod.outlook.com (2603:10a6:802:1b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 12:27:43 +0000 From: Shahaf Shuler To: dev@dpdk.org, konstantin.ananyev@intel.com, radu.nicolau@intel.com, arybchenko@solarflare.com Date: Tue, 12 Dec 2017 14:26:32 +0200 Message-Id: <2cde002e4430cdc6ad44d6d1801994171b7a8340.1513081087.git.shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: References: <20171123121419.144132-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: HE1P191CA0010.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::20) To VI1PR05MB3149.eurprd05.prod.outlook.com (2603:10a6:802:1b::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 921f0c30-3378-4811-a8fa-08d5415bbef3 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307); SRVR:VI1PR05MB3149; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 3:b5TFT+8uGahwh/+3dvjhJWxO0XVchVGn293JXuAwLkWe7+bzJVasI6lYINTduCPv5zmUdmt+0zxMC1wtCw7CPII/GBTNfFfZseD0GKc3Z+WfYgTmQMN+yTjrnklO7Ic6GUcp3cJ6ytkLzoL4yvaVYwbUszEKEi9LC47O+Vjh0v3dHrAkKhyw6TInkM/h72WZrD78MlxpnL5w1yMs17k+8IFyI0fMOnPbGbihiwfQslCZ+fOmZ/PukDmqGzSi9NRX; 25:LHKkBu+m5EUoZ5rkVWzeL5L77JKMQVH1LVXLGvnhJr3llQCc26oc3g8Y4Omp9XH3P2tdxGRdLKchRHbfj1D4rXX1zVFX7aSukW9iC/JWFFH74+8L96+RYXwYozjZAh//3R1cRcj3qwwAV5HhfnHP8xk0gC64Cr+goDJU1ECQ2lyV1mDwjkdgy+IrfJQVLVETK9fA2siol1iuay3XtU8AZKMWCIKz8/d4t/uE+oZgmOuD7XhSS7JId5huUJAbuTakt1joUfqtjqqKh6MRK+XLW6eaT1n6+CrcWtOng9X7UmPBY7C61Y+o1ja9VFgv7LEf+2l6gqCqzwzkjE38e7ng9A==; 31:qQtmwAx1dQlDetZ/tWBRIXiFkGQ8Z6vFth0NgOzsj3Hz4wyH3nBQ7LgBRnP5nA5djnfWm+OzHeIHOwr9iAwcVRkOYE2jcV9UcgjoHEOXHg67IjLgtOr5JhQgFJyPOciU/nhr1N9D1ppZtL4qwdB14GWZ3MwrbyRjhQI2XRTH0EVbVXDcwlWc7GxN3Ho4JppS/SCLxTgLD12+zvziHjhuQbzi9blGGpXUApj0IohQ7YM= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:wSYxz8PAHoOsBbR5S5s2rOTM9gKM2ZTArJaXuAUZL7yrpV41IZRN2GnDJuYl73qY5VcZ+tzyj5N80apC2y/jum3BeYuWG6FRyUJVi+Y4C6GZgZmxheG9+WGBgdk/14WdOChHOHoe+bL5EnfftLYUToADlIWSsZydmpOMTc3u1NjvzLD5gZLvjs0aOGmP5Qs3WyClIJpt5ghhloc/oXFesbsp6+6+ie4d/c3Vc/uc0SE45Jep/QpuGaCWc5CD74Xn2paLQlBsBKqlWfRgPNAFz76MloqWZQFIG3+PDchqhho3sEx1BCPF1cC6NuGvdm5OoJA/U91wjvbAujTRiKzZGauPNbJZAqsOmXEwCr9+og38SK17wGGPwKkXwAxWD/ieVQexY+IJrNueqK0PIY1GABIphfl7YngtBntXBxUfr9hYOE4sNrys7UP82fbcuUncL/DJoirZG2VBJjmiGJfr9vNs0QZYIgWvX+LQmykOUTyRs164vEJA2T7ZF8EwxMtk; 4:DB5Uz5RQZavSMItsCFNXCWo6eWj+Qv09QIKAMB3RjGCtuZ7RiAnvxn+owCQoEPooA8hUKbOA3/gcvDS4BDRvSVjvvHhDI2Ih+F01ewgTGF1DKYPwIc0XZo4h18VL6YvOq+PCPtoI0EFFtB3FStI/iAFTCHFcqNg/Z+nI1uMR4rLsYXoHIf/aOZLUO7ssOsz0Fx7PMg5d4veXmfCNgp847+mp1Az6Jk/vkJr3uYU/hmi1zVtJfiLdc7NmIF/UEFp4HaFeg+RUsInSd9Yt6rUh0w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231023)(6055026)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:VI1PR05MB3149; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3149; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(39860400002)(366004)(189003)(199004)(7736002)(8936002)(305945005)(66066001)(3846002)(5660300001)(47776003)(6116002)(2906002)(69596002)(68736007)(48376002)(33026002)(2950100002)(50466002)(81166006)(21086003)(81156014)(6666003)(8676002)(106356001)(105586002)(118296001)(97736004)(478600001)(51416003)(25786009)(316002)(52116002)(7696005)(50226002)(86362001)(55016002)(36756003)(59450400001)(76176011)(16586007)(53936002)(16526018); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3149; 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; VI1PR05MB3149; 23:OC/t+yvLpEwSeFe6WdgFv2q/boFpQtJ3n7YAHbeEq?= =?us-ascii?Q?GzZriLVndp6qY+D8fia0vo/fAptucUhssjLwP/04pAgy4X8F43RBrKhgAomR?= =?us-ascii?Q?/zdBq+vfF+hWszlFnygFwpjueXcbZm2TxwicvOauhuPWIJMY5wHwd1OL62tI?= =?us-ascii?Q?kVKtB3p4TE/vzQd+eMpXtQEQPBoHdZQk9zFow5vQtfOAQn06Ylj1f9vfFZId?= =?us-ascii?Q?e3rmIWdjAxrognhEv1VjmTvPKq33AR1VtufIlv6NgF6DQcF4pheFOs7tO4WO?= =?us-ascii?Q?kDNKhrHDMcVoNdGZ5P/Zgz97v//1+/m5tLcKVL8hOS69Q/Jp+itf76/H1K14?= =?us-ascii?Q?8dyBzKDqDjDGuXrz4/Qi7/k7C70RMkQ/9DXtO0kj5iL7Kpml1ZXAoFvQXhND?= =?us-ascii?Q?ys6fi7c7FbrPADjq78WPyK45iLlMQWQL51o+t5V/L+jkmzcdWtW/CT0jl12V?= =?us-ascii?Q?1T/8wTxH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fzvzaQC7lpy6e0gKih4h35Rx1LTJwRvcyEJM7YVzkf/lvs07C+r3qEwc2yqRCAXz3KN27T0rjA=; 5:JDWiRRx69754ePSu9z5ogWnuuATyp9Za83krwt2O+pe44SwQUeBSBvvU6CmnI2sWDllEWOxpMKYo61vPrwIOJ2IFGynNKNqoWjrfzXLtCi5BXyiE4UKBdmhF7z4vSh3z/Vo6ajGfEyNBA3vJb/1sGmRpTDfObas0Of2crqyOuu4=; 24:xoZZXgKDbJvtaM016NaAMKeFK9W0xtvxRTbZVZxTBvnTTdrftj/jTM4ACJ47WC/erQFAjO3lbuVJnCTZjYMt58rttguGbWNky+BGrKthtLE=; 7:lsdokFBQptECjkCevVjoNZH3Q3hhievYjqqAptLIPoik5NOEA71EB683VG0/RlHgpsHf/Id/kGIMOwFnuag6HFy77FEGXPQSbrEZpk/9chTVlVoI4h+tMKpjVWf2meX8BWm7ihRgYpjCqctyi1j1pWHyY5vm/uJw45tqwOq0yGYsWfblnc91Drrzxwj2i/Gz2W2p5mSbhGFYAA9cL/Shwj05U0ad1ffJSOm+B/tTnD0ElBbvb1+8vUdACsJeqOkC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:43.5512 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 921f0c30-3378-4811-a8fa-08d5415bbef3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3149 Subject: [dpdk-dev] [PATCH v2 15/39] examples/ipsec-secgw: convert to new ethdev 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: Tue, 12 Dec 2017 12:27:46 -0000 Ethdev offloads API has changed since: commit ce17eddefc20 ("ethdev: introduce Rx queue offloads API") commit cba7f53b717d ("ethdev: introduce Tx queue offloads API") This commit support the new API. Signed-off-by: Shahaf Shuler --- examples/ipsec-secgw/ipsec-secgw.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index c98454a..1e8af8d 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -217,6 +217,9 @@ struct lcore_conf { }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM | + DEV_TX_OFFLOAD_MULTI_SEGS | + DEV_TX_OFFLOAD_MBUF_FAST_FREE), }, }; @@ -1394,6 +1397,20 @@ struct ipsec_traffic { if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_SECURITY) port_conf.txmode.offloads |= DEV_TX_OFFLOAD_SECURITY; + if ((dev_info.rx_offload_capa & port_conf.rxmode.offloads) != + port_conf.rxmode.offloads) { + printf("Some Rx offloads are not supported " + "by port %d: requested 0x%lx supported 0x%lx\n", + portid, port_conf.rxmode.offloads, + dev_info.rx_offload_capa); + } + if ((dev_info.tx_offload_capa & port_conf.txmode.offloads) != + port_conf.txmode.offloads) { + printf("Some Tx offloads are not supported " + "by port %d: requested 0x%lx supported 0x%lx\n", + portid, port_conf.txmode.offloads, + dev_info.tx_offload_capa); + } ret = rte_eth_dev_configure(portid, nb_rx_queue, nb_tx_queue, &port_conf); if (ret < 0) @@ -1420,7 +1437,8 @@ struct ipsec_traffic { printf("Setup txq=%u,%d,%d\n", lcore_id, tx_queueid, socket_id); txconf = &dev_info.default_txconf; - txconf->txq_flags = 0; + txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE; + txconf->offloads = port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, tx_queueid, nb_txd, socket_id, txconf); @@ -1434,6 +1452,8 @@ struct ipsec_traffic { /* init RX queues */ for (queue = 0; queue < qconf->nb_rx_queue; ++queue) { + struct rte_eth_rxconf rxq_conf; + if (portid != qconf->rx_queue_list[queue].port_id) continue; @@ -1442,8 +1462,10 @@ struct ipsec_traffic { printf("Setup rxq=%d,%d,%d\n", portid, rx_queueid, socket_id); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, rx_queueid, - nb_rxd, socket_id, NULL, + nb_rxd, socket_id, &rxq_conf, socket_ctx[socket_id].mbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, -- 1.8.3.1