From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60072.outbound.protection.outlook.com [40.107.6.72]) by dpdk.org (Postfix) with ESMTP id E0F1D1B3EA for ; Tue, 26 Dec 2017 10:24:31 +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=dFELTg4KlPu9t6dStzq22VmmniJ0khe9vWV40eWl0W8=; b=lV7E5NdsCtJvhUfO58ij/Md4jIrnpnGJt3qEqRteBeZ6INDJPCmqGkm0hBXlKwqhTGHl/kjbXlUS73nOoC4SOIoZVgNjuLvx0BTAQwtw9uEXkEVwrKn0e5tw5a4KN8eJfy/WdbJTd5KNrqz+k2+HAHdBblIENTNnZrZeL8GHdUw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by HE1PR05MB3148.eurprd05.prod.outlook.com (2603:10a6:7:36::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.345.14; Tue, 26 Dec 2017 09:24:30 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:14 +0200 Message-Id: <0c4817f6363617a545bc7125ac8ca0a0b1fde4b5.1514280005.git.shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: AM5PR0102CA0023.eurprd01.prod.exchangelabs.com (2603:10a6:206::36) To HE1PR05MB3148.eurprd05.prod.outlook.com (2603:10a6:7:36::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 63c4012c-278b-448b-98ec-08d54c42782e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(48565401081)(2017052603307)(7153060); SRVR:HE1PR05MB3148; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 3:CfhLWQ1YNJPud2G8Wl9vxrQtJ7FsHYo9fGuvj+OTOWbczGGAIvumWAo/UB7SqRoE54ZKGaD/vjU14KzdhDNQvoARRqXYqsxMb6qgMR6gRBEwvpPvo/Rde/8rkKYMBN3I5WebgmGqB5Q0MkGeqcAukaUckDW0xNAlcHEiTrAvz+JjLIKySvM//lj9RUdF8B0N27gqhDSNhpaxFHHXi7VyeHwwCjwvEVaqWALoWjBe5vJ2JbTBfD5AMlKIYxLK70Mm; 25:Eq8pOxryW3hKBdgpoH3l3rdSx8wrOvVhT78ir4fyVVdl1NIbCiYK8QLZiaQxaj5cDj8Ynt+N0J1IBsseQwKo4k7O9AUakx8pavwkZGxku6kMNyglO6Pv/2Cb6MP0/gGeDTPzpMUBcxlrKr+QGNCsgIlWum8jPSW2D32PPBLJ1TyL7dusKXjckYhp8v16ojobPxHgAAVyhcTVng3tsPsdbUG0jenkG3V53qCMxe5h8UJxaQDLm6tXAcaD0OMuGUjsO59NsjhgZFdN9gulS8Q/pKh7DrcslbrIGQ45xYJUG4nQf9B3BQ/KgQsbhVC7nInupbDvaKCEJBswogSJ+pqZYg==; 31:DjZYSHYaz8q49HtLyfbhYTksMcaT+FkgwMBtav3ML16/4L+k+i10EAE5cW0GP0GB6TZWFL8vJwMbgoN1huVNi9XSu7lLiB1wMGdAl2pOjXi6GX2rDb+lUD0eZ9Kulda+dgJhvOXAm0FNzy9GwafnVT7jcwWFfvHRyNVFYjSsl9C37TLyLbJ5h+JioUYRr92QvKV6lPpXYzyGaZ/A+/ibmGseMsST+FfLP5UcRnwA0Cg= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:dee72/OX2t8Zo2S3q4jb4ikzh5ePWL3Ef2jGnhzBMU1dyJspjxWoOvoBKn3+KqqU6FrulP7MWr0QI+3CVSEsWLLO7xNeKLlLgsY7sEZOZLSFBJbVuGBNESolXLeMhryBm+3DD/vapXNxM2mi54AyZo8mILMUrcaPp9oN6J3KEJ5Ocv1CjtxWzsvdEAxXnLhiiqE8bcGKhYiuvd/BIvjNzg+q9N0OVo0mtRNnCouVEvUtrqelzNo+Me1jfcRlbikRfXKqqM1EekSSuqN0b6D0xH0ERkAjCpVasTeuFH4RksXX00rJ9jusI17Hy2UusYuWkPvIPW2Xki3Rbs/AlcyPucZgKnqiFVOhhCh8hUtNKGKx7Bjhjmw8i5FmXfgfUBUsbltySUTWNOx+LvalO91AxQrjRZP4i/7/+YD4sk6TcG9n4n3vEHyy+Eq8RvXMCer3cKFlwVXtB7PqVj9Kyz7Q9/0noYj2YSEq7p8xHKLWWxEoHR/6SBfcKzU5hUujkI1n; 4:pwjD5KzZBnPV1jnaAK+JQ7Pjj4iUJFk/T3+wPczuqCCVkenwZrJut5Mjz5RKznCObuv+wgjY5wvbWIx+RrTaTSfVLdxqzEy+Qu7JMT8wg1CgRgBtQxYQG8FPoDgLKrau3HPExbVnWt+NNEkaXHWYn5cp/28wXcluusS7auy+uyN+rOTPrU4q4QKwAdyiojHnLwLXiZHeXKi5uJmtrIM0EK9ceYYjizdI6C2gMQ8hZzY/KZNbp7D7HkrM1rzasxsDFigOjUbFQPaE6iHIODEyxg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231023)(944501075)(10201501046)(3002001)(6055026)(6041268)(20161123560045)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(6072148)(201708071742011); SRVR:HE1PR05MB3148; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR05MB3148; X-Forefront-PRVS: 053315510E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(39860400002)(39380400002)(376002)(396003)(189003)(199004)(316002)(6666003)(55016002)(105586002)(478600001)(106356001)(69596002)(16586007)(51416003)(7736002)(48376002)(76176011)(52116002)(305945005)(50466002)(7696005)(2361001)(2351001)(33026002)(8936002)(25786009)(5660300001)(50226002)(118296001)(66066001)(47776003)(21086003)(16526018)(36756003)(6916009)(86362001)(386003)(59450400001)(2906002)(97736004)(53936002)(68736007)(2950100002)(81156014)(81166006)(3846002)(6116002)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB3148; 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; HE1PR05MB3148; 23:Tt+rtJeeRl+SWuoAmuTaXTVXD9cXyplLHUQIEqJxa?= =?us-ascii?Q?bxYBJLpg8zV76x3Qju+dTOCHwR3iiF90pFuOd2rZf1vSgtRxCsnNBn8jaqGY?= =?us-ascii?Q?/fIM1Zd1ZQ2ud2OJsRZW2Y31Q7/u4nJS8TE+6Mjlf4lYHk859TwsCA/UB+Z9?= =?us-ascii?Q?9t0mZsabuOPZdYArnGvXqaotjcJWRpjsC+ish0lhF4n12HA4stkvJfM4RcaG?= =?us-ascii?Q?qxMJPOmU4ER0DIqLtCGumULDCuBJvhHBSD7TaT/C8BoOoZLu3v/P94pF2zFF?= =?us-ascii?Q?Yoy3Jx51VD2c34bDaSAaaCQNKOycFmiR5ZF/KRfLllQnr971WTmJsTiq4wfY?= =?us-ascii?Q?ff+Uio/k2UXo1wWkQaW2h+ZsbDlLTy9lzQyzf0LidVqfeXiWdpK8wiKPZT3T?= =?us-ascii?Q?hKJ5H7gwjRcYfved7QH/l0Y6Vk/YxxFXhQFg6zBNupH7yEmV/dcJZ8Q/FWC5?= =?us-ascii?Q?ANJ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l0diK8OA8xhKwDNaLUg5LIxOS46C2opLviB2Xn0yqlYqDWBk3zweQtR3/8L0b6Ldyuqi+rcYKgwWRkoxYGdGyyKq8TO1DYtMS3dNLpI8uB4a0h/VBLl87Q66nlpNKcXD2ySMcQoObxnro1Q0K37uuvklkhaNX67pVCVZOMgewNP8zQxhHATdbRcxnWzIUcNhPUri67fRs1RtADBj6xs3QFc1kZS0Zh/MOzw=; 5:iOb/NnO2wf4DvpYg7NQcrT+ReYSx5i4fOAclbqk0KlI+4EEGqK52SUW49rgtvYzDuGNViQNZjzb4Lu3GUX03VsaOxR1XIgDif1hSi2/Q2LODHKk+fB+KBrCqc4yCg07O1R/wLIrb51/k6efmeWRO3iUKCq/GkEOscGYQ4l+OO80=; 24:wdtgfGVaEGkposHgmPA5ksithrNifX0snSy7SD1xYQxu4+uHUw2kR05I6zXaj+4Dpm4XPEO9+yj6wD9DSrF07dWMVSX/eCP3HVEIDcIvMMg=; 7:bhBcQuJykOgS5FFk7G0xeBUbuhMMHTXRjysHlSUOaZweM0i6rtTeAi0V3tr7W/roDglFv1gj6XD4Cd20wAVE/UHfYsRMhp4DossTNJ4gb/eJCcTWQ2mIBaY65I2u1mGCKml4V5PBaFOSJigQyHLs7edmIEtEgqn8wjT/sNyZrvpFOv2bLnfg73TKKjmIO7N/8YY1RPSZQuoYCTvPeHAG1jDBD8fLuUvjP0EFTot5Q6vcDLagy0QnsiUJHTohyT87 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:30.7540 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 63c4012c-278b-448b-98ec-08d54c42782e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB3148 Subject: [dpdk-dev] [PATCH v3 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, 26 Dec 2017 09:24:32 -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, 18 insertions(+), 8 deletions(-) diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c index c98454a90..ff101e98d 100644 --- a/examples/ipsec-secgw/ipsec-secgw.c +++ b/examples/ipsec-secgw/ipsec-secgw.c @@ -217,6 +217,8 @@ static struct rte_eth_conf port_conf = { }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM | + DEV_TX_OFFLOAD_MULTI_SEGS), }, }; @@ -1358,6 +1360,7 @@ port_init(uint16_t portid) int32_t ret, socket_id; struct lcore_conf *qconf; struct ether_addr ethaddr; + struct rte_eth_conf local_port_conf = port_conf; rte_eth_dev_info_get(portid, &dev_info); @@ -1385,17 +1388,19 @@ port_init(uint16_t portid) nb_rx_queue, nb_tx_queue); if (frame_size) { - port_conf.rxmode.max_rx_pkt_len = frame_size; - port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; + local_port_conf.rxmode.max_rx_pkt_len = frame_size; + local_port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_JUMBO_FRAME; } if (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_SECURITY) - port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_SECURITY; + local_port_conf.rxmode.offloads |= DEV_RX_OFFLOAD_SECURITY; if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_SECURITY) - port_conf.txmode.offloads |= DEV_TX_OFFLOAD_SECURITY; - + local_port_conf.txmode.offloads |= DEV_TX_OFFLOAD_SECURITY; + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + local_port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; ret = rte_eth_dev_configure(portid, nb_rx_queue, nb_tx_queue, - &port_conf); + &local_port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: " "err=%d, port=%d\n", ret, portid); @@ -1420,7 +1425,8 @@ port_init(uint16_t portid) 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 = local_port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, tx_queueid, nb_txd, socket_id, txconf); @@ -1434,6 +1440,8 @@ port_init(uint16_t portid) /* 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 +1450,10 @@ port_init(uint16_t portid) printf("Setup rxq=%d,%d,%d\n", portid, rx_queueid, socket_id); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = local_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, -- 2.12.0