From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60050.outbound.protection.outlook.com [40.107.6.50]) by dpdk.org (Postfix) with ESMTP id D50631B233 for ; Tue, 26 Dec 2017 10:24:20 +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=JTN5ons2OWpvBSu8pwcHg/8G7zgJBzdHIu4MRJesDCg=; b=xwPjGOcN5hCxxd7vGYl5bPtXIoQdCfBMmOAygpSuJnUXXIIunK4JRIcfuPtRo6wYcp8+9XWXgGB70CNhcSHPf1TBhq+v1sBPNbpRQw+6VvrSAPMwwZtUckdZhjMWNt1BMuaIKMySkfZhrU9t/ouob6EroIlUSq9F2kuikxxeCHs= 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:19 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:04 +0200 Message-Id: <38dee966d3278f3b144ec74475e337e0df16444c.1514280004.git.shahafs@mellanox.com> 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: 227c0459-b107-4744-5721-08d54c42719b 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:3OwSbtrXSrYwOfFn1O49Xumdg4YQdQNw/853HJw6Mk+8nd+1cdURlYW2QumfX4/h6xmFWLl+u8hLrkqofaklvoSraUT96bQlehRNdngmOY7vczkXFFOPybqGhyjaL2Y5pAnIP16IAadktiCs4d51l92hlUWCBq+RQxBvfSHbtVl6DnFs2BvJnrzRrdt57lN4mTcUL7//HXi/r4zUrDzgRkMjfSnXRGFR2VaZdxY4BLHFdaTAzRn7srJaxoLXLHB5; 25:dRMDUuvqEIeFyV1co36nITspPIlz0h9SYbqtST3hxls6WBg5hrTAxWrXYiK0ZLMx5dCzhxJmtOXhhRqMDJCsjdcXAJ2bnuPZo5rw534oA7JiQ0tSjMyNq8TaBPPJR4Z3hehG3z3WO/Glel7d4Rk/bRn37W1TEIKKvDSLRsrl4gESBpQC62QHEiQB4xyAPotxNjTWU56ZOoB7k3GcjcFESuhlp3oUfJlIZAR9I5Fp/H4sKEX5oTNzugk2/RQss1Z/n0v2mzQlaSV/XRlB30e1IY8rSJh3Z1CnhFJYxgsnlkKPdRrwUCPErYNw8gVbgD0BxO9UthHLM8BDd1loCFPNiw==; 31:On2aJNO4Fay7pdq6ds971Wr4Kq8C2C1KRNMOCHya2xIUenEzu3Z/u/CviQQMfplLlXU6CTmz8ODFGtHMfYkbiy/1AWN8oiQBOw1e0GBr8J8dzKZBXWtQwMRlrTYVD4vhuD4lHZ4sqqmWTdMm1Yw/Riq+0i2YqwMyRPicEokhijKT0PSsiohRLA4eH20Yp+p3r9zrcSeQx2sUDuPdneWs0H6qM0J5mY98YDBjlnAIMiY= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:wKUpA3o72OLBHSjEpQICmhUcKmiTLShl2CwTbHWZ7nHElv8uCDtEbMhV7uDoap7S3ZV8O4rEml6sVDaANDotXqwe7AIPfhPhVb/G7ROnx/e11hdd9xZoan/fvRaPbIIXB4lSZEdCHSBnRmm6R7NfFbF8J4Js+tplUKuB420qY0RM4YEEIIZ3dA2GcLx4CHOpI/jTQ63JotSigiwHM5dg3wObfuIL3TIOKMPb8tzebP4T1OTHZu/EPwT+pA3J61BxUmg/snvznXX/8HpX6YB2jEoSj8N5P/NDv0BYmhTL37LIbihIspTKIdmjJdRIggafarAn2yBzdqdSuH/mM/xCFXF0bTnI061s1rhvUVm3M1cGtENu0iTgg5LWsOS0l7RVOpW4mHgXeTCebpwrsJ2oDZW8jzMgpPTCKTaWmf0mCgH+JzVKYgr9te3SjfOoqcSfMrIUNYuKa/sKikl5OZ+rIH0pzAvaXHtVbn2DdCZGvODTfAB9Jeu79yFoZxKJcHF1; 4:/1vrRvEFW6HyAtSEgoi9xuo/N4Mwo6metKK4lc8RmiHrWQp+DTfZKCK4OgugsjXR8gM8Xwe1qBfm9cG+LpePSuuyvmwyVz32B5MCcBJZXLaGP0h6cjnQj0fMJ6C36W9kOxEr7WNpixEG20IENhiHTJVsYQAXWOf0qjxOyU+uPRXMvBWMuvdGbJolfmQsr33lMWLs9nzJPxnLyv7/zcbtLP23FVo1u3VWlKN8DO5NB3zJldpF6Nv29l6NDfAA5yV7WMIs6+gEJY9Lb5FP4jPU0w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; 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:jR0FCyRdLAGHC1jwhUB+G1M07nm/hn5Imn23XhlT8?= =?us-ascii?Q?TudeJDck3pQ8ZWBQo0+JuWgDHI1pcTEZomdXL1zCffJt0hgK6hK0mLhNnMwi?= =?us-ascii?Q?u/4BRAFKco3xQ34GBPvvUP9D9OSUCicppqv/wvkYkB99ZDuEO7HMiDVCGWkl?= =?us-ascii?Q?Tp/TCr5vnGyH54qFD17H4egD0PcROeLxNJIZ1HQuWX7vpdLczFrWZhkWWErp?= =?us-ascii?Q?jZSV6AuI0leep3MIMY5UvtIv6G6kp2FnT70JibEvN20ARkOfm7iuMFFofILB?= =?us-ascii?Q?JXc1K7q20LXMdpbrisSSslh3nxb894QqmoT3m6ofKAw7s9kmI/GpW2ohj1r1?= =?us-ascii?Q?+VghM/DfBnfgkNNLCLRirK8HjmCAfA54n4/hiIIX//lv6KoFdtQdJVOsAItn?= =?us-ascii?Q?vghR5d8yC5DnEeVKeH/W6PuJ0QeyPLdq6xpltvuDdQok5WeFv5np1WEmeciW?= =?us-ascii?Q?hTq2DjgDTZzLjlB0wdy3klWqBjN/azUQN2K0zXfOsAbnQPa4kAM4534oB/5K?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AvrjEiB8lQR3+v45aAXNr9W9J86JHbjKRAe9nnFKQcJENyB+k87rRgdM+kr3hJ1s+lBUoTMzPi/QTilcEkjTB436LQ4/lYLeqDse14yVYyOXg59fO5nDbJQqoOnnfZX1Xh5zvSZcqVxLHlKsSkq8QyKoZnhi9rjyCotU1UtoJx3Ty7+LY=; 5:iZjeAKZ2PoOMKJp8kSFgRVQNRiiSBHrLUCVQguMjcwt9+vC5TLuXmrdeWgrjf9DPoqVhdYEB8xAGGFK+9PSPYKK7Dq0AZY1cICmRve3wi63ZmwP3b0MncJAuPb6pbI8S+7EGfRLswhXCVtlzvC4ht0q0V05YrK1Kvty/O4tA0rI=; 24:w45y+2N3Avu5/pxhsuJ4XeGU7WYPobpI6qCkbBsGDPqiLJH8C3c1FFvJ/zUR4HLQMKZAsCIrW2YL6OdR5I/giTwoI0Sd3tOA4uPHRHDsUiw=; 7:b2tbfiKYCL0jHhsxWil4W1n3IkBFW4+yzln3wQKBhVTtKv2fOE8DeSI60WqdMIACPnfnJ41TAPkuYjCdgFDUnzFicJpyXgEsnFFqjHea4p3aOxccKCkqCSuqA2bRVS4RIaOal80ycJ3Wx1CrFkf9qBKq4dcerNHMS9QSKe5YizYQBd4diNmpIBnvfh0WI++TPnDvVYJTVrsAtN6N5w86KX1m9EQdMP/XKv1j0awZhe6dhbIU82Dz0qVoqt9x5wLw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:19.7226 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 227c0459-b107-4744-5721-08d54c42719b 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 05/39] examples/l3fwd: convert to 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:21 -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/main.c | 36 +++++++++++++++++++++++++----------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 6229568f2..b55979eda 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -149,11 +149,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 = { @@ -612,7 +610,8 @@ parse_args(int argc, char **argv) }; printf("%s\n", str8); - 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 @@ -892,6 +891,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); @@ -908,8 +909,13 @@ 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.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); + (uint16_t)n_tx_queue, &local_port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%d\n", @@ -955,10 +961,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) @@ -984,8 +989,14 @@ main(int argc, char **argv) fflush(stdout); /* init RX queues */ for(queue = 0; queue < qconf->n_rx_queue; ++queue) { + struct rte_eth_dev *dev; + struct rte_eth_conf *conf; + struct rte_eth_rxconf rxq_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 = @@ -996,9 +1007,12 @@ 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, + &rxq_conf, pktmbuf_pool[socketid]); if (ret < 0) rte_exit(EXIT_FAILURE, -- 2.12.0