From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0089.outbound.protection.outlook.com [104.47.2.89]) by dpdk.org (Postfix) with ESMTP id 54D9329CF for ; Thu, 23 Nov 2017 13:17:09 +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=JPpWdvyXtAWp8u/yXWGjaIHAYCoKFWP0en5LfmVTU5E=; b=l4WxuTF1c0EjgjLBIk/PwTcHK59CZ8/pfVQbk/OIXSOpHt1y3tX0ZWrWx2+B42sBmjP4RfJYyNIsv64wddE097vhKoncoLXxSCnrtJo2EXYRNjrvLCXzZKkqMiJMu9fBCGJ5DCjvFOWQlCgNjxGIz/9OxE7yJ1h/7TDFNqqq5JY= Received: from mellanox.com (82.166.227.17) by HE1PR05MB3147.eurprd05.prod.outlook.com (10.170.242.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Thu, 23 Nov 2017 12:17:08 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Thu, 23 Nov 2017 14:14:13 +0200 Message-Id: <20171123121419.144132-4-shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171123121419.144132-1-shahafs@mellanox.com> References: <20171123121419.144132-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: VI1P18901CA0022.EURP189.PROD.OUTLOOK.COM (10.173.66.160) To HE1PR05MB3147.eurprd05.prod.outlook.com (10.170.242.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9368bd06-f857-4b58-3801-08d5326c1e02 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600025)(4604075)(2017052603258); SRVR:HE1PR05MB3147; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3147; 3:tDrNH1AjtG+U1YWLpE5TFE7FV80I7QtyCvcj9RuFFZX2mOFFDeKE4CMMQpcj68UStWH9XEaL18R/4BsadscRJKUwggL9Q2LvaXYMqrlG0akcedh+mTBQsg3uEKKluG8D1mAhEGMZeaAiwOVAXWAVEtU/j47JMiRiYza1fobyTr+9Ajd17Adlqp26ADrxtjSj0hOzirhqfugTEomBgTUgRp3bfAEp8+AH6jkK0QfNyCIvjBhDr1sXXNIkOhLz6nZu; 25:/YlWEyuG8FI45rOUKT6UHVFAcJ9DVEgcQfIV8YWQP24zXKOUJNH39LQHi3SvpSz/iNCTxvx5ZAUklKxeU2KlBOy6tSwlbhkyj6qKy3WSvtPfvdggsL7X7j39KBd0myVufNz3u3yAqwtWva7oa18bb3Z/+6c9S/8yStM5W5S80hTA+0juji3ZymZivUXeGhJKEZa+z+lnKgJB+S7jD4NgFOu4Qt5e2mbRe1KqRU7pmRY+zsGKAsWA/gJLEnKbkM19YETkhHO/woSBg3HaYQ1RNxNnrsLvWfULpoEMR1+mryLIHoTP3P/VDZwfiR4EB02ISUH+H1QIL52WEJeOFtZH57rdL1zLlUGuMsXSGZIJl/M=; 31:VZxKQ4h24/Rb3lC3y48a8NOFYiEILcY+SBH9tOhUixOHenef5ZmqBgazzkYF74/0qp9Zko3ZXETYr1l7WKlqoJlptlGdO+PWmutTviQlyBfsI4rL+RKcuyQiHHaWcy69rK8Gj+86S0a67yE6kLlNCwhQHX9NC1YgNDL0dZd/ccoMzei3ajoKwOhpfIRk/hCMisKTMZJYBfCGqPyX3AJSJeFkC8ZK0lvVYiF9upU0aO8= X-MS-TrafficTypeDiagnostic: HE1PR05MB3147: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3147; 20:jht2YOxTEXge27wB6n1X0cu7EebSkl9DT15IZbsNkOcxP55c2BKuOfSsb9SbTLX/Jdq3NVKmdvPERC4OUzeAQQ8+bAdQiXLq0P0BnFCHOk8ycvlzQDyn1Do8SE4VSMS4uBARurb0njPBu78xs2BR1q2EkpD2uMg+Pj15Pzmtl/Ar7zp5oKTAnVhh7Qimwb4yuhs1d2biGndU11PF32F15CcvzTJLlBbO0sFDQLgGih1+2QTy9jmtV/PbSLYSKbqkZnFIKdm0yKbPUn6pffkX4XQfr8TVhqwxGe9V7F5/E3RV9/elrP08ww+BhnW0xMRbm95k3rtw39Jkz8dFzrw8eWrvrM5+aNVS14hf9n8Ppg5uERUPqa8qvDkdOQJUnesG5BXq3wKeRUmImtwZXOGAULJjbeA4c+d2rBNqGolnlZ+/AN9Fr5DcGxqMR1SeaffKH7oyUuF78udnCCiwtZc2ILs+kaQTu+WbFnoEJ+X5Z+XrazwZEoKeNTbJ/QwzOdbo; 4:S2B0k+2JKOVXlxVw0cTW4NCl1g0RGU9N5Nz1lCJk3gHOwh70M1WQ6itulfgJlPTx4McoWHVBjvD1wI1ZiBdF/BycqTzhi1gXOGaVKO7MxVyCDPMG3E6BV29P843/hptTrPdGAVAL/wDwJu7YU72qJIJWzhdcEV2rscrHq2M1tbB+mrwx5/rERWedCpijKRbekY1mSw+5QGnadOTKweh49JbfUCg1gBDGHxygaIyCobSEdyTWi1c8HsTMaJC79kEYTBV+gEqD42W0lkDwn3fsZA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3231022)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR05MB3147; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR05MB3147; X-Forefront-PRVS: 05009853EF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(366004)(39860400002)(189002)(199003)(106356001)(50466002)(2361001)(7736002)(105586002)(76176999)(55016002)(305945005)(2351001)(189998001)(101416001)(97736004)(2950100002)(6666003)(5660300001)(6916009)(69596002)(33646002)(50986999)(48376002)(16526018)(2906002)(47776003)(52116002)(66066001)(36756003)(21086003)(33026002)(25786009)(16586007)(316002)(81166006)(8676002)(81156014)(3846002)(6116002)(1076002)(5003940100001)(478600001)(50226002)(8936002)(68736007)(86362001)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB3147; 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; HE1PR05MB3147; 23:g4qz1smdjCP6H+HozQzeXFru62yMyDV8suki6WJc9?= =?us-ascii?Q?/132kdUN/JuNjVfrEiHdExF8wz8QjqEjVHjIeIrSG2urqo7E+shPkYxYlxuu?= =?us-ascii?Q?JQsLXDWxkjKqozXtoo71FReN24o9mVvjNzUuAWah06phClrpEq6ObqQtUuni?= =?us-ascii?Q?wGXH98SHdfIjaVyqFhvh4d1ESL03hCZTCfafusLU0trxJJsbAczY2BRFXa0Z?= =?us-ascii?Q?bsrnanQf1LCveWngapEH07QdYojiEE0PI29YpiJJQyBjtPlRiSgoNnH+GScq?= =?us-ascii?Q?ylRo5AYQxs5S/5oL3FtoClmaYsFSHZQF35RY1wvu9tbEet0At9RNR0ten36d?= =?us-ascii?Q?juuCytkxYCwrRWAaUXnJjRv42QAUL2qRJmxqeRa5PATxz0Irk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1duuOUEmOx2DkzPo3exaK0Pm9GpE14onT9LEfzGSTb/9fsaqg1A0AvM6b1Z3wRWg2qOVAqiQDKtTt5/8XReAL+lkBIOm9jBIhMDfXqfiHvfI4WVBAzCTyz7R2hEvycH0zRsnoccaKgdJiZ4eNzDxGNz59K3mvcHej2POe2LnIOrSa2A39/cMuN09pCogTjEwUfoph1sAeMXQLTsLYIqO7i4fDrN26OI2ok+Bv7gcXLLh1iFUQCvhJu3y3UFXiHKRHWni/Vy1Rl86Q9I7R5wGBUpx8z8VGCLV7Mp3Kq6mXB5NvEB47mfp+nT/LnOvQxVSzXr3e7ILAEovbB84RgGu38joM=; 5:YfeM4H1RWX24wYMS6DPAv0YCUs2PPuSb8Jq+eW4S0kYV5aMT7asbL/gA2fBLt2yeDGCQJyyljbMU4MVkn7V2lJk62CadKFRUimT77qpN28hlDoxdGGUZgdnI06aWxf9ckyYuCwPpl6hbW6pxXzVKgX+N3dETOVyOtyLyfI86378=; 24:kyozy2QIhVpsUMkgDalmwen7ifUkyY/TndFdZmcQd/ANyxzqW85CLIoI4zclIpagAXFdv/Q2SX5RBHNkcwE5MumLxeNoBusFHBk0mcx+qcc=; 7:Xweza/87klQGdEVrSg17TcMvPVCsYy73GWw7V8e0/e/Ei0nkUWK83lF0/N3IKZGxshed2tHvXwFiMnO+nj1sW5t5MVpJN2dYbcEbvbxmOwwkTaKa8vFniBJlVcl55R6PcaGZa4AuLGgCiLoXea/+3F1Y1QwO3O4QAnwP5wHyVIoaLUIwGhPRN9OB9ygz3gVApVJw8HDNdOmdL9brzn3r8JxJ6WztdHj+xXDjbAhk18YudT82IGFanRDhV6Vl17Xs SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2017 12:17:08.0205 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9368bd06-f857-4b58-3801-08d5326c1e02 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB3147 Subject: [dpdk-dev] [PATCH 03/39] examples/l2fwd-jobstats: 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: Thu, 23 Nov 2017 12:17:09 -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-jobstats/main.c | 39 +++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd-jobstats/main.c b/examples/l2fwd-jobstats/main.c index 485370de6..f522cd905 100644 --- a/examples/l2fwd-jobstats/main.c +++ b/examples/l2fwd-jobstats/main.c @@ -116,14 +116,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE]; 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, @@ -866,6 +863,10 @@ main(int argc, char **argv) /* 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); @@ -875,6 +876,23 @@ main(int argc, char **argv) /* 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); + 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); + 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, "Cannot configure device: err=%d, port=%u\n", @@ -891,19 +909,24 @@ main(int argc, char **argv) /* 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, "rte_eth_rx_queue_setup:err=%d, port=%u\n", ret, portid); /* init one TX queue on each port */ + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = port_conf.txmode.offloads; fflush(stdout); 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", -- 2.12.0