From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0062.outbound.protection.outlook.com [104.47.0.62]) by dpdk.org (Postfix) with ESMTP id 0F3471AEF0 for ; Tue, 12 Dec 2017 13:27:28 +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=vHsVfTcSwOH8BKQsUIgDGojFQktPyr7Ax7+ORNIuxJY=; b=uTZi19oYxfYhIdCateThF2NadllhNEqoFCx9refXkPDuYgT99DDgeQ5v7V0O6P1f/uUdw/dDIpMiVd5mN+N4gaM0u2mYWR+4BjYRwv8ytXnrXHHkgsW8VfxcK5BAxGqaZrMoLI9rWvho3VN0q0UFwjxEz/9+87sLZR+e/VecC3g= 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:26 +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:21 +0200 Message-Id: <403a21f94c5998515db377ef6143d8340cf8ce93.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: 8e08cbb1-fe6f-4f77-f222-08d5415bb4a1 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:3aHi+y188vP7KS0XP/G0SLykZVFBrxXSy1MrkVMhxpWYL63vGNx1M1P5DQysh9HtFIt94OsHZSB7zSGER6aIraYxrfQhBKHUgt1uEVV355oIfmHX+bEyal9fU9VsPKZfTVl0X0XVAWKc/g2Zj70G5g9lrD9g8DByeBP7tAAt15NqHmP9Va6g/dzpTJHosoPWMkcppzkS6YxJZ9V9SHLgcDd6y7nreEp/YwAHr56BdFiN0TVQzGIwtPLuyFzybEbR; 25:kbX+Qo/pm5n4+ozJM4qKe0YxjBaJIbdhmnCrSoSM/tMYYs62sMkkN8KCLcIwcSNmpd+gqQmC0MNteMIbqGmRmAKL2y3vtise5kOV6TfFx4l71ztEfiNXlKQLNCXBqCSSuQQZKjgVJXkhD2Ub/Ed2fD1+jpJfLW+QWL3WRSSIXCAO7NX9znoU8JcO0TFLno5Ox52pEQxoP3wxHVcCYrukm35on8yKTclXKeqkZVubQt5+xJ8iszTHTxQ1aT8nBZgEt1FnNz423ZYg1G0/Zy08mco0Sue8HsBDCEucdoA0T2uwN0U3x7Ejl9WBbXCMGQKv+usKcka8O8PHZksJHzDxOw==; 31:Gl4f2yJSTcyFzKLfJBmv9MQdazZVaaSN0i76wu2R1r066pzifkECfg280aq0sgz6+glWMFCmQXFnYnJBsiGEeoziQp5aLHqntBoK+n2CeXPXbdTwRS2koS+o994fi9/sJ5R947se7G3DlWATivand3l+62UroFxWY2WJVKDQwA/39w7a1/RNv6A/KQmtCCc7FZzMDCn1FQzoazOKvdD7cTO/ll9+y1K4b/T2isw/LSo= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:Grn2pl0GmxqnT4uE3ack1JJW494YbAKxhC+ire6v9xmJdJaLrc8shdcDQbQsyNdvLRjeDTC1s2wu1rjYf5OP1SkUU9chQm5WflDL9WNer01wUL+KTyIy6J4sxVHtZ7vH/Wwn50ApQy39wBIZa+U0sJP89PrPNaB6Z4Mp4HX+CSulEDrzZ1yh4UnoqjW6FjFrd5jUXaSkW36Yrp88F2wph+t5jIOOdwEBKRvqreMwg75HOXbWpVnkWxlNjeZhw9E4lLWi+2M8U+ICiTp7KmBsDRBBhKQscxgDNND6hIAfC9E1XSA5gTfIdshSX9Aif95tAnbZSGP/RXEb4YS/4fMkGmezvODsPU/YQRcXUBQIlPSivfiGMVmXKiHVBvE/GtB+bMAzAlUSas8J+cSnY722RoKflvwdlQYiJbT26YDHRMTHi9G0piNazxHnSNitF8X4E1FpoJx2QoOrt8hYHntnFm8eql+j/vDFM3vhLtEQ56DcyXS2lWQV+euu/ZlS1EFY; 4:Ilwky1P/guEJjlz+d2plmFgP7ArKQG6e8spdBmw0MnPPe3NSVM1T6VbQmDlL6XItYYgX98ON25tGWU6ZyU5kKG5emSBpsrmtyN1TLlcw0G160o/bVmVdkN+W4iRiO5x5W0HDe+CDE1SIofz7856ixXi11GFksDjaBIWfS2kgfmWkNMC0kJOlBttCFFqY6UmsLvvPfti4INsQToEt16nQAQz9FYiySueDZGZz51QJVKiHK/SDJu/cQQre7j0OlJrcSs79GTyGwDXAaRtXirUcUg== 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:xTNn9h5TNXP6G4i990SSgmgZhOsXs/12AcUy07zky?= =?us-ascii?Q?IdR89OtfstjXcc2oxZMgmjBHnS3CTbL2lhcmnO8Brvg1heJACdNhskkNhHPb?= =?us-ascii?Q?Ad3XWwiWUxBueYWYZMleMEZo9cdMg7S19A82hvMM2x+BMJ6MVi9S3dN4FL+H?= =?us-ascii?Q?/lucOst//cq59qz8vCp/RRhADH89RgcRTUobLqL4m58JoBZ+Z2Xp+pn0hAwI?= =?us-ascii?Q?i4D+d4AhuNRWW9wj9aCIfE01NwLx5FsUOfgF1RL3o5mvnXIW1wDxBtyubzku?= =?us-ascii?Q?ipyJ2K4n/RYWX2DiibWbR9tHuVSVEPdy7TQgl1Vd/a0YA0VtIUFAipYcZ/ZT?= =?us-ascii?Q?Licly+fFld/1x4vaHnCtaHnjpNAsocRyHnZ2k3NjyIA0j6PdHmODdd4WhLJD?= =?us-ascii?Q?sCSR+IOoW4XcYLukLkR53oMEhJ0zeWhjsCC/8/vXvu7JfXd64c927P+I+bb5?= =?us-ascii?Q?w/DjCBOhxH7DMGwDaN7srlDVv1FLh/pSq/dpYVauqXpBEwyCbqddhgNubMkY?= =?us-ascii?Q?OJuGlxxlNNEiWeLPsCUT0QsWanGA4deWHECofwO1JxTXuqPXXXnfVms3CQ+j?= =?us-ascii?Q?8h2d6NQp6tYWnrrt4z8T+YY2DlGzECFxBW25hK6WXek5/tA+IxIdFCtBzLLY?= =?us-ascii?Q?eAgyndqKi3nMx+Kcs8QjyiJTsC40mYuuXrzRR0wqr2WRrcLCezOJLJ6MF0E3?= =?us-ascii?Q?jW61LjZ041R3GhCd1ivUTkT9tn03dYG4nxZuj2mclzvDDOyqej6P68p38pd8?= =?us-ascii?Q?Ds4e3OjKb97bv1m7Ti2sx90WcV1cIivHTgPRFJRStynq9tiDZVyUhWWYfHI2?= =?us-ascii?Q?arB2hHF2Kz1T13KLQQRoiwmh4NrjGmVs6hD23zkplGRjZJu/TcHuEl4kFAkV?= =?us-ascii?Q?R75/4fBoC/QaBxJvFGSiGbfYvI2JYU5l6UVbEzR2/2oazJdp5p2kWpmuxrMe?= =?us-ascii?Q?VOvZRhPo2c+6rkI7p7zRIfnnq4Ex+dozFmte4hd2mU9a1DkAxtlWLliBKdoG?= =?us-ascii?Q?fQV2/cvYz5jDKptoQ72Z5p+MJHz7AGRINjcpNLCTwCsGeHfsdDydWU0r4MTo?= =?us-ascii?Q?Oj7ae0VrT1U3NDsUNi9u70bnre4?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 6:giniiHlBf06vHfD4DyguEla2AdrRqhZrKx1e3/CO9aQaaXnVp0BW96B/tYh8AqIUefYTypOBRIQtHjNKI4uXp72FJUtoHKCsdvZIW1O397W4E6SLP0ZT7UB4cqbrB91Rq29WlJaK7XyNhLjNy6ha/jCxgjW/9j5di40hywC8f39nYRg72h7v8pErxap03cUwsGbsxdMXSmQCHjIVgZoydfO/+k6DStz6D5CPv9A/f2egJXGkqPlkFBhvZ4/pXgVFkXrt1+j13FUecQHiMqz1uQX9YiFzGO4i7FnaDg9axDsiN1tFwQoW69h49dBmPr9C6wtcDK2Qb9S/AZXPeVJDDzFAmdVHs7r/9nYoZ0Ch4yw=; 5:a+UEbJL66dopfUcLGAT4n2FDtAhH64jDfjdYoRMNdNIHno8QrBC8D0P7UTWxPzfoyMSRRvZW7Ebb+2n4Aq7jEiqUz1mqNV7YXcUo5mWPX2XVCORnM56XA2zP7Ao5qwyzZ1OkiMYMvRITk9Uydp/f8CjJP1Y0Mq40VuqGktQFElE=; 24:fDp4kIH2AzlINLJA3c7UmVl0/JBKE2Lgm/UbJlO2+nPGR7r3UPcnng13992Ta+GysDCEfgFjj2v7F/oA44Y1MWoHBa9j224q+5jlgUfBgKU=; 7:AwBgT0oAkbHEq9zEh5qKl9r0UyJTXcHZTh36mDE/zhM9UM9j7j8/3zmg5wp2jEkwRRY8uVu6gGxaDRh9qM0ofg5Kg+mZSW98gLudqTHHQLGpE43Dwuli9eVn3wAiWvgIwX6ssZPz7hkA2gnd9dAZvlaplKmFp5J2DgiVI1Gfh/5G1f1D1+wRQSzVQefQafZnUEy0oAKoIwZJwEshmPiCUPJjT41FArd3N1JJM4rZDBzpUwOFj89xvkyDn0Ni3mV1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:26.2384 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8e08cbb1-fe6f-4f77-f222-08d5415bb4a1 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 04/39] examples/l2fwd-keepalive: 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:29 -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-keepalive/main.c | 38 ++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index 358ca5e..a60d3e9 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -107,17 +107,15 @@ struct lcore_queue_conf { struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS]; -static const struct rte_eth_conf port_conf = { +static struct rte_eth_conf port_conf = { .rxmode = { .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, }, }; @@ -658,6 +656,10 @@ static void handle_sigterm(__rte_unused int value) /* Initialise each port */ for (portid = 0; portid < nb_ports; portid++) { + 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 ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { printf("Skipping disabled port %u\n", portid); @@ -667,6 +669,21 @@ static void handle_sigterm(__rte_unused int value) /* 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); + } ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, @@ -684,9 +701,11 @@ static void handle_sigterm(__rte_unused int value) /* init one RX queue */ fflush(stdout); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd, rte_eth_dev_socket_id(portid), - NULL, + &rxq_conf, l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, @@ -695,9 +714,12 @@ static void handle_sigterm(__rte_unused int value) /* 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; ret = rte_eth_tx_queue_setup(portid, 0, nb_txd, rte_eth_dev_socket_id(portid), - NULL); + &txq_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", -- 1.8.3.1