From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0078.outbound.protection.outlook.com [104.47.2.78]) by dpdk.org (Postfix) with ESMTP id 9E17C2BD1 for ; Thu, 23 Nov 2017 13:17:13 +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=V+wqCnBpeMAHfIZJw8ka7+LafotnlaJi/wS6QnxO8CY=; b=m0vsqJfdeq8CzdmpaDJGiQpmBufTMqnF6k0tMO/BeZeJ8iB37M2dIt8nsLAXh52umWZPCkwNWQO+HzMOZ+lRCDfhIXAca6UNLeVMxL66ZBkJsFrpOdkKdT4JaIgv8KY31a/rqIjC7Ay5ujhnzZutzNb2O8W8t8VjtevgHM5UsWA= 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:12 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Thu, 23 Nov 2017 14:14:17 +0200 Message-Id: <20171123121419.144132-8-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: ee8f45ab-4195-40b4-e025-08d5326c2091 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:Hcp7JKQ3b5yexEAvrfYDK6Uw+1Pb0OcsuFXobJW68ys7/n5G5HVBYfgntMphAwCHVlwgULFB4WL5bkZvm8tITLX36ZV+sHg9AfKy9g7FQJmdgPn4w8WniXObmzWWKAs0fJFpL39uCd7DbrG4pqVfqGMnO3eiYdD8l0tywOweylk8wZmJiGm9AihHb0Uwt2wRSqfnWUZPOuDSVpHGX9e6JkpnAtUhr0OKPZN6GW1nhOxtCNg+J9prfTTFyNH2DwTp; 25:wd/WgYiT/cOEQ60PH/uf3j44Wc5NfvZWY6O8x3mY3WdpgJXWcQrJqPHDD14pCpNac6E954ifgXvR9tWyNZeU38AtVNaLJOZnk9ixMKcpNSTGZs8COqhYrl3tdcQGMVBZziI2S7a1Ru2/wxq3kPFapObwkTLGeeQRxqWErAAkogA2K3BoI5/Sf/rCsUmdMpnGrubK/dGLsGn4BHeL4FExRDcKahgXvtzN8ZM9ycNiVPR685ejn5wS+OiGxKprLmLB05opVeltwmAe22CewKYhOYEqqQmWihh8iz9rfscK/+btHd10dVufvJhZJN6ILZkx4XmHJBpZMJbdcpt4WBqWUQ==; 31:ghlvmdcLYRRzitMaVH7CV/p8VqHqDTo5xoBIpqgitfhe5l1eEOXn0gnGPJFccgQeeSOvsuQ4cGCLU2JbnGZ0SBxgVYZmPc2XYhbrzg4JlpVK8MFV4SA+0mHMVi4oMnXUSQX76B7vhHFeActDzeFWJ0XAe8UEZJtdrDClk4NBiLqZkp5sYPJlmIW+kbB70AMWtl3NKwWStp4006+juDtCDkRywpb2JxzyqWGCgeqfKlY= X-MS-TrafficTypeDiagnostic: HE1PR05MB3147: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3147; 20:FgzaL/B62kU8hDOY78GuFKSbWMv7peB9MepO3E20qB+skEx0QyvTC20dXqEMxZNejJC27nDiWeIgm+USZyZaEJYLDlY8ELUW3cv21XC8ABlIQocyZcYbZ/9Ec4/q/iKw2gSOXfF+UV4ACXqYSwW4gTRPumOkF64/DVr1+yFHHNwjfDp/TqmTqSoDpeEnlZjopVQeZ10qa+AHl30Va+h1qooefWYcy9DoEm4Jdf6ZxxQgc18iofKewOwo20A+fxfGhelEBtV+YSBu91iPdJUtVkr6wXRmXu+nkXMlcCKEPmevzqeD+979VlFA8XPEX2j6F4XSa+BMrwFbIvPYFpVnXCi22PRFg97KkCZJfIElyJeMIRMVnj7bQUnz8wirHgW1z0+6M2U6PFI1EUSv6hxckyxECdR4kKgiZTQkxtulIwMklC0jK1nmPmvnJYV0kU3NR8PnGywBK7nbxC8rFtygvtYCc02wjHI0nVwAnJtYT8BSdDUtn4PLgJWfhdATqO68; 4:cGLkeS4311UaIQ/tGvWr75eMkYytj1boeJgGRe1MVlnhHsZFmzm/BAG+6pV34RZu9GOgmi43VqpRr7uYHZZP3U6jSO2epwpLraaeKa79HYvONdCifw1X3Pqy4caLGUqghT9TCQVjQGvMwfFEeBq8/ZevTu6pHGsINMTkwBUWEesTCpycoJOX350oJZHif5mf9k3ikrZQGbIr8x2j8m9J3chTzXSapAKHhGr8qa+pg1B+r9GDxoVt0dc2daQO0pJujomC850VuJx7U80mTM7QJQ== 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)(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:GjOQuHkRHsE7yGnh71gsx3ddCJSxCzU207wd9xNs+?= =?us-ascii?Q?NGTA5H9V3CUSZKAQWEaOljULrzRrE6kJn0gdMR/kvglRewlbI9RDcqHqK4D/?= =?us-ascii?Q?VIMn4gQQ+ELfS4JcOMD7L+/384DJWKiq5T+TGS/FPeQ2t6/Oh3tei9xfUZTb?= =?us-ascii?Q?IVv0q0nQ/JUMZIv0aMZsnOGYHejtE7iMFyXcR/L6vrzEUEQMzOb0Hl3Tngvk?= =?us-ascii?Q?U3HJurEFEF51MWlIQj2Pu4MOwzi6PqItBmP3NcZ/afPEoMcTXffG3IMvq371?= =?us-ascii?Q?IplkOpLhxj1v1OLeCz+i61odxRqcSCSQr6dYqY2n7XMDUeOgZTfYRriLIFzU?= =?us-ascii?Q?OLMMLVxRgqdfjqfN/wJ6Xfy+rtgDy84AYPB2ihEwkwqFGw3Ers3LeKIWNXVh?= =?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eReJzbt+SGv6JDaCtQYhHq/AHsYA8NFJxRlxnTweu8zlWzwJH8oWfJf4drO1v3wsmuzjRtZzLL8mTiLpQX7GfTzCywmFVcJWqIOwe3ylcv98PaMu/Dq68txxNOAnVxRwo3sycaj8SitZQ5jqNkJt8Ba/0FfpmJ7Nq3VhjJ9pPCTtG5fNl9H55ibHbecHIWCSRAPBD6YO6t6PfcR1aEfICqOUjKEAekftx7bImrCNMbraNroHC28KnxyJvzErK0cFHCnbaQGNJSUbw0yvm4Dq3B0qh+zhenpcoPlLjOYiSEBFrD+entXh2k=; 5:kNjuNYl51yJo+IcW9xdSqkh/w8Kb6UgvXJ6dmQwUBUmDdyeogiHrSuHhpCIJDNwp6gPxjEuD/jrc6w0UL9naBJpATZm+Y18wATER9jgTfkRL6Zc+1M4HOr75c0GDAf7dpGgilUj610sHFiv6bOqk+hYKlV88T3zRtuycjbgao9A=; 24:AN5t5shCWEXkK/8TU4U/gbEcr7BhOdKjFigc4tCE1PkiY7w0QGkoEESSFhrpXszaJZoIUcug/a2l2zbo9GbVmAJTBWjannNItIsfN0cImpQ=; 7:RzZ6Ux3+w7oOc5xENhsi9w4ZSzi7fiyf/084IO8crCp/pzQyH+sUWzpFnkJrntdNkpQ4tLHYqbZI9+gU9Npa23DEDtmNq4VaP1vCwm/NMbHFFwgpFI9aS0xudNwQt/LiTJBqJGMHcpar24X+dDd3jAO0mHg7vAb+N1hS/G3XtmQMx/F13ESZiXyZJG4gFM1nQL9FKuEOEat6iwkjszZXT+zAiSdDfXlDPSi1EfPge7ckp6NKJjZIJu3RukmUWUfw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2017 12:17:12.3174 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ee8f45ab-4195-40b4-e025-08d5326c2091 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 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: Thu, 23 Nov 2017 12:17:14 -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/l3fwd-power/main.c | 42 ++++++++++++++++++++++++++++++---------- 1 file changed, 32 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 0a4ed145c..89c773d3e 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 @@ -1718,6 +1719,23 @@ main(int argc, char **argv) /* If number of Rx queue is 0, no need to enable Rx interrupt */ if (nb_rx_queue == 0) port_conf.intr_conf.rxq = 0; + 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, nb_rx_queue, (uint16_t)n_tx_queue, &port_conf); /* Revert to original value */ @@ -1776,10 +1794,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 = port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, socketid, txconf); if (ret < 0) @@ -1819,6 +1836,8 @@ 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; + portid = qconf->rx_queue_list[queue].port_id; queueid = qconf->rx_queue_list[queue].queue_id; @@ -1831,8 +1850,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 = port_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