From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0055.outbound.protection.outlook.com [104.47.2.55]) by dpdk.org (Postfix) with ESMTP id BECC828F3 for ; Thu, 23 Nov 2017 13:17:11 +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=vRrZox37KZuUL7dpMrwtcLuJTdljQmHOzlXSDdhzB/4=; b=emRRTUt7AeA2ZSN6XycVCkiFVXzy8ePrAkQWRfJr3oif5y//R7Q3tTUXe0FystJ62e6xik1EGjbFJirAl0Iri891L7vISmI4sh7tRS187LDK3NEzK5bHTGgPvyZTX9cT2+P7ZWX+3SAIRu2+gL+wm5Fye/4hGO7cDTdOP6HjLoA= 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:09 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Thu, 23 Nov 2017 14:14:15 +0200 Message-Id: <20171123121419.144132-6-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: 00e9015c-320d-4788-7b44-08d5326c1f08 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:TM6V0QYFz6r7bhOEZIFx/UssaH4ChoZOdMP0+0CvWO/Uewkv0admY9NuC18hkLmNY9GgelNkF4bmQp9/8ySXf88WBF6LZ7uHShKfrL00hRl1uKxCukpUG8//zJGNeC2vUZ17hY82mT5dis/R1Hz274QryZ7lfZxMTS+rQdvm5KaCXnHbmxTTfVeYchxH4CljVRpcY+2abMcgLAMTYIwBWrLjPgSrgURCv9RiTPOyEdzrlQfrAVQJyzsrmB64wGL+; 25:7ilVg+QcbXEAzOe8lT2q0ztCmAANxfdav6b+7M7Gwro3u1H4Uk4cpELuHaiCsc1yCyFcHBs+h6ss1xPDKIunKVMU23i2wI5LKk5l9dwWk7WRgnYjtlgZxT0QDVhbwrTHvq7XlUrFlZDGV3ONuiiakx0Xdd2jswpn4xCc2IBU+om2sNZLAwZLJRmkN/osSAoZdxGvc0LsH1cbts3/PkDO1U1WLNp4KXb40L+lr9IZOnLl49WxFG38T2PzD7D0qoy3RJpZqzNthnuq1h0A2nXsiEoEQZW3ATsEsFPqPHb25ZnbFjr8HFF4dwMksQtU0ikT4+uAGyWVqKnrZMxSrosj5g==; 31:q4vFq0Iqo22P8X5T3VoGO+MaXJPGZQOv5f8ViIuTbD/186+uNyn2J8izcoaMu9oXTXS9izRpkyuQAB++oDxgAnjDKlpG54+Vn7wYDvGD2KILloJIM1MO1yvQLSax+5hN2ycXufo8zG7f+3N2X9D/E/kqyBFH8UVjsXTjxd5dTaMmXOzCbvsH3ohBqvRenOANrckgub6Ws8GV71MBevU18PnTydo5gUJGQNaJsd+SJAw= X-MS-TrafficTypeDiagnostic: HE1PR05MB3147: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3147; 20:74pB2LRfKYvcn+gz4wSXHoOuM2MZZhq4r0Uxi3nCLftJn08Uqqz7xnwS3eqVsepICS/atJLigZYWTtD00fUsY5HPjUHMwKm7lNelx3Zt7ccXfwIOABbcOvgX9+9z8wfmAJhvDxf8CX7a/fCQIyg8keRqjCRULlFeKbz6Rh5tXZdNx9N9xqxmhTJo4QetSrD9p3FfqAFHv8VdaWOTSH12TIla+HT57G6lz6YI+38Xt9lM8lK3mlPscCdFAsmlRiZNw7UmCf8nfBuIbh0GKkKBnFWIF1QCXGGSyUL47ubDpW3B2TCicFgwpSc3af78Kz6JdErNOL8QtNpr4FFclOS6l8V0Mipt5N1ZpPGhDpOph4EH/JKYHkWD4eWQeJ3DGqP5VoY5RHRow1+i40XjKwRd5MdJH4QZhgoNkpnoKWnqwyuXFSfZJOBqXZ7nL/SZ1Jn/1BUgTZ7H4zZt3qbC7BnY96eoqDtcpeSrLBHovcGnZyi4MVwuPHtFUZ78wVCXUsdB; 4:Nw21kGc6uRnSC9P5+ZURQozFw4hZwdICkMlKH7BDJwQRO69smnSkyEzVhAaSIYcRrQhKBTHIIAd16tOnXtdtjoMEN+LUjISGVvbKSMfa4qv92BcQt27Ktuh2p0wvRaSy6wXeh+44y3+uOLhj+Nu64rK9++AqJvfxy/qV82CnhcQ1IjNt7Xq8KRbSSG2UErQYbLIiwMnEALB4CwzdlN/XAOI8UAlLqGQDdbpiyYQrQU2g0cVNqiruxz4nD/YHKcoGMGNe2dhIPna+D0bbXveVRg== 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:tCAL8lJK6kumlmrAySxk2HkQVyS0uCZoZMqQHrWzI?= =?us-ascii?Q?eUdoAUEg1I0X8IBYxH1k+FWk+qXZetYUvOPNuZK9WfQcjOVN+z6morK65ifm?= =?us-ascii?Q?bMLZi9Am9ktf1++v5zDnJYjtjXJ9z7ZNuJlVVMMjfsrF9qUrnWRYzlmXXMWg?= =?us-ascii?Q?bb6f1nzcrySjRUOFkMr0IIQiKKlHBmc4sSqXyfhPcwIwiOsBi161rWYLvOa+?= =?us-ascii?Q?LWAx59OZrSa8+RPeoPXFEMpJIGCbZLcP+f6sEnMDjvuiYVQGsGQlAPICujbo?= =?us-ascii?Q?T9IFBQGHsAMdJU4uqfkXAtBt8KAdEloFUnUr0LAtF7RHEzTKW1NBGKxsR07U?= =?us-ascii?Q?VjSCHew9DTvAFDrluTpQ92vBdodT1REoL9MkcSY+spTxic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Rll7u2lq01P3CXvDROOdu6f8EuKjdB3O5oBLmQqdBnBCPE3fy00ZsrCh8uugxK7cybvNfRMzWiWZ4OgqpGH801kBwhCghiz6nEz9lH1XcSDc101VMgH13tOmokL70XPpWcngzFmZESZPKWsYhiH1/73/U4246F9WDDkVybYRshEEN8bypm+tUgBBWurv49SXjhbQ7nXmAgN6ocm939GS02jjZ6bFInkgAyQzhYtjDnPXBVZVXb/jmE8iXnI/sA79p+Wd4fjoP+rTefCuyWI7tF9eYVfyxfYIRo6rIj/MnqYWFvZ9Yg9xcIePsC1izFTkawJviGglsvCGoQvhWtoqm53U=; 5:nImIvXe0Diq8LW6kShniI5cblGkIG4+NBlf9ycc5FnFga4k8VS3DKD63EaXdq5AkD+iNHvJmPvbAwFlpbB+h5ds1soD8MNuXx0jrhAFLeT8XnFJSrf3h5mK25t+1ttQ8Dt37QzYfQsqsWR1YbkmWYQ8RgnIhzjsWEZBhnMHkZs8=; 24:63S7eFdbNReSVIZhIRHuwCCsZcObk/5euR3Gi5hQRaHmlY3ja7SbAfG6Zq/q85IbGhD2aYNehgp9iLgl4b6CuML7EbHRKeOlnKplxuJ63gs=; 7:tOCJIih79FWGmP/SiU+zRBo4bn8hvjMWcnC8q3w26MxHMCLLeBXs/++GdMblo+ASZM+iQjQEpUeFC0V6NwL8FAF1dDp7FZq+DePch4GpCch65oseKDpgR03LccAVDPf1lLk6Hzl4l5uIj9cMnOAAnTtAK/tLTIhH8EtpU+C3Xl+IdYhhu0u8RWzlfY25FbP62o1VMbGZ62LLkL+H3pYXxDaY425535mZ9LbEmuujZ7U89npPqrC9vcplklw26X8a SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2017 12:17:09.7393 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 00e9015c-320d-4788-7b44-08d5326c1f08 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 05/39] examples/l3fwd: move 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: Thu, 23 Nov 2017 12:17:12 -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 | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 6229568f2..cb1606c64 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 @@ -908,6 +907,24 @@ 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) @@ -955,10 +972,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) @@ -984,6 +1000,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; @@ -996,9 +1014,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 = port_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