From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00083.outbound.protection.outlook.com [40.107.0.83]) by dpdk.org (Postfix) with ESMTP id D4FDB7D52 for ; Tue, 12 Dec 2017 13:27: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=qUm8n1t36pRo51Od2MRgcwG+KUBVfNi/P6RzzCvKFXY=; b=RTZWPnoAcvMTkiwb2SEzm5T5/nNV78DsuXQcFhm6SUtTMtxbXDAlE6VHZnWduxa9FjKdFblJ55uvaDG5McLZ3wTtkXIVs+G17/pA2XwP7FiACIJv6oYeG3XA7NzcCcCh+sQbMrpw18p3gnWYtso9bD6o4kjhLAUNHPOssIHOAZ0= 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:23 +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:19 +0200 Message-Id: <39aa1e65c763ef92299c40d3e7250ad606cd39aa.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: db2d20d7-31c6-41e7-516b-08d5415bb31d 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:G6OZm0QdlYHRNQteuhaYNTO6flHBtcsDyHetJLKnXrR7jjpokNRQgruBHS/X6tn5J538hJ2qVEhN/IzzEzsO94ONeRdjY0uKwmyBCwZ9PzPfDkUGGnZfG6jKhdZ15vYIDOA4L2KxPtGCfOYEaAc2f1FJ5Z20k+teTzbnN4b784FZtf2Rtfzarl1UY/SQvhgP+GJfIo5e0DMB5fb1tGtAW2LIgMfellQbFNXVqIa60+KXVzGXuJJIpnQH8xrjnHMc; 25:6N1lBx50rk311Ljzl0JgOe9NtG9ngxArSjyQKU9bn8+e1fynRQE0j9qYEq/0n9FLqzDRpEBSh/ieiPXCGAPHIxq6655OdthXUY0t7twapE5A3NVCQ4fpikMdsIiBGbhuABlGO/M4dw3sO/RQXKn3hR8sxrC3eIdmDL77G+QuxIyR9LsyJAtfSDBjoPQW647cExBgcEIuTqaCVySGoMNJQIJfKzLdFssCNDSwbIdjWqJakKqA47qOEo46hsF0fKDmZ8XtQh5ARrEeaJaSDPE7Ued67uVAO+em1U9fQxX4EceMPGCs2LDMU61H2763rPspd6ExSuNXp9sPoB6Gr+KXyQ==; 31:Oubmx/251iRtAF5zvz1BzMStcHhVLX6Jxc/zKbmejTzZt73ZKW7yFUggiFdmjXmGL8rmv6x9bm/ceiCC+/VcUItBARt2MVjcfUBkON4pYwwX5QMFk6f0fOGYsfj/O0KhYT+8PH3dRkIth7uhn/d6aqq/aQAL78ic1xj6ZdyDVNfmYLALO35vV/g6NuE6GOAsKLVAYCojklsZmGsAnvlUG6SX/4D9cQr0TeoaGZijPxk= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:6fU2jfQrfsD1w6YtR0PBPoAu9ne95gN7ioyHfOpIuwlUBxBzo2Q7Tf2ug7R3rdTI8gQmfTMdVbqgwk2JRKsh89SIVpwj1Vs85c1w66AjurLdehvoeZU6i/2Uj/bQc/pa4PMJJ0pOasWU0oRAlyEP3DoCHplIOa3kKZPjNHhBOl2PtN8ZV9Z9AOkfqjowsGUMRf8AkXTGzUcpXUfU0eX9/M7e5ZgI9NMl+qMAp89MRQsOR5SZ5dkPVNMcuvMMIMnCxtQB46V/9zq5lzDO2w2Czss1/Lp516HLjIXJc/IrLktEnPZlZzX1CyAbKMIHqIeWWEmCOcUOqEl7Pu1mO/goB47MzsX9MDuNTiYWGWBnqE6FOH6vAOQjjGEmnudm0cFnOQ3i1TnhIG+C8YMbiK/W17mcIXpiE5ULkhHkpZjhUGmxwZKJCHhaHIyG0ftQM4Qn80wY7wYdLUvNxjHMTq7fRr8uD1bO2kK4LxZy7NP1Jp0lhRBPuO2fhGHD+pzxSMAe; 4:VIgfMQa3GXa0aVTnW9i8I9X4lobmnliT+kSxWKR2AYh7kVliEYfEgarv2E3VcxTHsfNvMcjvVpblYlDXS0RbzgNd4rMD3hF0g2q7lEXK49n/fwbABN8Tj5Ly6rJM9lslgkqzE/jWl8BKh0pFAyS4VhwBhC7hl+8gkfaeDib8QfZq4vAeceB6EBNZKwXHr4pDPq4nVAc6/x8/BodrOOuNO+pulv8ojAErWZYtRllg6zziFNnYI4bawx9WvMZKM0ijTiiF2DVoTSlHQQU/LeCHHQ== 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:bMB3fcLn7veCiUmRO/tTcy/XtOFJ7QwuAutK/9lBh?= =?us-ascii?Q?B8xJy/prcJX8enjI9+X7nMdu6WAaUMkA2tI4KIdIJlsO8pdl0WdmGqIaPgwF?= =?us-ascii?Q?/IiCXzLF6RFjJO0OdF8i6zKKHbX8+qBfss3LsHlQcMbpAI+C85vBHYcFlO00?= =?us-ascii?Q?u6Edkpds1Qr2FcNpYsXwi6b10GMiCtUJOKAC3AIEmh59cpoy81Yu65bFsAPo?= =?us-ascii?Q?PO4JXUfyW+jX6rMKKnHxqe6/2eQx/wIDvqnruHOn6EsHVABwuLIjntiIk6Ar?= =?us-ascii?Q?7OfbmemY19ij91IYDOT+WL2BJYIy2IJeCIqmBXB8+b7/doCapWjl/KJtYUSU?= =?us-ascii?Q?DyTPyHd7XQaw/WV2Lz4fbGka5dS0HVldbvHSJGfoXdoXb7xRF+71aNtq/gJG?= =?us-ascii?Q?QveIkeHw1krFCE3qtwBh26VL61lLOcQbs5YicRojXYrx9F/VYW2h9UR7Ihnp?= =?us-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3BwClqp7PbvlVdEcPlt0fNjV3OfO4s2rKPbPSOQ4MYILcEYiIDp9zExxFyHheE1P3SoBJWd44vhoT9ZISdmcmeuTg6qMhS/mjHg=; 5:teFo75HCqQ38LUxX85dii2eBaa5c9I4K/EudBfgGN8eBcnSQiwws0rBj6FYKezGJ4d5JB62/rHWTjONQYyNaroOkWw8A51mhVxAjAc/LCz7ad5HaOdvy6ZSG6qM9DPJFh5vkEP6Ll9uzQE0na1Kit/EHCW80byVX+zqDYy3IAv0=; 24:ZVZWOuByCV/OR0k3sDwXJ3acB4YW+dKWJY4lAUrsN/gUfC4rTIDshnznNfFNHwRHBCiwMm2+MW756TZNfyWb+AtilKeeaYY2UN91+P6DxNY=; 7:xQ2oiW8S6F7D8pg/lZJZuNQS/a3XXPTIcqmMDA7oRA1KzEcO2ZUJr4gOSDhHOluk36vtlGw3uELqSeZ+iUTcN2x7DaJ+aw88DQNRFv9CUlUMftUdBFtx8sf2EcTehvdK7irKVfnAV3vANPLJAf6Z4GcVsDgF8Tc3gX1OLe3WuPxKDvxExKOilEfbRpc69N8/594+JSysksBDUrFMIFCh6w2JkqxvOSZN3R4kIwRadFwoaXDkvc0QPToZUmQ3IknB SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:23.6915 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: db2d20d7-31c6-41e7-516b-08d5415bb31d 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 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, 12 Dec 2017 12:27:26 -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 | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c index d4e1682..81d2957 100644 --- a/examples/l2fwd-crypto/main.c +++ b/examples/l2fwd-crypto/main.c @@ -235,19 +235,17 @@ 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, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, }; @@ -2356,6 +2354,9 @@ struct l2fwd_crypto_statistics { 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; /* Skip ports that are not enabled */ if ((options->portmask & (1 << portid)) == 0) @@ -2364,6 +2365,21 @@ struct l2fwd_crypto_statistics { /* init port */ printf("Initializing port %u... ", portid); fflush(stdout); + rte_eth_dev_info_get(portid, &dev_info); + 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); + } retval = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (retval < 0) { printf("Cannot configure device: err=%d, port=%u\n", @@ -2381,9 +2397,11 @@ struct l2fwd_crypto_statistics { /* init one RX queue */ fflush(stdout); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = 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 +2410,12 @@ struct l2fwd_crypto_statistics { /* 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 = 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); -- 1.8.3.1