From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00068.outbound.protection.outlook.com [40.107.0.68]) by dpdk.org (Postfix) with ESMTP id 892421ADD3 for ; Tue, 12 Dec 2017 13:27:31 +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=cV2eTmDvAm6dzk6FoQIHUAo5VufSlATRD7MsHQhTFhU=; b=wytL90xktKPIBpJiMmTt5R/sYJtTnbbVcj39hzPz1h4pSODYWdmBqhj3yOZNKx0luixDHLQOg1W/7skYVKSJEP3k1XYSTy0ViCC1ctjDRF8zwysN+pGWrmWqzRwR0xiumwDrjnBj3aAKnpuCCxzeSKdvZ7Lzky49WNRnvNGfMCQ= 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:29 +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:23 +0200 Message-Id: <6beca5f92a6ae39af02bb2c458cfec77416a8734.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: 000114d8-43e4-4512-a309-08d5415bb677 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:Xm9+c8+S5qYDKOoWVM0SJy7F2UKl5qIXjIsNfBlHx+Cay2weo95g/0KwRI4AoLtWasQnarrGVXx+HJtyBlZks8SfrpmTKj6ZTUERfqMAcMsaF+HZbVtdeR3JqZoH4A7tsksGGfgOCmrsSFJzIc44spRuC/0kNdIF3Qm+8+1pWSJBdZL9htGUkEX5kXiBoIS9aH6ygLibewLrRoKXhYmFmAzBRIOKlEm7Ftxq2cAVeRuNlgFDs7z69JiPVrX6HnEF; 25:riNGHWhjMN/DmkglFt8T/JlWuokR67TuVUCKN9i9d4bz8Uv70HaHr282f14undoe9xARDOzwJz69FzzKK32RUhtnAFwgBaS7hHcWdj/9L4BAnRV3NBQXDqcglSBIAwtTxctlMps0wPjkw5HrKloPZFaPnsP8XoYdXIOkQqEppLcyMQeTgXD1WT0iuJ9k5SeLsHNd0cu55UTA2ZSlbFoEUjo1yf9BuwtvKMg3u6pyKpxCs7xmhbSelPnGWMJmAPNH7C4ZjlAleYXZIjL4ZeeXxPlMmVvXY8GSx4Kt2kzc7QInVvEfINS+0Af0dkj90lEl/fQjMYEbHAh7AQ7KQsMMKg==; 31:9SZr0f/xOA4ctOOLS5gEIZUFIe2l4h3RdMxsbLslocD5jmWD38n0PTVmBAVApJZi8YnPiAi4mPT0nqS0q0Yqi8xF6iYSrsItSl3gx2CUW09ovrYt0JsvR42/rKSSecr9CrrKHhMqKVgyDLoJ7VDE6g/KFjGRAl4rY5B2zjijwjdWdC8C9NX7Xb4J3QIDjczHU34DIc+5sToPUPSQJIxQJI9MBdDRKaJlP8l9NfE5O2c= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:3htDxIeLwzs2bCOMmlc2n65aHNJTkuWyciffK1vY6keVlqdLx8i7Jh2x76VhGNtHy82kRnC8VnsVbvckBnRxlmeKynQZjO60jrNHVcCnmXu85ushdl7PT4Q2mhKI54TevorjPvO5yvLTPOanAkZMXm3DeBihmZXnJW1tsOOBd6pywNLXQEaW5TzvHn+n/XcTfnG21YhTS2ESt4ypDUbvEiGnak/zE8bs/aPTpT2sUkUQytXLulfHfRPCqffQ3jpwR3SKTS2CKn3Gn3QlZoC8JuJhke6MNwF8VG+875vqYhxpXNOcmo8LZtWKU6jgIMPqqbMoRIai9s/2SXVVjyEI2b0aalwzOO3SbMX2gafOEVjTuCCqZ8mpLhHF8vOejPpJu+Dujk21qNoGbzocDtUfSCOcUuU9oFgpLS3ufvyHwhsE6JTFFWhBx3kgZBUp58vmCyah5pAGpkcP7tnKrvDc2AOyi0JPLAY0l6biyErA3LX3RZIYHi+39UtxmcDMt1JH; 4:hGM90tspOTb4K0J/7FbB+KwrKLEmgtfXRjCaGvqASVb3VhIiQWFZcyAlL2FJnb8b3K4j/FENk0KQGV97M7RMX8zcsHiMmtKO3jLjM6AWDhM7uGjommvP6CYw00D9vm0p/IJM5DnAGk6dfef0bwl6GgxuV3LQYxeGYk0e37nz8H4+ZwnothjRUHXgNxiwbPZVV0jfcgkgPyVKep12F3OhYFv3sdyKrZS5J6sZXPfE93qud9Ad3sglw7/QfVHvxifYZotcjIUua/7MRvgQ6aKKAtGhQr93IL6O6Z1zbMm8Ze1sXj/TPhCzrQSzUAwKB5XH 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:ChA83qlARVLDl7H3cFqnPGWpuxTRl/IoHXIv1tXSq?= =?us-ascii?Q?5xc5H1xfCaA/q020yJmcmNJ4s8KVGyDusMHI30JhwOV+5KXvjakBU1Jy/Xyu?= =?us-ascii?Q?qjJqUoLAQgx7Vt6TbVMN1uKW4Pt+z/QBWgoQk6Iop5A8Hpc0g3GCECkLZZeb?= =?us-ascii?Q?bp214A0sLRjQ2Bq2HRM/60XOJw49FX+xELuKPamgKee2O8p/u0zkKhHNmXkn?= =?us-ascii?Q?YRF8GH0w7U5As/cEhVQbTcSTgYtcdWCXEfqjZj5xu4HuBbsVcq0yF5Pkop1m?= =?us-ascii?Q?KaXe+dG0algUVETO8nCMIcXKfagnuDo8BGLTyja/V6SJwssRPU+KidiTFiqx?= =?us-ascii?Q?dNtxnc65TsJCjkaMDRgtMMQL/xTIaoCGictXIbmYZY7CTmMbobiuts3DGJWI?= =?us-ascii?Q?kAyh70Ou7eWEQKg6w7idWd9L2DIujT8gNd0QySWH11Z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jbykB2gIXO1sFrguiYdbuQuXeriodhdnGTLLDIwXoukE+N/lI90gjk1bB3be/qgkoH8qKkulpaMgsMc99GMucNgsGT+lS0Pl4Bqk6PNmH5xmAWn1ySNxPXKQ=; 5:0Vn4plW/WmO++ETyYJGMqSIPArpMPFMEWNHBnhfxSONjUq3lXuyOAVO3qbOV4thjQcGrEJmocy93uWRgMCP0L70Ijz5FuMIxgJgKsVloyHckJ5q/qMxadb9TBgLeTWP0eZ+adO5iypg52oD66ypsoc+jUi8ITWzHWNDkd4ktqcA=; 24:gT5mSiOrsHCDIz/MwhIjapZlXDDZo3l8PQDTJiTZI9qSSzu7xUcrQWdExRY+TeZN0uIpddlZpwtm/ArF6oxAmYlvuW4sZMK2oNxyiP7VG44=; 7:s24sc1iSCa3/DuyAUhjlmXO3K7uFsBnR77wCHRJ4N2cK5+ADgd2qVWMV4JD05LnLzARNfvCHoKUsi6NbpvXKTBK9/P/IPTQ1mmCq7Fk5OWgCmR9G2RZnfcrActWlZVWfOjeHrKoVav5/CEFnjTy4ZvGBgWxDYu8QZY8pFg+ZVdKFS7NBLwPDZjO45/p1jyLN+kvdBqpfY1rGhzWXldyjoXUbo7NV3kiSetkijpuggIXKvGqnlzJpx9f8+NsnQfAS SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:29.3166 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 000114d8-43e4-4512-a309-08d5415bb677 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 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, 12 Dec 2017 12:27:31 -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 | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/examples/l3fwd-acl/main.c b/examples/l3fwd-acl/main.c index e50b1a1..e13b1d9 100644 --- a/examples/l3fwd-acl/main.c +++ b/examples/l3fwd-acl/main.c @@ -156,11 +156,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 = { @@ -171,6 +169,7 @@ struct lcore_params { }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, }; @@ -1727,7 +1726,10 @@ struct lcore_conf { }; 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 @@ -1948,6 +1950,21 @@ struct lcore_conf { 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) @@ -2004,8 +2021,8 @@ struct lcore_conf { 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) @@ -2031,6 +2048,8 @@ struct lcore_conf { 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; @@ -2043,8 +2062,11 @@ struct lcore_conf { 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