From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0052.outbound.protection.outlook.com [104.47.2.52]) by dpdk.org (Postfix) with ESMTP id 0BD951AEE9 for ; Tue, 12 Dec 2017 13:27:58 +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=tqDXnq7d3R+5Mdjq1YEVJm2okWkshsaA29891xa9cfU=; b=IDYAVYKWWA+kile+XoysgbHV+XeTiHWSSYKkDncUJ5gTPGGmkWfyYETV+mSA/vFVsqqrdVEGl/giEIdGBm76HylE2/V0IqAtVmHk0+m9FLoy7slXpEY5wlSj0v/XlQdc450b1jZZNoSyrTLSeF25M1+64qjtB+yq2+0akNL9quY= 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:55 +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:41 +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: b1b66754-5ad5-4aed-1e86-08d5415bc63c 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:dHvpmFefpeib/5K7ygvN+IblCTyB6pxqkm/mCyqAsvaXbDCk7y7Yxmw6ac/6rQC4Cu+nFktcalCctG8X9pw2woqxpmoYETn+Y6vGILv4mtFrgZsdlz7MNMUQ/xW4v8PqlBc5bmv47OSM3uhct5gJAdKdNX7di/8eV1k6kFGLWfPekr7cGSb/pF1xfAXPVNJGoNn7JPbW59odpp0Sd887OdHW/D1HCsaWATGJlOus/WRRFGFYBd9e/h8oARLFipD2; 25:c5BYv+pm9sHZ2GMR6iM3TMVxnZqRsWOAxzhXFcY/GhfTLu6aOkGWc9xM05FXWm3RC4fgw+MElwVl2MCWvda+EipmVOk69FllMYUqMkEJX0yDKgDx3ThSi7FobYysCgQV2cfozSUkYwnZr9UVmim6ySjaC5nn45R3icosM38sqUxbGIhviEh6bJP4cv7HAgU8+QOvYAd2gdqXKHY4/47oiaVP9H/MO+OzccnKvdrJx3m1p5az2aTwI5vn7XZK2aUghVZ8Nr5jkFq/5lLoRbgT7OkkEGarBEz+/ykh5O1emSuEC+U6x3RlkWCI7edjFrYZN71b0GP1mgcG5l1g4n/tdQ==; 31:e2Mgfq5UL08/d03GdtAyQeJ9SfKtquCgjUGJH5P/pLb3yQ1apv8F7G4mUTJcOhSwWKJP1EKuWucgJHRY39OkUK6wkkYM4rf7BPKDoOFyxhkzj9mbXDD5I9i1eFDJS8cLPnPUlsVvFT6RCQuk6I5Qy4zEN1QuYM7qRnW/Nv7AmI2SonEvr4AIRL2pP4kGoV0EmvTU+eqRY4SUoUyFEn24ZqcYiR0M74zE0HEvTgsO41M= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:uzVBSTCBO6fT+kw5kl5A9EBzbMknwrd/hszE9QF3QtTJC/z/mltdL+hCQjEslrVXGCUOtSMqRYSBx1llC1VbtizRgvlsgE8mMWmZIxxyRdA1cZzYWkjQ5oJ4wc4eaYjvbwUlVpCxgh6zoo7nTUeWXjPbDETO8CDyTHOvwnQeGz+YA8cXQKmqa69EkrbCIJDecHhsDsN0eugvFNrYk9/HDMVj2RXe7DZnKiR0GIJvhqn9VFgw3FZItOVzEeCDkhDYWipHVOZgJpFZp4TU346Rakc6892YUz2gyh5frN3/O0SD1kVFb7TYL4Tyi8ZjOd6jVFLTCD+QSlUbCnbOwv0GF9EU/ZrZsid6bq02UijzV2tyfp6TDsk+WL1pfgtFM6Erba0ExZWRR/+GCNGKI8MaRdgIn+y3UWS/zaxSVwjGWBIMHTbxLJrtkoELnHEjQqVgWsSXSQDTXqq1EIHOPy0UwGDeD4vu1hpSjfvKIxE2PUcyUBn6Ir3iZ8niOI8Zph9z; 4:PrPrjX9uVsrsfKWY2/FjIDWnvQ1UjJ2QdAjW4hjILUD6TNA0JHmos7Ew+q5xRk7j94gConxeR8qhKobfWs0MCY7CtmAuR2morDlbDGyZ0hxG6dNjLlonoLvhDD4PVwHtbajoC5Hx6oFA4Knwg32hHRWpoUJEcswkFB1j4qa3L1kHj1b5LWg5sfPKAFrnxOWatMIAkenaLOK3bOhe5NwkqGa2KTsrePXHR9uZ+d4MtTtuTN34BPNEGpWIAuYHXM3A765gTEvrH3SFiu++YS5KdA== 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)(15650500001)(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:+fUXI1PCu2o744wq9rpYnCbnQevTL0EcUAJ3fQq5Z?= =?us-ascii?Q?vc4nGKg9nGDdmyWdHA2ZZOemFNAORkhrePuRqGpIGtpcv2kvAUkJJYcujPO7?= =?us-ascii?Q?DASVLjz2XHdVI1JjB0qcQo5Jz/PmRpg4JqmWcKV6CMjk/5MbdhkCdQj/zc0Z?= =?us-ascii?Q?MZSoSHCkL1ziLV0gI8kERkoBNMub+XhFeKMWNpgtJGYCQbTm9BZcVkavqx6u?= =?us-ascii?Q?v7srzB37u5ezPDG4Aj39RVv4hC5DuDe/6kD5hWUAqRLpZw5XJQ2Q5ITQb/45?= =?us-ascii?Q?atn/B1zaonrGxsXMueqxHWPVP+VWTmS5MJd64aP4csfIMBmg6yt1oWh6UgRH?= =?us-ascii?Q?NZTQDPg2XMCDAs6Q7Nm7Q7i7mwt37/Tn/YEVOdQdsqCg73K/lsC3SXacXFvl?= =?us-ascii?Q?9HwV8OPpaerdgujnhxDrvKYMYa9vUUVvUnF7SE3o2BnME53hdQQ5bN4G3hcL?= =?us-ascii?Q?KPlRPaNJmi7+KhU5Ojwm5eh5xmWlvkopQl//QPI93JfFOoEdzDfwhIdeMuAq?= =?us-ascii?Q?PTJblFFW1oYhd6AMRKNvzj+xzjvvh2bi5uQinl7t2RR66YyZksI//wxC2Njd?= =?us-ascii?Q?mtJEx6ciNUm610Wa44eUBuDSbGArqzrpAqMsRazWv6Za77Dc9Oq1c+ah2drD?= =?us-ascii?Q?8rTesAneqT7uW6RvogHPpTTONQtCgHoFW1jPrfLyo5jbYraYiKVXAMfdePDP?= =?us-ascii?Q?Mpmob43iiYjuEvzH0gUT0/iAHLGfar4nxiv20wYdzKTzjbK5ABDK0FiZqmyf?= =?us-ascii?Q?yvabiG/hfpsf019W0qQ7norhUyWWUu4wG8+CgnBH+g1AMslVooX4Y9RJrlaA?= =?us-ascii?Q?zjxyfSBLH/z4RvfdQfMIeNmo7BPmQ0AyCTE0z0NLyITo047BF8vUlglAWphc?= =?us-ascii?Q?R3RSCxjdBsYjmatmaBhadBQpBYUQUVUaVZkmri7f462ccZsFqm+16aF2/OQi?= =?us-ascii?Q?33XFxCdusprq8MMufdk/y0pE1cGHPmBqCIQQ4ZKVVY5TgglxGOj8hlf10vSI?= =?us-ascii?Q?yI2mv17l4IksLFqjJN54DK65RwWIxT4nsDevfraf5r8k/ECPSEqkrS5iQTke?= =?us-ascii?Q?GJxM3sOBpodfBQ8p6DaxbMvz87mGj68jGm2v12U1aE3G4mnZA=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 6:K0Jw9wNVDpttKEs0E+Ei29fvemyIjRWymeLbyu9FA5vO4CumYbOWVkLimo/bJAflxtgVbIgz772WXA+avMkNZqoqVMCIcyYGErRA05EcN900L3w/06Z4rTQ62gxXdCKVkCi4J+duC5g/lOAsWyyktf3C4GudYl2Af0APRhD9/HjiCN5/mLK0wkvsO0LK9rvX35jTMM9DTz9+WlIUSEzZv31mrkY1QuPG5CcoeVf8ZJGVWXe9PqZGoohqOHM6jZ2K+dkZCRF7wlFOlXL62d7eApVtEiE4bLNj6fISVPmiV0YVj0oQ3qqqsRzqOOXmPOTO1NXY1HA8bB+uKFjRm5oS5AG7n+x0CsdjixbUOdwb4nQ=; 5:mUWYJW6O0mcPCZvRe0pAWB7bRyurNTEfEDrcfL1jcYVtrbVJCutEHuGipmJ90IMTvFAEIgDrVzRIyxkS5Q+jT6ArG/nr9ITKYRPw7spN6fxzbN9Rat+5lGucqr38vsnONLqfz5M9+n5ikQ6s6NWmWC5XKzTLetOANvGFMfG1qOk=; 24:qVhI9AXg6wl1v+RatYJXyPVxOup8KjJu6nwgNFYH+dHGyUT6OmU5Bsp9MEtS9EFtlFCGioM2dr3/7TozB0vgiwrIXe8qGNp/M83MmkikICM=; 7:vSPVVVnRvZhxS+x6t7ynuDpJ7wA7Rw8My57TLUNRGBdTsI0uHCPLhNBy4iTWSgv5v8IMBh5+WPKg1JVqWnMd7u4AIE6eueU9Il6+Gcm4UQ6YOEYL0G73OV3Tj4Un5Q4+cv2s7FDAHVeI1hIBDml1JJQ0g7R1RnScb+zwbTGht9Q1fR/E1AmIDUEw9lkFVgpkZy98qRtZDOTaf1Zg/a5SaE5k+xisobBUJCO6UzpxGTro2KmQEtwqdT71O/sJP2v0 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:55.7701 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b1b66754-5ad5-4aed-1e86-08d5415bc63c 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 24/39] examples/quota_watermark: 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:58 -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/quota_watermark/qw/init.c | 37 ++++++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/examples/quota_watermark/qw/init.c b/examples/quota_watermark/qw/init.c index 37b0362..74cb054 100644 --- a/examples/quota_watermark/qw/init.c +++ b/examples/quota_watermark/qw/init.c @@ -50,17 +50,15 @@ #include "../include/conf.h" -static const struct rte_eth_conf port_conf = { +static struct rte_eth_conf port_conf = { .rxmode = { .split_hdr_size = 0, - .header_split = 0, /**< Header Split disabled */ - .hw_ip_checksum = 0, /**< IP csum offload disabled */ - .hw_vlan_filter = 0, /**< VLAN filtering disabled */ - .jumbo_frame = 0, /**< Jumbo Frame disabled */ - .hw_strip_crc = 1, /**< CRC stripped by hardware */ + .ignore_offload_bitfield = 1, + .offloads = DEV_RX_OFFLOAD_CRC_STRIP, }, .txmode = { .mq_mode = ETH_DCB_NONE, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, }; @@ -78,9 +76,27 @@ void configure_eth_port(uint16_t port_id) int ret; uint16_t nb_rxd = RX_DESC_PER_QUEUE; uint16_t nb_txd = TX_DESC_PER_QUEUE; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + struct rte_eth_dev_info dev_info; rte_eth_dev_stop(port_id); + rte_eth_dev_info_get(port_id, &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", + port_id, 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", + port_id, port_conf.txmode.offloads, + dev_info.tx_offload_capa); + } ret = rte_eth_dev_configure(port_id, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure port %u (error %d)\n", @@ -93,9 +109,11 @@ void configure_eth_port(uint16_t port_id) (unsigned int) port_id, ret); /* Initialize the port's RX queue */ + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(port_id, 0, nb_rxd, rte_eth_dev_socket_id(port_id), - NULL, + &rxq_conf, mbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, @@ -103,9 +121,12 @@ void configure_eth_port(uint16_t port_id) (unsigned int) port_id, ret); /* Initialize the port's TX queue */ + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(port_id, 0, nb_txd, rte_eth_dev_socket_id(port_id), - NULL); + &txq_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Failed to setup TX queue on port %u (error %d)\n", -- 1.8.3.1