From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60067.outbound.protection.outlook.com [40.107.6.67]) by dpdk.org (Postfix) with ESMTP id 6B5711B3EF for ; Tue, 26 Dec 2017 10:24:23 +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=/byItahxApGPgb0C9IJL2m1Mj+8z0gWojNdZB2GyUb4=; b=pCMjr9BtgvAlLuhdFqHWPRTnSzc9bLL19De9+baNDkxXMZDFfzLVW0eL0eoP0zyCyuOsR0Vut8r6Wq3eRZ91SWLIHci8VnBm69lLtl+6eOq9WtvEGzur2jSeW4JUqDSXO9VxzW0xt8hnnXWC/UszcTm65nbUOXd0MVVrCygLEiY= 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:22 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:06 +0200 Message-Id: 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: cb869d0a-97b6-4d37-202b-08d54c427308 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:hmJ8h/L8QLSgIPmWJ3cosii8X4Z8bPy6AeFYcpS2KxX0aaBGlKelFEsKQhzEcopDMdnLGWoLWMjuoDkKhHOJfgqgOehEnY7uaFQw88qpzHsHjoufoQsKz9g3s8pvA+kuoz7+U1NnI530fDrcrdjz4CdYU1cO98op4Cq5YkzjfuhIoRV7W2udi/ARd+S3MjSYfxL9Ce5/SMVDLdJi7lTadrboBP7jKTbAbx4206UPfU+hlw00N4D8dS7y3ky13ncF; 25:wL6GJzBGgxDyMOnXV2j69kmVGge8VsW7HCW/LKfBaqu7Sa0PKo0/PYPM4KJwF/zXiSoNZRkbtfQs9VrLIIE/S6QQWY0pxn61XiTYjJJc7vwREUInIFE4qjqIay4bJzSYDOpFQMV2ZkhhgQRyFhLwuwNghLeAtBwHdmyxzoflXqAAARsh+Rtl7+JZT89fQSWVIJ+393QhAUwvQufBBK0CtvHz6OWpFfSm1wat8ARVzCcVdPRBGOGWTAJsLx2g6utIrsdG+Jp6/z/kqR8x1V0t/tHnbF3LoP+Pi9y79wZVstE9bRVdrhFQPzE2L7Cl7wQLTTln9sZgu7YjRl7ULxf1pQ==; 31:h2TZrseg0/pvivCfPcp3Nuu/4V/lNbHacF7TWMeyUIy1fE66Y/JVt9d9D6oxau87C4NrVb06rg2in3kvCuq75wq6abJ0eWW1Uz2vdHaBCUC6GB2POlUuq1AQzKXyLBY1BRhkxR+Th6o0N1GHM3I1LS88SZysR2hyYV6sVmfjUdsGH5ffcrtIQ6ULBkDFPuU1r08MRxqYxOjvTSJ3D5MNPIk4KAX0wst61wDp3fRZxfs= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:Hd5PG9Da/hgfVpI7ixK8K7ecPkr3RVlenrVp4H6mqflqgXFDhOSlurvEQahBufz9uEh80iFtrcad97xGZBtfUQvPvG1BzVzjPNGSsAOLIj9Ja1OjivIsV1HABPfICHQLYstqsZcf4JsYGIeCiAM6N4IXAOQnG0zfII59DiXEnXLFVr/cltiHpmcyDM6XPEpEKNnOxg4uQBhhxDFRWV0B7Mc0WFlgw+TUPGaTcx+HHPDYJ00v+la5KRJNd9dbidRP7Si5FpFVT8n5uNrhlqwRzgna4SuFrMVqvUipKC1JUBk9g9Fl8dsZX2j1DfG8JR1k6u4/FwOSSnuAmGzUs7UZgisFhP3Giz9ag5nRWzkGIi0qdtwjmEwpZ3/nTJpo9REPWCX0ZXseHIDevvR6VmX3QN+KZ8b/MyDkYYiq4fj2ixIDwaVb5Gv7VuTYdx1LYu9QZ21i/3Zj56sWFhkv0WiFVY0Urp/ouTem87fQt8Rci3z1UAz9i1666xhk5wg7iTcu; 4:h0RhKds3PknXpaO9MiCmgEhVJ7//Nk2kBxgeHRtnTWrNCRuSKkYrmJ38BkpVHm6d8KAjzC0iH7APlPqhuweo71lovkcvyUkclk1/3RtaDYG2gMVVAeMteQSH2Qva+a9bcoa2SXI5dRODV95uIr3vFEY8sXYHttkgtdvsutct9nocwzrDnH7WglNQk4HcKYqQ8gSEA/qG98zQ/N4jtX7lWFHUd1NpU3+cS0/NrBI2M3D2NvttacqQJuRuVqQetyv01GbbP74RI8pdyuNTCVb4l+A/S6UU5JmHD8WT+hrwsb+1Hi32Rsv0lXy7uyJxs8Dp X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); 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:X2nsDgTKszqkYvwA5lZSlGRzsancSfxs9mKEqtPpu?= =?us-ascii?Q?TI9M7cM2YVBr+7mj77nqyqodvxh+6xZWUvjbIzwKEzNJ0CeSkAxgczQGS+UJ?= =?us-ascii?Q?/9RoOnaJKjdl8sNaV3NnV0/SX8A1scUjJfq7WNxnHaZTWYP5zHQVi258+S+B?= =?us-ascii?Q?ZAmyz0Gfwcz8MXJlN00ea8wkn7pjInTmQ9shkVLIHO9Rpg1ZsqQQBFs0he4I?= =?us-ascii?Q?oYIDfLv1FZdhQZQn4ppfZJDxvAmSH16Fb7FRT6TIiUJmEXayySV7u/P4/16t?= =?us-ascii?Q?wAaSp1dhF82sSk52AudlVCAZytL/6BO7CSGEf7DT0k3mxMXTAfYWMaJIw2wU?= =?us-ascii?Q?x6ctOePPAjKfKcI/0/riBYU3QTyyIRiP6SXiRhonX78ECTNE9MJd3vzrj3j2?= =?us-ascii?Q?jJ0PNLSYPm2/ITrB0X/d/oPQzitWLVrUfIrzGxxUNvJDLRbxsNFBrhqLaCCp?= =?us-ascii?Q?8uOP8vK+MZGGS7T6E3HdXZZLXu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fgGl+UTuRxekZA1dPWAPcDDeS1vWmmmqQiG7P8CPV03afKphQ4AHJjoXsYNvhyOFRK6hXnY5eFmbBYO6iK2Miarnu9bjJ0vSCQ+xpHz15Me+sQGC7YWN6GBhYJyNV4gqwt0mcYF6UTRs3XK4JGHYA6XX7r99JgC338M7c866J9jC/38CAiXzpB/aqdyWcUQt3Np/GbKdI=; 5:8/YwuTxArlpPJPAOLAC1VM9rpOk1JA9/jxGn+yTvoIIYbiBDFyUh9i/5BDhVAXSTRlaxJgxPknM8Q64Kg9AFGQ0YSTy/ZYZjIB0ayLc9PWQznsJ8W4qgfFmTcaQ1mUi4JWYJSYTU/9lGYJl+6+/tsm1/bR4HReP0jOuSsaY9pk0=; 24:+Yf7ksO+aNtkwJ8gcC6N2TfeqPzNGM2Q+zNvip8O1qjDF31anNmnAh4t+mw4ZeeTo0qA7Zb8KB0T4xvSWY56YPqC160iAf28Nw03xWUofEA=; 7:iDMCtYy+OmGeyL9PjKijEucW/pCHHWJ5qqgJMVLscBVfpHu7yJT5AZcWAHIsrIt19/UpKz4DxL4um5VQV9i6iApB4OsGA5VVklHdl6mUrA7k6t3XxJiqEddVAz5PQrb16TuqbAdDyp6ArHkhfMS+XcSnfqL8lGWKZjU5XQX7B5gSnPzOLhYH7Pr3b0j9AOKpxtE2rAIK0dm+TzVTc1gPiwnVWYkQM9YzmaMONH0Wm6V5+lRUq1b7k3tdAf+n4CE1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:22.1133 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cb869d0a-97b6-4d37-202b-08d54c427308 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 07/39] examples/l3fwd-power: 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:23 -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 Acked-by: David Hunt --- examples/l3fwd-power/main.c | 42 ++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 0a4ed145c..bd10bdacf 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -215,11 +215,9 @@ static struct rte_eth_conf port_conf = { .mq_mode = ETH_MQ_RX_RSS, .max_rx_pkt_len = ETHER_MAX_LEN, .split_hdr_size = 0, - .header_split = 0, /**< Header Split disabled */ - .hw_ip_checksum = 1, /**< IP checksum offload enabled */ - .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 | + DEV_RX_OFFLOAD_CHECKSUM), }, .rx_adv_conf = { .rss_conf = { @@ -1317,7 +1315,10 @@ parse_args(int argc, char **argv) 0, 0}; printf("jumbo frame is enabled \n"); - port_conf.rxmode.jumbo_frame = 1; + port_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_JUMBO_FRAME; + port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MULTI_SEGS; /** * if no max-pkt-len set, use the default value @@ -1654,7 +1655,6 @@ main(int argc, char **argv) uint32_t dev_rxq_num, dev_txq_num; uint8_t nb_rx_queue, queue, socketid; uint16_t portid; - uint16_t org_rxq_intr = port_conf.intr_conf.rxq; /* catch SIGINT and restore cpufreq governor to ondemand */ signal(SIGINT, signal_exit_now); @@ -1690,6 +1690,8 @@ main(int argc, char **argv) /* initialize all ports */ for (portid = 0; portid < nb_ports; portid++) { + struct rte_eth_conf local_port_conf = port_conf; + /* skip ports that are not enabled */ if ((enabled_port_mask & (1 << portid)) == 0) { printf("\nSkipping disabled port %d\n", portid); @@ -1717,11 +1719,13 @@ main(int argc, char **argv) nb_rx_queue, (unsigned)n_tx_queue ); /* If number of Rx queue is 0, no need to enable Rx interrupt */ if (nb_rx_queue == 0) - port_conf.intr_conf.rxq = 0; + local_port_conf.intr_conf.rxq = 0; + 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; ret = rte_eth_dev_configure(portid, nb_rx_queue, - (uint16_t)n_tx_queue, &port_conf); - /* Revert to original value */ - port_conf.intr_conf.rxq = org_rxq_intr; + (uint16_t)n_tx_queue, &local_port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: " "err=%d, port=%d\n", ret, portid); @@ -1776,10 +1780,9 @@ main(int argc, char **argv) printf("txq=%u,%d,%d ", lcore_id, queueid, socketid); fflush(stdout); - rte_eth_dev_info_get(portid, &dev_info); txconf = &dev_info.default_txconf; - if (port_conf.rxmode.jumbo_frame) - 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, queueid, nb_txd, socketid, txconf); if (ret < 0) @@ -1819,8 +1822,14 @@ main(int argc, char **argv) fflush(stdout); /* init RX queues */ for(queue = 0; queue < qconf->n_rx_queue; ++queue) { + struct rte_eth_rxconf rxq_conf; + struct rte_eth_dev *dev; + struct rte_eth_conf *conf; + portid = qconf->rx_queue_list[queue].port_id; queueid = qconf->rx_queue_list[queue].queue_id; + dev = &rte_eth_devices[portid]; + conf = &dev->data->dev_conf; if (numa_on) socketid = \ @@ -1831,8 +1840,11 @@ main(int argc, char **argv) printf("rxq=%d,%d,%d ", portid, queueid, socketid); fflush(stdout); + rte_eth_dev_info_get(portid, &dev_info); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = conf->rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, - socketid, NULL, + socketid, &rxq_conf, pktmbuf_pool[socketid]); if (ret < 0) rte_exit(EXIT_FAILURE, -- 2.12.0