From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0078.outbound.protection.outlook.com [104.47.0.78]) by dpdk.org (Postfix) with ESMTP id F21D81AF03 for ; Tue, 12 Dec 2017 13:27:32 +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=b1SuJk8pAjZtYOca+TipmmIjBit6P7iBV0zCOv3iNhc=; b=wqgDOEvUV8hdTw4mVAcZXiyrogMIxScvTPGJ2hy/D1zHO0h31BcxWULJDa52I1zslgeHDwjT2tgXBzL2+ooUkGwIMQ7kjP//Kra0dGo5u1qyC0h8eKek+lFp1RkSUjxyk/t3ivfhPlVPN9vE0HcN8HD7H+Os0Hr9E44G4+H6Uw0= 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:30 +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:24 +0200 Message-Id: <6b1036c101c255c0537560683e6756a7c0b6d69f.1513081087.git.shahafs@mellanox.com> 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: ef1ffc5e-6add-42f6-c0d9-08d5415bb757 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:eWA7U1O4A+izHpjQK+RR71FY6fVNR594eI0zkLZc8ZILk5vSBVpOpSmVPlvPTeCyimk1Mpwho5sDkxFyuD6C4WUa5Je7ZWgS7g6ffFiD8Hx5JK00fjtv308h6vUsDxC1vGIm/HKQAW3JGlZzEzNSARL6peZKDTWd520Wja/wAgUn3RvhP7al9eOysbUA0bNhEiEBDhmCmqPaTq1Rpxt25Abvft+wM+QkRiKQEZ7qgI0wYquJRAz12he7OFAZYbGE; 25:5MLsAjGj827Hui+ADumAn4cd8mtClaGh1I5SbxsrgEPtt755GuUAypKSU5B8rf+wWcC/MloE3Bkl2nib/aOiMgKuwzYebGxeRyP9CeMTyZ0z99PRQ2V71dh4bq3NQJWHFOV5Mvw1p656d4kCKSIdzzdX3gjfmZCCj7uh7FW9GsiLu+MoAeC2kQpumTYg8moHl9L+DlabMoeLHCiyCCqGaLWWxoXO10m5DLYxGGBW+xgOv6xbKQ8Ssuu11wVDEIkviFoRl/WDzmvhOPF9CBMzVOURCkFJKq1LZToPjkchRReKH4BpWygiKeyXyF8YpKegtPKXM6NJRLhlqWCDQS81Bw==; 31:fDkwUmFKD9NTgQ2gIqw1F/2Ezc5BHeA52Ak9Vzq1u3tsagbrM1f/2voZa7jQsjwzAwOhgXa2gbJtsqtKd3FPuSWlYTifXv2OHM7B4Otp8CsBWva0QNF5rT/9zKvBSyp231hoafRWrLX5qwDskaRqw5LauRu0HguQV4ceEYsAqMI/ibdkbH2GQsqPZuQEwrFac2usOtK0nEN/oeV6lQYFBJbZsOs37oiY3wPABNvmz9E= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:B9MCzEsLiXa5l/CMvEoImdbAYm1OV1p59DlmUnqkWRX2IQNi+CVmeXLKeuvwdPrhZpoAPLrCVeRmFYOY6gCcvjt0rmNGFhFuw4c2x+v+iueHVvTl+HDa9BcwYs41FwxI5mbHGibnrUkevibl+ewawyEtQhOjLNAxypdUHwgjcDxZrV2v5zi1Q5jr6RNL6zD5MZ8bkgNzZEczfx3h2bkI1O2IsxyzBbRe9lApe+C0U2eqdcyHvPf778bbvwR4K2zaKcmXgUxsjrD/VsKQvqHQRfMNqPPHnL4vZaWR0UxxpkDa6T8BZ4jDklJJHooIP4QeRclLR77QDx4dLWOGiG4Ra4Cx2JX40Xe2y0AsGoqF4oPPwFOukyE7EfsFy+mVrBpwITlZgqqzdOzXvpDWMDJlf9JBnL1kV/Xv9EUgWfkcfPYRAugozwK6IjyFLizJaehG34vaz9BQLTrKJnlPmV3ceq7SL9oNqTRqari6rP5rU+u9HUsJiEi4BZwQ5YERaIk9; 4:0uEeSXw41dAY6QTFd2tQf5REXEs6o0tsGZqAD8FOEbAQcqOVz2GfBThuYKfLGqHb8LnM5R6SPP4vVirKwVqIHGcriUxwtPVmktniSdCXpJutOaKCYhDbt2yr/MqghfDh7u7tNWOQfJvwsD0T1tx9HwsoemojYX9oKiy1NXWT6LEgPW5bOD6ErSlFIPVjWf4VpFzJeWkCHWxEJOcmKwxcX/nSpqQcLP9DVNvy1Oi3sN/NR2rZV+IuanUiWpiXwFVtirAihx6t1wMe02Tps5Lwl50SNqWJ2Yxz6Ohc6+HsUgVvKBIiefm5+xYR3nfEcvnT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); 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:d2sHPBTsZdTf6Ruv8tyWADYMjaMmmXnofHXFBaEpr?= =?us-ascii?Q?jadz2qymRj43/wQgz3re4CTDaPM5hvQSrtTIHWwYg1zXwPOAigjsJOB/gUS2?= =?us-ascii?Q?qzY0V6fnej+nVEQKEnpPlMpuSEym7A4ZYb6pmdln6brLPBoAvfVOPQyCAsBv?= =?us-ascii?Q?OPazg7qF/GjsElntACRZHRIVxWzU5rt+/SzMj69JEM1mcEtStAA1NqdQdp5t?= =?us-ascii?Q?BVUqk+Mo4ZvSgw8o8xPYzHviZ6v4pfur3oPpv64zmlwBOEP+a7D5zQWMzhct?= =?us-ascii?Q?8RUzxVxYWXoxDZ05hEL1/F8Ew19lLZDax1psYHcBzAOYXjacGpjLWXx+oHZ3?= =?us-ascii?Q?IeUFQf4/W5BEElqAgWQ+k8McB1sP580OrJ8+IGlExqj40s0SVdY7GnSUqOJZ?= =?us-ascii?Q?ZtyzxwFyyS6S8l6TabiKaNMD5+QGWc9Jm4miGqXkCMM/sTq5pvub9j6GmIOF?= =?us-ascii?Q?OrH1BtR+nWty/IIdZyClKshXD3hNf6jxDFvrZVoWMb/NvYFWg1JGGfAtWtpw?= =?us-ascii?Q?JBYbBdnOvXPBGWvLUbafLGF4qlMts092zQHWxjDFalyA3nxeFUaM7irtOd7R?= =?us-ascii?Q?nLFGmGuJV4U/+qoIUkMQc9S3o9V/DAi//sVGhcjZfLrA9wicFWYJ3941lDGy?= =?us-ascii?Q?adblFitkKQKXk/eD/oOOyxw/75CAtu2eM4Q+BFOPdylOVZScZUvnwHsODo6V?= =?us-ascii?Q?svY0LEnFCSIHoGF1SeHTg0YTNZvrNfYDAjvDwNHvApjqXxS7+G+mj8K805qd?= =?us-ascii?Q?ptfjyWRzhIS90LRz+0H8VKRk+sXYOleYMn67ayuPTuj4NMa+w8jqcOFbF58r?= =?us-ascii?Q?njQvLf5PQk1y8iX8i2Ivg4Tm11kljzCzBtrFUqanyrqfjonyV6lMMxlQiJ2d?= =?us-ascii?Q?NAyEucZumJPRJI6jcnMyc3YOSLvgRPtXimDkEJ6qAWu7rXWsQ9Sq8uLM2In8?= =?us-ascii?Q?3g3UhUbzob5oBIjCHA7fCld52behnYM25Cr91uLgC/ti87m878hYNN+ijId9?= =?us-ascii?Q?XSjtOmMNAy10V1uphpzBo2SXEmoeCaGc7l5UlMX//3HJocsPdq4xEhpNxOmF?= =?us-ascii?Q?Oxo4yluSLvb09qnf31nZDodWh5j?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 6:8hBKO7eKnYrv0Nvcm9q3jFCwBgAC1f8tq6Yn7z+6yXUlp/08p1w7p86Xx0DGuZicEPjBHt4+DHOCMyq0BjN2DlP3dkmqbLyyeIJ9CKwS3xPzXsklYtLn8MssIiarIIB7JcMr+1irAvfEl5b40AecvUcsLcOofnDc0BbhnwFOqxL+o6/8kppoGqbsYmxgM6bRZXLki6Z9GOdJiGCAwtFPgafJT0bejilu5MCC2n7CUZfalTAlJyuj/BEHGzVEPJEPJaEVG4slSEBUTpB+YzVRbHvLXrwsSJ7G8r3cncKUmiNtUe3sqqB51/gDXrmA5EV6GpstxcvTdPoSRCQAqs/o8SxykR4braYgIYD+t4ew+GA=; 5:X9KoRruy3MoXEIaVkATU26Qy+kFB9qyQqParCfKKFDZO1RMPnU1fFV7BpmaGgIDtqH7PXdnjgJRQpoHK4aLP06xM2pIyjgCLnT8CNR6rwHGNrUkRBbDH0AW5+dyJR5cC4ZZm0D6QMf24yZMInFVT0HXQqej7I6rEFVUWHR/49H0=; 24:WzQLQBImtybRJffhUwAZuyIhXnyb8jYPIkdTOGMTn1nu7YYlod6A0g9sJA7whEouVk3PR1BPRy7aX2bAcuNOlzzvGdLj3+MczF15qJILpPY=; 7:guzNfKaYbGHCeEDxAefrcqomXX79H9gSTlnsNkLxj8RL4y5YF/DwORXgljyiAGsLiMXYzS4+ZE0+ZuP0EWQwgr88EGVeBMASLX1JyOcORBo4J/SmqhRLtaqYKOVF0rpq9O5BC6Hr8qMUASM1eyn+rvUt7/hBESr2yIGpb7XbOIPwrYKQYVeo7wo2oo4ezRKl/ZXjc+wgrVDAzL3NZNYShDBwHsGdaXRYkTbtAXMOjexKzs++rhTZTRe+Y+32F498 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:30.7854 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef1ffc5e-6add-42f6-c0d9-08d5415bb757 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 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: Tue, 12 Dec 2017 12:27:33 -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 Acked-by: David Hunt --- examples/l3fwd-power/main.c | 41 ++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c index 0a4ed14..10c6f1b 100644 --- a/examples/l3fwd-power/main.c +++ b/examples/l3fwd-power/main.c @@ -215,11 +215,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 = { @@ -229,6 +227,7 @@ struct lcore_params { }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, .intr_conf = { .lsc = 1, @@ -1317,7 +1316,10 @@ static int parse_max_pkt_len(const char *pktlen) 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 +1720,21 @@ static int check_ptype(uint16_t portid) /* 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); + } + 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); /* Revert to original value */ @@ -1776,10 +1793,9 @@ static int check_ptype(uint16_t portid) 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 +1835,8 @@ static int check_ptype(uint16_t portid) 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 +1849,11 @@ static int check_ptype(uint16_t portid) 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, -- 1.8.3.1