From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0073.outbound.protection.outlook.com [104.47.2.73]) by dpdk.org (Postfix) with ESMTP id D1BDD1B379 for ; Tue, 26 Dec 2017 10:24:16 +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=VKQU5ExkJ65dvnZbcQOT/joAY0RlpZfMUbc6eS195ac=; b=d+djYQ2IrH/aoneg9mn+Dh01WpuPGy7GQnnMJSmAOvlnDNQLU+xFYeMwGIUBil7DL3LwNuHydM2w77nIFlaRRj2Z+XD3FBwI8qD4LLImk92vrDwQElSQBE6BMaDXECcuXy7/TSjPhOQ3DIbgfPForKd6ky8yziPRHV5wA9s3x8I= 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:15 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:01 +0200 Message-Id: <37fbb001238a3086a318a49fc74a0ad8587f36f6.1514280004.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: a761ffc6-24cf-46f4-fb24-08d54c426f38 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:KsGVYuwUVsUsUAKS/GtqnsXK1/gyCD46l21FvYLoTZJ/jOUYB1fEwescXJ82d/6oH8KPVq/RER0XaXtweKwWsvAmhLgAPI4U4sa8xqiFTVfixBVLFIaCZ8rTpL57BbGFLP+ZMvgToOwgg9qDVVUnP5ODenchKiN466uUr8TP1HlJYXu12tHbzSg8EC7Iaxzuiq1N0+F7GmaQodRAuzpnVD9BJg793qliqGM6XZ6D4yz3jtOs9BYRvPA/6VHwIr2P; 25:Pw1jssvTP4PoW+SkzviXSnd8d8p+T0cUlMSxs8k+L+jARmGLXydEn7lLRqx2F/lfs/Zo8vO2L+OX49ekAVRuisCGaihkfUlclPNgR/CQZyqtGMfNuxKO4VU/Bk2rCHAU2/DqOfL7HQH3xFBeP3c4Q/y4NSck0IiXVk344Z4NHwc58wPFqjOY0p2uj8aV4zJZ5rYfddvbrPhT7kv+wNiT9ECJBWJiFjnfrJQ++GNTmrLzhWuZ1L4fhFmuoUQRzw06tWJ4D64rK5xDq//hZqQE9Rz82cASOmopTwQsrNQEO+HpQ4HMBU6ga+21VmeTg4RPBva/rLRYhwD/X4f6GKfeMQ==; 31:kV37D2m/mI0CM+jHivt58AYfe+9o2pcw2wBUTUWMvWl7kKoCzBiGBU1UFTVdP86IJZxP/fwLbToeuMhU0Lq3Vr5LzREM5YZHtwVGCc2+yTlwculOmiHiU/wIfzZrMLAV2n6XSXawtEus2OSmR45hLPdZTLP1CjaI7qfDh+yy4QL6Xy1Ha4UsLhphgUTzFg4aPl+NJS/Q/EuKu7XpxG7fu4YjfRlRaJZP4tfQV9u5IDw= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:GWy6m83CdCpEPK6CSjUgfnJ7UKEjN7KVv/HLEsKPZjYbbnrhspXTfzSJcrHFK3zid+7LZJWOom3FrTMl7vUEqhANt6B1sn9XKAvKmX9+c55H1IUnzXuek97i/PqToRlHApAWSYWx3LaroYOx1MG/3d8pSsBfPs3EQau3fzSN7pR3vRPwoCu6B3T/8cvIg2JX/xGeMMNScAbk/Kzzl/6JN22IgOdLZRPRpWYU5Wp4XY6XTb35CeZyFLrIqfSjGojwpce+lgCbfkI0aC0bXtKFQPzlhela1iveIOqcK7ZWkfiBQ9QDZAuV73T8iKtcA59JXLswx6eIL10dAhKxjtcR2A4iM9Ye4p0Yj8A/lduWf1r3JPPcpo6r7O3KkF0AdN3qFa6Xxaxy/nERsMkBDTe8YDDS7Tvi6JlvWBJpLzl4UdOaVjmuUXgbKKIosWpstT4I5NRtriLBRJY0l6AH1+OyAtb5VuR7GdnTo5dw9i5JDXwNvShz+OY2x/mI3o3/Jylb; 4:Yf2Auz8YYd2jT28IgDKeVsbtPmlSjM6AP3v+sVEpu//Bk+UXnxA6/2mNBFnXD1IrKGBpVKkZD0DOT4IfY68loqE5/aRNxVmu3mHU8NW5L54ryF+Gc1nzmcASckxALAXJCAGbAVkO+hub07s7vecYZseV0zCTlae68FoVz8teXXtIKQPNRc0H05XlNfwV43vWYhE957hekvqYMMYVkG/5LgADBw33/vGKsSkaDhpF4QlxI2OAmH03I4Yw0Fue+y032XAwrQuqQ5i+H3P+KqAsag== 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)(979002)(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)(969003)(989001)(999001)(1009001)(1019001); 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:lRVOYENMLuZx0+Wlo8h07GScq5QL9LP7lNglPr4z9?= =?us-ascii?Q?ndwlN6iOHByxf8iX6fu+QGTr8l8LWIYVyR0OTJs0ppv0N8gZEKlvIMeZzEyC?= =?us-ascii?Q?DrfyBdyL6AaLM1Tow8Qwg/q1ugOtmgChUm98OFydPgC5fynmMlw14MLJpObM?= =?us-ascii?Q?sIg6QzpBosd0p8YgeSuxwd3NldLimlCnr/iDVFc0MGOK9G5fbhNcO7Uq0Or2?= =?us-ascii?Q?fRgmOeq8Zfsol7uhCbBh8QMWwC4phRavU/PfIzfqR95WrLVkdLA2fZcLT/U1?= =?us-ascii?Q?uVMm1LgQxV+GpKzo8pTKsMR0kfkRuhV76BVj7Jy0+Q94XdoXKCzaF1ZHl1PC?= =?us-ascii?Q?F9bO6ZS81eGu9CDg/gs5RkByUMQvndlFZlO7FxNi7MeMgL6gzywkhTWh3Tt2?= =?us-ascii?Q?fNUVjYGAGQNHJ8aar7t3S1aeOGIs66CvWsfqgiyeyxQdy5jjHZ1XpikCV96x?= =?us-ascii?Q?XvEKo+O6JCJPtaKa9Kc32svqiBebMTb6Y7zZob9fiJVUwjw0WsX8xgJ/iX5R?= =?us-ascii?Q?hP2CWwPre0OX47+CrYskGRbISDfEfKehxNlej1sNTJSDMl9HQSsJEcvEK53s?= =?us-ascii?Q?4RIGqBZaAJ/RFOa/7z7lSZ5XaU/j9+h2iSxldQc7ZAUJ2enMNcUa86fUCsEi?= =?us-ascii?Q?fWaLF8G8CTqo7jfi/wAmjyepY6TSnKdhWQoIlEl+s32XMnU5mN2nwOTzci+K?= =?us-ascii?Q?7XJTPwu7TO4cTEjesu7o7+grBY4QOPUPAKPcNSVg5SG8w9SOfM5OujHfZIyn?= =?us-ascii?Q?ON2nGpm9X6APwVdKCT7+tA4NUMxEA2FJsvvTrXM08tbDS57WHz+OkAR7UfzR?= =?us-ascii?Q?+SG+kqoxNY90Q6mIY4lP1F9IweEw4ZkOe7SA/Cf1WpcYBCW9tZFQICHh4yGL?= =?us-ascii?Q?RaWhz8Swrzzduv7utstL7VPqte+v5nBqHlXxoBcMB50FS9mKWkdzSy+s8+Vv?= =?us-ascii?Q?zBlYUXwynXz6hz7WFmlLyRX7Lop1vGtItsJH2RJjSUWtotVK3S/xGMv1VOk5?= =?us-ascii?Q?Yk70RRepsIZ5q9An2L7rVc/AjT7SWZwwvo02tNdDjeA7BErieD01Eoqf+9me?= =?us-ascii?Q?6s5yBJ5IDqQuuArkjjE+WIadP5ld3hr4G+7GpgICbKWnU3o/4hrOFX3+3jUI?= =?us-ascii?Q?WCoIBh0ShLCBcyotU/I886O3JhHcu7kY05F4OnGpTyUHsNE7mj7DDGXS7VJ1?= =?us-ascii?Q?GdVQqdvxsGfv9KzT7vli/01VIMICrcLBILbov1GAAqEWrExrvsHRZC/M0FNT?= =?us-ascii?Q?ncKomni+bxoUYD/en4szimgigd3w69COL9W3vEFEYWJES72IC4B9TdJK5JU6?= =?us-ascii?B?UT09?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 6:pfXmrIMFCDaeh5E+l0irWii2nDLftpXBBp3MlfClKeqwIftys9oQ6vr4n5zimUaBX2fo6+8u+GWR0IvWXCxQrndoM7VMBH6BcYWRxKQc3f96nZ847BzovRpYiG7vULLJGgp30uFpu0RQAK74PUl77YuAMKTm3nslQ1V/YKbaVGZkXsiMpn7+7JRu6cxh8QkowoYrOA8Je0CwVlA/DhdaL5DVyyq8SLPdVQ2J/8U0Y+hwz+XK3dcpYXNGzaTvwKvGx0n7qAy8pm80wOI9tmU0SLthejscpYvr6dSDCMIoc0CppqoQXODboBz9xags6Xppd+W7NqMTx6EYb3lLCSJzpXxBQC6gB9DwumijPEQKjmk=; 5:9Lyju/npvYk1h+Mnh1r+H5d2yrgsbZOFiocgeStMwxghAOKJNF7/XDF0ULSZGE/TEJ52Z8BO0QjdZKGXKqHn+/qU0K8xtVYyAJgB/ehor1t/kTuTFAWeynJiVVAjATL9GJM9Pe+/lA1RuhyffZXZ1ToL/OkX3jrYOJ/oYIZao6A=; 24:YOyVVSnWBfjoFa8ZlZVhG+N1ohi8JTYnRY7cy9grpchSIrgpyB8psBqlp4Aca4sHxAdIbcGov3oX15cM/0T9ixBm+2JTvA6iMiEqtdvM65k=; 7:InLv7GCPVLWIndc9J0ytvEFFuqb8eEdmL7NdxOCR7ry1Y3ltNcX5a4T8t04oIcm6Gbt7HeF4cNy9VfAzEXQpn0ryWPonEB1m3ETYm/BZuekv0AR5uSzh/rP+Z/PPC4EIZbNg+d2BzHC03vSV3xGNqC9bm17EBWa7Gvsuyy+B2uM1sQAlN+1o6h9ujpLIg8Y373bO+lmOWNDTkzhkDwfTYVYpVcVDRtodZk+OmIzdHiON8N1uMreigq9oBdNOQUZk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:15.7225 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a761ffc6-24cf-46f4-fb24-08d54c426f38 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 02/39] examples/l2fwd-crypto: 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:17 -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/l2fwd-crypto/main.c | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index d4e1682c8..06c805b87 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -235,16 +235,13 @@ struct lcore_queue_conf { struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE]; -static const struct rte_eth_conf port_conf = { +static struct rte_eth_conf port_conf = { .rxmode = { .mq_mode = ETH_MQ_RX_NONE, .max_rx_pkt_len = ETHER_MAX_LEN, .split_hdr_size = 0, - .header_split = 0, /**< Header Split disabled */ - .hw_ip_checksum = 0, /**< IP checksum offload disabled */ - .hw_vlan_filter = 0, /**< VLAN filtering disabled */ - .jumbo_frame = 0, /**< Jumbo Frame Support disabled */ - .hw_strip_crc = 1, /**< CRC stripped by hardware */ + .ignore_offload_bitfield = 1, + .offloads = DEV_RX_OFFLOAD_CRC_STRIP, }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, @@ -2356,6 +2353,10 @@ initialize_ports(struct l2fwd_crypto_options *options) for (last_portid = 0, portid = 0; portid < nb_ports; portid++) { int retval; + struct rte_eth_dev_info dev_info; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + struct rte_eth_conf local_port_conf = port_conf; /* Skip ports that are not enabled */ if ((options->portmask & (1 << portid)) == 0) @@ -2364,7 +2365,11 @@ initialize_ports(struct l2fwd_crypto_options *options) /* init port */ printf("Initializing port %u... ", portid); fflush(stdout); - retval = rte_eth_dev_configure(portid, 1, 1, &port_conf); + rte_eth_dev_info_get(portid, &dev_info); + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + local_port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; + retval = rte_eth_dev_configure(portid, 1, 1, &local_port_conf); if (retval < 0) { printf("Cannot configure device: err=%d, port=%u\n", retval, portid); @@ -2381,9 +2386,11 @@ initialize_ports(struct l2fwd_crypto_options *options) /* init one RX queue */ fflush(stdout); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = local_port_conf.rxmode.offloads; retval = rte_eth_rx_queue_setup(portid, 0, nb_rxd, rte_eth_dev_socket_id(portid), - NULL, l2fwd_pktmbuf_pool); + &rxq_conf, l2fwd_pktmbuf_pool); if (retval < 0) { printf("rte_eth_rx_queue_setup:err=%d, port=%u\n", retval, portid); @@ -2392,9 +2399,12 @@ initialize_ports(struct l2fwd_crypto_options *options) /* init one TX queue on each port */ fflush(stdout); + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = local_port_conf.txmode.offloads; retval = rte_eth_tx_queue_setup(portid, 0, nb_txd, rte_eth_dev_socket_id(portid), - NULL); + &txq_conf); if (retval < 0) { printf("rte_eth_tx_queue_setup:err=%d, port=%u\n", retval, portid); -- 2.12.0