From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0040.outbound.protection.outlook.com [104.47.0.40]) by dpdk.org (Postfix) with ESMTP id 35A5E1B161 for ; Tue, 12 Dec 2017 13:27:30 +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=Lg8cVeCofuJchzcUnniZFVF//bN3W4QVi1sndUD32vU=; b=jfpE6jmtv1/VuPnW6mT1DX0WeWjcpUqQa813rVc78NSKewmTCQl3KJSIuKk3JeSeKyjfY6IPjXcVE6WsF8v0k/HC71e8oa6cYPfdgi35EFgQrwEVmkPNSlTTwmpQ4X1k6qx+3ajy758Yv94ZQgwJuzONR8vObWln3DczkpGj2Lc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; Received: from mellanox.com (82.166.227.17) by VI1PR05MB3149.eurprd05.prod.outlook.com (2603:10a6:802:1b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 12:27:27 +0000 From: Shahaf Shuler To: dev@dpdk.org, konstantin.ananyev@intel.com, radu.nicolau@intel.com, arybchenko@solarflare.com Date: Tue, 12 Dec 2017 14:26:22 +0200 Message-Id: X-Mailer: git-send-email 2.12.0 In-Reply-To: References: <20171123121419.144132-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: HE1P191CA0010.EURP191.PROD.OUTLOOK.COM (2603:10a6:3:cf::20) To VI1PR05MB3149.eurprd05.prod.outlook.com (2603:10a6:802:1b::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 44847a7b-8ba1-4d8c-fa67-08d5415bb5ac X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(5600026)(4604075)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(48565401081)(2017052603307); SRVR:VI1PR05MB3149; X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 3:d+81IpqnpHnrK0u+3tUx461abmUsvr00JE7KFwFrvXhjIOfdyJFnnnxWXhq7YC1bhI8Z3UTDGnTEus4uKgBCIeNANJldyLPlx/suRF4a4qz1jhcQJLxb5HKB/hcjbrz31Tu6flcPgaiw+B18xiUR5mPrhl3DhQVFlkULjeoVV4F4p9nurQ/7cjmXbM6l5vLaW+1sHgHo3oZ7ZMDcPZyNXXgMmzkN1WgA4E04JPtI2BaLBp4+UDaYDMZUgsMfdFWO; 25:UNuHiUcOhS81r2bV0f+x/NsRou/2MR+QdSLy73wJ7gHCiAhEbALK2af1Msbt3MfBSYb0l1SSzMFBnP5Rtq38RCvS4FWBVa5Cl1519F6z7AB9pihYVPm0Qc2i18i3zOhTLiPdKvVUBE00m4zeE+gGNYjFRamtZ1P5qsntMxW8naQFx/OEoRfTx8ahIlNnuGAJZ2HNAl/P7OPcqTedp53LnykanU4UimRTNXnn+O0/seJejQ8sfBnwiJMZHOcmEp3l0LXlZJYDhRL8mOLw96wn7jVPKa5gJxFOv2f5TuIvjk0lflygsFmGcALwqOfZxgmvu+tMofWgHKYE4y8ntYi2pg==; 31:HsoFlIVjRJ15JnZ0p1d59rhFiIzMT+s82oKQvT5Ftghrthj749cinQ7gfYavpUJ7/c4zjRPdsBAvnw8CUGdsC/eiIJg3f1E14Y97VoJ2PXNdQJqX6/YFtNM9kkplwLXdtKQ3QG+1BFvoD/QRdJFRXMZLfiBLkYiGGxeXGAj542+52tmJ65ULPL+clX1OCkml39ISyQTkUl3tZP1B/nMR/XlYZNKHUE+YdJSDJoeds5Y= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:TWSQG43ELy8B8dODWB+0yEdjs/I77jqHSl3W/EeZ0GCWMjw406jyQRgQKOvwY6IRsDVIA+D4pqksm0QyjemjrMtvkpj//JJLGwNCUAebt018nE01e3+8B8oycG9NwOqMrygx0SfVOVpziuL8H9cT41uVjo97cWAjdRYXn3G2bVLGQbtzt0y3QPac/WbdXWdJnPh3Wol+I+MbtWTqBcCSYu3pKIdbHu2YdZ/pEvBY/OsWGC3SrOStfDsKQanF/8FL3E/Jkf7hrQER4aKMXS0ByQSydEyeglvIgFGuT2BQzvWDlZyX4NuhDot+woOv0Hy+h69jcC//oJqzMI7L3fNrwoQ5icuxKgXl3imw2/ZixGoioMpntnQ5twJFlO2EtRPVj0QhHJlWGGpGswSXz/ixtKR+pbtgsLmaXgpUctfOXMKdKQspNZslLLlQY7ZThVJ30qmUxl+NhlVkL6sVGSxxGD1Kb0BdxMZ94BVvrX6e6eSsvUHi3ZfwoFRlAm51fUi+; 4:DiIsjbJq2OYPzGFDsGMKDxyjaAOfVcwQH3TtydEvhWECtaZ6sfTXoPrBD+O5MBIH6xZefAPy/zfQJ/svKvE5fKuGIy/FR9zMarz0blQydOzyq9LvwjdJ9elAP+u7pJ2JtFeiG9XTjaFmqqsp7S+KpGC3QRq2AJCebIwNXrqr0UrZlQZUMhABcTgJqTuP5ur/njdEfg3DxmZAs5WP6dpb5Ozk+R0+QCbgJogcMaBkh56/FdbVpOEeJ9/+wRyEujZkdU+zjq18XamJXy+RNgDCpg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(93006095)(93001095)(3002001)(3231023)(6055026)(6041248)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011); SRVR:VI1PR05MB3149; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:VI1PR05MB3149; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(376002)(39860400002)(366004)(189003)(199004)(7736002)(8936002)(305945005)(66066001)(3846002)(5660300001)(47776003)(6116002)(2906002)(69596002)(68736007)(48376002)(33026002)(2950100002)(50466002)(81166006)(21086003)(81156014)(6666003)(8676002)(106356001)(105586002)(118296001)(97736004)(478600001)(51416003)(25786009)(316002)(52116002)(7696005)(50226002)(86362001)(55016002)(36756003)(59450400001)(76176011)(16586007)(53936002)(16526018); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR05MB3149; 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; VI1PR05MB3149; 23:IObqY+B54hQ8MGKBpx5fubM49malN+IsltnzdDXH7?= =?us-ascii?Q?sGlHl0k2Sch+5QIBnTD3IqGaTxcpcJ0AJ4KOHPM/qErAsbBU2obONXFumLn5?= =?us-ascii?Q?PNOIp3ae//IFqERKFIZpv/yqw7gnauynby+ZfAeYFksGkUytk6rII1d2GV2O?= =?us-ascii?Q?jlRTtPqzjdJm9g1SnZ3Hg6Ptwey3PkBqXe6+x74j945MIasUu1+q1XjzFI70?= =?us-ascii?Q?C0KzsAqOND0L6jACjz2iRRxtllAY7CUJMBcVDqtjfp8dumTPrTGslgzn7nn9?= =?us-ascii?Q?1gYNDzVYzoLMVgkZfEdsXm1+F54AxVrGUZXyVsVrYYDw8i/uXCU5FTQs9s8J?= =?us-ascii?Q?kJeFv1SByvQhOs+T8ehC0hoOXWvf9ZRqCkIelhZwD/5sLPE21LK/GSDUWTY3?= =?us-ascii?Q?lVE6j6A+vBeUMrfrKAHyYm2tUswURR77viQ0Ovkpffd+kzetIDQY+urmqUa3?= =?us-ascii?Q?Kk4z3ZLQQrhPxqw7XB/SjKKOVjvc1OzNzQKFSRNMI3wvmfKDlZdGLiVaKtZy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HmnTGo5UvfpvCZNDOlrB74jQxpCTC7yGc8FpiGnb4=; 5:VeMOLFOUV2G2wk5WtAuQvj5VKhPkwRihGVF7Z8eGdf/Jkim8vtFZ3+p4GDRxokHJOwmk8zi/15h+I/X0vMxBfcpme+VfloFqOZrP1ItwGOEElJ7KHioKBWz+ODflz3iZdHD8JW/00XQ9LASKIkfStFsk5JclvH1942dpf9PHr5Q=; 24:SQ/hjeBsUtrTPZO4OSs5aTUmtdSUfLThKEQfAioMpq3Qq/OCMLaitogmrsNPjV7A91UjE3hal6Dk4wuKUWS4zT5mtjeRob/RPXnbwiFjf08=; 7:BaWkiTEhFI6Rg3O2Nc81Ron3sBy3a+U4VhETkhe+YXfjG9U1gxp1SLHuyD7vTenmzAaBeRBKNfoSBlDCTpiRQI0MOTm/qPW7Ka4iJT0v3aknZD4fb3UX3F6ll34w1UyORivBExe6LSaxijUYULlol7Qj485BREAK1D+eZTfG7/k7aTt4lfcvYxxxbydQgDSVUW6DHPTR0vf7AAaXSy5XR/IkSPzFxJINfwwiyAPnaxnIto+nQKgxMPkHMOnMxgtA SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:27.9884 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 44847a7b-8ba1-4d8c-fa67-08d5415bb5ac X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR05MB3149 Subject: [dpdk-dev] [PATCH v2 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: Tue, 12 Dec 2017 12:27:30 -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 | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c index 6229568..3bdf4d5 100644 --- a/examples/l3fwd/main.c +++ b/examples/l3fwd/main.c @@ -149,11 +149,9 @@ struct lcore_params { .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 = { @@ -163,6 +161,7 @@ struct lcore_params { }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, }; @@ -612,7 +611,8 @@ enum { }; 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 +908,22 @@ enum { 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); + } + 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); + } ret = rte_eth_dev_configure(portid, nb_rx_queue, (uint16_t)n_tx_queue, &port_conf); if (ret < 0) @@ -955,10 +971,9 @@ enum { 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 +999,8 @@ enum { 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 +1013,12 @@ enum { 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, -- 1.8.3.1