From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0042.outbound.protection.outlook.com [104.47.2.42]) by dpdk.org (Postfix) with ESMTP id DEDF02BBB for ; Thu, 23 Nov 2017 13:17:12 +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=dBhT5Cu2pPg+LVRCjmfxRs/elipHjTNgC5tzwHRulWI=; b=aW2sxrlECYOvuAxWTOWYVGnFxypSKZpfpxZqwcf/HNXTXr+Y2qvC6O7m2spNd9dMIvxZDNgDlA+mTuQnA7SFDKGxsCe2vI6Tq/cRO1TmJHk6MwwOzeRhLj1EuGtJmeceQlXkExFJc7b3W1ZMwHDQ7V0XX5w+m2vyQ1PDgvU6VSc= 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:11 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Thu, 23 Nov 2017 14:14:16 +0200 Message-Id: <20171123121419.144132-7-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: 827296a5-7857-41c1-71c0-08d5326c1fe1 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:ufiMsY7+KwgaPlcExb6nXv98rgEmoKXwQlw+992/chLAGY0Flw3zd1gBoUe9tYal9eEmmbKVIUIRLzxxfRlGS4dGCS3095puqaIdzfrfKeDRnqhEpVH+9ZkZUBADQ0NyzSACML9wwA4t6r54zFo6xuiuXUuL+bs0QatugwiKkaqWZcp1sq+1r2V7VWvyfxW3JwbqtQ23m6SrwiSuRuf/uB3UtL8wdQaw4fgHfPAYrFXMqjzXOFpmXaMD43AqlwVW; 25:LcH/T9qeyarJmCwg1oltoNJ2RQfFXQ16tzdMAkJnKbLDoXI+crrqPWtbTVDsY/kFJkFOwTDbumGj4cfOC+++Ebja1rW7RO9vuie44GQQ3AI8GwFhcoiMdeQlUNUEIRqVQoETMxcmlVSUykPZLxbL4AJrc4VhG+sUqb2KFV6ot4WujuDOgqSiP3krckYz03jPlSP4IGWWm7GrODtzmevmomL5K6KZOQ2WA83aXVl5e97tn7fH0xqGm0i2INVvOUATJL+tn+MnouBxgzpENMggRCvMBcuE2GyyIi4eea3nghruiiysBnNobgjaoVIzasjVtAdATDl0t88y9A0hiwWh/w==; 31:9RchaGx78S6U9SPDJK0WgYjh9uKEfUOLsbeywV5hhytCEPRHAkkxGVs11Bf2ilY9AzP530qnxRN/emFqUZKRMrGiOD/TEV4ORXrjYN+h92RCIFT9nNF5KNV/R/CMP54pQZxvT4iA/OdVzfMiXHRc6I0aSJee2YlBWKZUS+MorUGw9+m2cYzIaml+Jx/osRkFWuV4Fx+ulxcoroUxun2QRZf4PV5tAmEnqxVfU8h92fI= X-MS-TrafficTypeDiagnostic: HE1PR05MB3147: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3147; 20:YvtN5YV/L/OUdfkcOTBUbTODNSUHCk/EjXt8dUdyvJGPLSskNJAn039G46V6S2U6CnYnfvYgDFY1sKtRGKMx/wCLUTJPiTtgHKUY0rMOHfAoO1wTJ64NWOQCvDAxjesmfhDGbxvnG4p/lwwauqpdbvK3Va6QxbZiF01Uc20S6Jma3MCgL0TG4q2igUr8IF5J2Q6YUslMeg7qTn68Po1bYSqjV1odlrCfb2Uv4Ik3nD4xtBH19yjhZTSO5o524h/OiKbKnGzgRkPpHmk/3UlE55shU9QIY65bGXPmdqSWGK7HxUApcFkuoJQ2mtD4AZEsB1hN0hKufITDmZYIAPam6TF/A8sAWGGlRM5w8VS45aUX7TZgsmhYxf+WmAVG7JaR4DdQbDFxRbbIBLnxvj7s6W7gSLABwC0KCs7HHj6gqcqcR2A0dQIaFPwvpISp8vUSDLI+/Z+4x4B1HQqJU1lK01Bf++bVilhvZc5+HsbtCOO5SZA9aBBbL6SngaAIzmIe; 4:LOmDsUwJE4DRtxWKMlsW8boi3peRDmjqCJ4NRcWX5eURVKe8h0ZRjaAOpdjr+oG+1URbCmeoY2CyZXDJ/oLdjCui0to9F+DhzBud6axxrcPQUzWsSOKT5MsBmpcOPRn2VcpifxI+80ok+XpylESa6yEw8L5hcqPsXYI9K8U50e7drjnue/aP061+ouspruBjx3KJ34IyCDjR5COpEPldgBso+bSZvdiWUXv8+n/fO4BoKNSW31zzIP9EfcqBJfjsu2Ha1V4n3X4SnQsJjOAruA== 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:FIwA6GMofa4Zxg1ytom7NTMgaHogZjoiu9mMyFanr?= =?us-ascii?Q?NvTOovDLwBrPonw/7O8pwDY/EIL4UcltF/tlmo7FkaI5kSSLLO12uMbBg7+L?= =?us-ascii?Q?oelBMrtPAY8pVixasOrPD7TLti73mENWO+A1zoLA/ye5Ov2B39+Z1apjnQ2w?= =?us-ascii?Q?kTRf1kQQjJLGb6f7YK5eNaBicCtBv1O5AuuX5otiM1oyajA9M6P3v5/il0t5?= =?us-ascii?Q?Tiwe2nrd3GoA+AZif7cm+M/+tp0wiv6pqacdJVjdsZ/N3Tjr3s18UdbJZbrg?= =?us-ascii?Q?ty/L09NdS/X3aP2bGNBGsycj4NS/x5uC7dNstB3C6rY/99Cd2CoH+7GoOHrm?= =?us-ascii?Q?65qTjkdEINOyQMn5MBTr89MVBKu28FPjRt5mipdLDUq7Z5bPPe+ydYtGt6sK?= =?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MddM+x2Ye0LrQPlcCZvF6nqX1XEeSknFU7rE8IL7lLQJXCfd8Bufk2HkEJ+fXozLbe/fS8oD4P3QmyPEzOIYfZ/W7FesqTES/WOp0WG4IXgOcYlsSYYZKFm5f60NYJ5L6yIq6YPvspDQzGjhgK+L8YgaQ2H7afMhdtqYwigyatrAbDZ/AYrUYM91/qyqMlWIlwFQJy0CtfD5Fyru6boJjzkfBJBnhru05+kAh34X4s/nQSzDkTESzgNtnkSR/ekcTleAaZ3+cAnpEtq9aIrME1hZKvHXHnQk0uL10CgU5zpaDzJyYRsP6+iXx1To=; 5:ZrqbuhrKp2ZE5Y7LJksG8vLrVvyVwCEgG6cF2RuXb6OU9PRNZHpIStJakEL11Gch179PQqFaEkj2AuUYaIwRhyHDA2JJ0hogyFJ8a9onsPYkeluk+HzcfU2iiHsfJTXzy7kcdBNMeoawCDPfAGQP+J4Ep1iUycpn98piAwhoZlo=; 24:+4Nw2+4uCywkr0iI1/5gfa3YGigFhmlKRffSfBCJlb1RhBC9EgxIaBrir3bH3aA9VhsQWG0xe36HRrs1AwBTIq+e670HBeZuyWIe8+fgcko=; 7:EGma4Ipt7zMEkzGUrj9JHlkqfWn0uUqdWGIXXnu/8pul0ATo7t64lPN2qlvyfmmxbgIL+Oa16a+GF8erV4EbMQCJOHQRB9RusiF08b4vsmb+bE3aMCBZRN/wobvxrKSELUU+dWInilXaf1gkh1GYYY5wKt4o3YVdtkdq+FB9ydCGYf8qQZnOOpAoAot0ElWEpGbAGxjT40mStrh9BbyRjhtynlcIAfCnvqdiYa06MAmTLceP/kA7PbMnj0BiUIcn SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2017 12:17:11.1612 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 827296a5-7857-41c1-71c0-08d5326c1fe1 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 06/39] examples/l3fwd-acl: 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:13 -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-acl/main.c | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index e50b1a1a8..977364f17 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -156,11 +156,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 = { @@ -1727,7 +1725,10 @@ parse_args(int argc, char **argv) }; 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, then use the @@ -1948,6 +1949,23 @@ main(int argc, char **argv) n_tx_queue = MAX_TX_QUEUE_PER_PORT; printf("Creating queues: nb_rxq=%d nb_txq=%u... ", nb_rx_queue, (unsigned)n_tx_queue); + 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); if (ret < 0) @@ -2004,8 +2022,8 @@ main(int argc, char **argv) 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) @@ -2031,6 +2049,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; @@ -2043,8 +2063,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