From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0065.outbound.protection.outlook.com [104.47.2.65]) by dpdk.org (Postfix) with ESMTP id 29E761B3E0 for ; Tue, 26 Dec 2017 10:24:22 +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=z7mqw0V53YUCxg84Vea1f3abzkEqE4gRuIrqIgrEBvQ=; b=QTCx1KUvK3uOAnnIzq072+XfXoxZqiHyE3Xprfg+/WC9/2VHBIcY6CLjjNHauQtEnCeAFshp4OWWDzsGAEUP9UJzjR92E9OSrGXuKiJEJ9KoEY/7RI5YpkmSYxOB63242cPFTbi7aSDuzV7JKnAsvWRjjG+NIH4+VZ4A0dDAZ8o= 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:20 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:05 +0200 Message-Id: <0a0bdbdd7b2a8a46b270476b600e93fe476b485c.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: b1332670-128c-4b85-2817-08d54c42724e 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:XeE5U19td8VrW6QFDX1ZmkSqPjtObY8EnAS889iGkQfK261QGURRz6iDbyDuNWmCcegZYvJ2CeSo66sPvrTD92qCTZuVyTVxCSmg1js5RJGVfxUCVDPrpFsZg0F4V/3WrJqGv/EwNDyEnGWrYTgysTsFnL6mkm7MJHGBP4V9/GaPkqlZQvCQZ65nQLbtmFLjlbfqf1TyZ4U90SBUwes5OCp8++5gjc9b0c1U9F1LzPYg8cYrJuL2HqtRwCmSP4No; 25:YmqCN5YcKeflGzHIknpxSL9DPajhS5zCKZFJ+tVPT0v44mU5ZKY0wk+HCgcrAy2Lpax9jT/L2QJP/TXl0b+eCuzxfnthGHtpF+m+j/+J770KLtXhKmfj+c1HjmrFZaTYShmnwVwiC7AH4EpxxnMLQjD8rt70XEkFEDsgsvycwpDdglsb5asoG+ATwBcFtyfczQDcUP3h6dYUdw6l4dKYGzCAYu0UTyZ11B1iPWxfdeFSJm2WZ1IDNf6wyQPdcKjhWr58pksgv1zwlNRhQ7konzN4HgNQWI7fIdYhnnos5fpKd2A42cnMzkkqTCKZkdnAbMoI6VHutmofah7CW7ywIw==; 31:dP3to6ZmCNoYavDAuHTgk2Q5BUbE2Mt9/V8vVfYUiNOlHA1gTgOJliVzM1JWkytM0wC1bR9gausuTxwJStRgH9tdSGyoQSiwABW1KGjjmX3eF7GXgdVU77H3vXSBrLRR7zpuimQdYsHwXPoftdKWFoeER7T7yh3ieKQYJyGlWxwOYr1aFzFvQKsz2j9GJ55U2EkeDOtPhvwBG6eqbN1NqisbvYv6iBGHJ4ouMPW6vPQ= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:AkyWEgTh4Mzs08JXUvrjlfQyR/sQ86NTy7BnXAzwpW+0yU/mA6ca1HFJ2t9zs+Vpc21dqiqEZ8a6/9REsih5VSW76aJGFo+pPDX2wHKQDXiD0rr4xTaIG06f40f4jlcMDeG67YjMqYoR49tTWMzPLbW2y3FA97o86tku1zXeYCV4mmpKTAxhkMlSFoC3NUNM9inWPC2UI+jXymB8cApNnzSGMXSL3sdXz8N+ekIqEczTYz6CUhBiGdT04rLb/CGnoknsqcdqIesQwJTsAaSMpN3FyOhE8YG5uWKTDGBHfV6OiELXvAR8mmAmlOwl7F1Yyqf4ZKMfnN4oEvUxN48RivANkYkSyTiTb9bP8+d/UWvyRd/9bUF8Y8yKk/FTcbsw2LH14PwbUpbJMAt/2P8mRnmWRHSFY+WpuGTt9LDn+lC8LV33uNGK9aw7F59DasyaP8arF/RW54+l06iEtGwycNR1j6LnCNyFYEbWQGQtIYsk9FlQE2sNQ/vQbualWw3k; 4:8q9oXPiuObTp15BX5HFfjswIwNtSAQpswceSYqP8+dBG48Kso/yjnof11NL69MeVSnCuZfzItswIHFz/H1l5xXh4lK0Qe0C0rfN28/kpuWoT23+mC5iOANgzq5gJRQiQvfh7xfuCg7Z8s5sO6xoGj3wRBtXool3x3XIt/GPYdbDnHi3dUOB8l8i5gWSuUXgkVRSlAumA5PGW5DTV4wwSe5cErUNyDLGS6bETvU66vph/gCkxHluv+vyHqrUYhkOHk8YBF+l1dEkCpMZqBLQ6MysHRvXrz0gvI0Fl9/EtzrAMzR+D+SUCWrlLIche4Kk+ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); 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:bcsKd3yr+etny93OiHOyt/xIAVN9BgfwWIwu6wtpU?= =?us-ascii?Q?g5FJlI6nKet4taY0bxURRhjOPE+o2+aksCipuprwWRC4JoVDp4VCYqleIpfT?= =?us-ascii?Q?XETfknvFzZ1rh35iMS6f3PNQjDlNiToaXN/bpWvQhITGAHatz9FbtIfGEbpR?= =?us-ascii?Q?JTUDDlwrZUqTMIdrdjPcvbyJ3dDqHOGzvppjc4HhkAJsMAvkkA8qQlldJqip?= =?us-ascii?Q?38aypb7L2wXL5i80MvD+Q3JUG272yqf5Cb8S1k8EKBrIrKukNiUMKNsXQsxq?= =?us-ascii?Q?Fh+eXnTcgDVW2qNuJk3dP+G9aKvAp3FQ3WUwzMdFWW++pWOwMFQ2ZW2uZ4KM?= =?us-ascii?Q?8+5tAQ0eHdp3NI8/h2dXM+oVIQeeyGYOfPhWF2BdIYNTFvuFBiEMRF0sR3nt?= =?us-ascii?Q?2NzNK2Vi3lKKAGrVz8+PHV5Ol6F45c1lX5UemOSzqMh3F2pP2AyU4nzvbZTj?= =?us-ascii?Q?4tIvOCHbMkzeecxgpIqrcDVEdiEooxKszYc3nmY06THRRhKotRrbNRSCgjjv?= =?us-ascii?Q?1zB+QOsITkHWl6jVYrr4EoCKlgCLrlVipODj0JN4ieBb4DryYTfHicNly+7D?= =?us-ascii?Q?jTR6O5togQS+ocWf9eOeWRbVtI10XizPE0osCEmit2RJ5AbKFQhDdl+CNzwZ?= =?us-ascii?Q?cWs83teyKrX2G3/CozAp4T4Z9T8NpzcH9qhCISJZ83poGusE1l7daDeW9Vsn?= =?us-ascii?Q?XPBolemxbFpXHbYlNWawnw5R9I8/Ttj8AdIAaDS/gSq/mjiNUqcQr07OtBZn?= =?us-ascii?Q?sMOTauz7dqSvArFdzDs0M5iWr9Ty8BXSMztVxrb1zh9TF9p/p7YG/6TXTERc?= =?us-ascii?Q?61zP5pz5YYdyEMkBrepqfvKDm6w8jXO7SIq5VWK+LuDkOELjSlfO7IcXX2Qx?= =?us-ascii?Q?K/86paevyFLYN7BtxuV8y1+cTuIA0xfutPiccCWM/i8D16ymbtL/RMxYuZ0d?= =?us-ascii?Q?BItllfOu6HwGIneVknQVkD5qm8yUU91I2BGSf6lZdF7OD24SXg9gudilUrMU?= =?us-ascii?Q?3zr6/QKJMWSuvzuogj4vI/kxCpV3f7T0CH4mYbEE5V2ImY42l/1MFyn+ERcK?= =?us-ascii?Q?2zw8CBi4L0hgf9UebvVcu6QhTaJeCKL4K1cX47bJcqgkYY5jkc+9JUrVZGr/?= =?us-ascii?Q?TgX3fDS5cOEL+cR/rsR7tRSVALc9YvAOJEv7adx1LLy6DthpNInsRk6o6pPa?= =?us-ascii?Q?kv/s21t4vWc7/c=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 6:+c3Kgoe1g90/VLltiIuGfKHZJHjyIfIP7luJEcIKceydPtluR3D4dN5pPcIZWCDM3PDR6T7C6kIogsjBKPk8ZF6efUrf4LrzZm3iZp9F5EnSaPIAerDA26US9X1s4RK6QdbdzJ8yLBfItfvIwDL1MpiEz9PB441O+Kv4azA7LxVz7OZ9jWgD0r6z5hl1m+MTytLD4Xb0UoBjs+j7A2E9Xvm4FGi89kbXE5x/9NMwqoKNZ7MaeA0Tue6kTqUt5z1317NgNkLvbJ0aEE8kl9sMzAlrR7UIId438bwHnUnarRb+Y1OqCfCCddeOoc1nOdy/hQgXlq25pfWs70+8etwepAsVzTMaknCqAL+xEljsMkk=; 5:zyR3kzw9n21feCGPO/vaTVR35KDz9Q4OykDV3TJgbtLXiIWgkPyzu0ZIRYR8ua26RQTPz73MBSlP0/7ZgfEEROsK6PknXDkoKFiqA81jPjVdcXbHT3TymFBBxDLP4ArWvoJ7KNIB3kj9ljKvxx/3ONWRLCdgwvWsBLVo/T6Coy4=; 24:iE/++OANVT2MHsuZXmq79059/tBC0gbW1E4QAp8fYaDk1lOMtypwEShxsADlSXBKYh4NJ46PAlYFD2d8LzYKuefP2P8hLKVGUUiyeyP6rLo=; 7:ziWbtpGOt4Eevi7updIUClh7EOjWjeLmRmt0r3B9/ICK6K1wRGHbaJ5XNjWBX9GuYI1mQmHVDDXwE3kAZI1e8fylvza8R/iEEVUFCRciSaA2s6okqx2s2zsxgpc9DzCikT/Lb1DXQ0fFp4WOKbZHM+n5Ubv2RLEOghTe7FRcWAgj3wSFaTARbPyTATrm5Zm+wAPi4l8I6fMnvNCrwKCTTjMJPLBFYmDsBIWx61gOPC2fD+rtyQC5IVL1Zjr68Qpe SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:20.8945 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b1332670-128c-4b85-2817-08d54c42724e 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 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: Tue, 26 Dec 2017 09:24:22 -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: Konstantin Ananyev --- examples/l3fwd-acl/main.c | 36 ++++++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index e50b1a1a8..f253a63ee 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 @@ -1932,6 +1933,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); @@ -1948,8 +1951,12 @@ 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", @@ -2004,8 +2011,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 = local_port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, socketid, txconf); if (ret < 0) @@ -2031,8 +2038,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 = (uint8_t) @@ -2043,8 +2056,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 = 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