From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30082.outbound.protection.outlook.com [40.107.3.82]) by dpdk.org (Postfix) with ESMTP id D27041B67F for ; Tue, 26 Dec 2017 10:25:49 +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=cBAaP0JHUV3qVuQWxjp9sOmmpb9CnTpsdRsKSQ2+jRI=; b=Bo+OhvmacE31ACn3XobAOENU6z51hrJ+H253pYkGkLC5QzWoo8pMrCr12Tf+oW+YvhGNu+NK/uNJMZ9Mh2XSJrci/Ui/ClE9E47NQAblgxrxXEtcsfKCBDuPmIXTzAavUNDGlWfjEY919z61ZCWwydnnYtXhX3PemniyFoeP9Bo= 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:25:48 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:21 +0200 Message-Id: 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: 88928c85-1a34-4a07-ff08-08d54c42a68f 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:GIIsr0u34MOXj1cmuiGozNpjB2Liv/6BTf1HXQYYMp0tvNSm0cRccCSNwM7Ps5+MAJLpgZLpdNr8mjvvhqP/Z6l7NjfowULmn69ChnuQ9rj4RcC0d0IvXiqP1ES8GsKoo7oRM23HLRgpat0bGw2hmVnps432iRGuao3tfjeP/ukOSPH96s0mIPZjnpJ69aQvCQFd/SpJyjdd1OaXDnuADo6W9C/KkDca8myYcsnQbpZZVWV+Uybzn2ZL3IzVK4pF; 25:JkXK5JcU+argqjcSys2ho4bU2BvJSDBwKZ41/dmJ6rua+w5k3nlSS82uUJiqfQOLjXeJUGTwsQ1Y7+Xgx1OAxiPFSVlIyagGDRN4y8YM27zX/L9hbcFRXCWcffZXbEOqEd1N2Dpt9QMhFD2TpezUFkJJjjYD3Q2w1sS+I5Rb6CtfcHPE6g+XQI1YtSKvmly4Hjb3t+J+GAmhSYbiLpBGWWH+bQvI45Z3VHqRTIT3I3ievJu1GK3KHO1+Hg+RLowZlqUoKB2foD62Q2KPVx0RBScfp4pNT2PhnN8PXa8LYUUUChzt+bFkdG9dMc1ip82LNqdYQ7/6RrwiZ0TKt9N9xw==; 31:67wLrG6dEvougKuVr/Ow1AbaDrIYhLjwDBMAYPMwawBN8Z0PYUO0RwWOmwvcEdNe54eeFu/qu5G9XzIXac73Zg17EXkQ5L127i4oI3F+Im75B0sZJxPqtEgpWTEuCiVNqld3X428Ezn9NrQbba6nWx/G/b0CJF2/liRYYS272ouo1TmonUQQUG+WgKpKj/WbzPBiYiLsNkRa2tFiWbRKtRgf6dx7p5n0ym6JRfrxhZE= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:3Hb3Ms+BM2QRis9ajzeV0u4MI31jByQUh9wG95MeArQLZycIFs/TToDaBRvfHlvb9t/I73SA9MKFq/ZemCB4szcCjeGXa1O4B7kiulsW5dwWd775nViiokxZDtkgYHt+szSrtVO2sno8/dfmZrLDBCRKUZouD59A1ZMT32UAL4XnKh/6WeW3Zu8s9aM/v6kBWLE83sBbDSRBiitgJiv6PPonXLYU0m5zR5Z6Ox3wz8u2j1DzPZK9jo3RGYnNrAp1JwI4O4VxVtl0dU6vLDAIp1FIuyD/K8nfclc24+jpUHXecjkwJfmdISGQK4hU1OTPl+d9/9c7EqJN3XApVqcgOy7e22CgTa183rxvs1IG+8BmuaDOk6cQ0MdSTi9z0ushKB/hY+kPt4K4Gaac35LI2eKy+vzIHXjWtn7HDIK+6YfV61ixR0n5HPONLCpMGS8HbE3mES1kyKPmi1On1F3D2xEt43SExgrd3XtIMAfP74U/CIhAyW8mVl06s4hfIwZN; 4:KWzHH5mDJKe0J0+h2N2qspMf83KC/0PVwqhhfEfqe/vUhNIQZQNmjz8fvTlfFumlUnik3kPTKcvclWKbtRS2xixzIyDWJph9JPd55sooRPBOhTulp3iu4FdLcOswc0HFaIz5hTpC7ggPBmek+luMgxDJs8tJP9M8TknX6+xFeBOH7WAjvfiburauJsL85rj2VUPJQHNOb3ZVE/NG/IwyYS0xMOZnWfTMe8hQMcGXE4BTgS6HhnqSkSSZ2dpeV5WIhMJH/zTC2e2ASJlAOoffAA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; 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:JWpQN4yy6mL1ZcXsF9VGuFzdXhSwXLJVZbvMDt1PB?= =?us-ascii?Q?CIkY751e9RKp5KnfdRtoVHVRazjFYra2bdd1KeDNVeXDwlMqVisOZZO5hSDh?= =?us-ascii?Q?omoqDgJlFaRmj2iHBuV9kDT73c0e4HT9xX7nyztOZIkpxMia/rtzOrlrDVA+?= =?us-ascii?Q?7L71fGy2SYppuiAj9QiA9qZ8saw/Fx/bdA15gleh7e81xtuL9dEvnBHjNjLQ?= =?us-ascii?Q?7Vn8wspdy4tmNnCibORitVuroYDoIpQq5mWHrk0gmrxZ7S2SwioRFrDGqp/2?= =?us-ascii?Q?Mqz69ZdfLIfSC4gVtymKyrRNWRqbUWpQhSwxGIwxRLplEua1pfnsEcGuBvaS?= =?us-ascii?Q?D6EzFePiyESQJOlDpi7k8u1amVmDWLRZ9ai7ak7EHPS273BcAzmEYpZ68NMg?= =?us-ascii?Q?fxhgEBkF86Ka2Hl/ZK77gfY4vBrEVOFizg8SF3DR5P14jHcZXdgPQEVpfNLw?= =?us-ascii?Q?PvnNuXfo8MeHq3ceMc8M3hbOaQA4uTOJVVqjOqPPIcUBz7Pak287oYQIdio7?= =?us-ascii?Q?FE+KwDRmAB4zND4gcrMggZ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uUc0A86QUjIa9NRQLtPjl5/4YYzf8PJh6dEcNBX1Fh/JFC8TJJYyQRJoR4V7uuF/5QLiQ1qbl8lpgCR7FIeNVrSeS/W+e2EvfRVlycTyqzFeYRQLXHuPJCeuuQfu24IEk23J/U=; 5:S6TujKNnw2U0pNdq5+KghTsBZbPIworMx6cLJ2iltdiPZAWSRnhQEmwx2dpWqF12XXeILpLX0Zo6/snSveC6bqvGLAml+ey++4DNlB55BwnopCzboxXIKor2e/VDgqK45y9xjIyP3ILuo6WcPtkwYZYaylo1KHocQKk2kUKYLz0=; 24:f4RMH5wC+oFwvuwNaIk8KCKefLNW3rznirXXrgeS+tM7sg/uJ9bXHzitCACBhadH57Kg/USu7x8tJS5EnZHXfmNrPUupCcXLBBljC9eRwpY=; 7:xdoGLdFDDT3QjWjxS7jsWwhXh6ZxmSsYKNXubhInHmrbaWnl3M36V/668RY3rWiYX4t4IR/pCpdkwDSJ+x9GgHPbvRChXModsaHmKCkFAumz0NkZ5NukxPxAYrDhGiEu0Mt5obSkeAs8kiLN+rpdodPP71/+APeIUjAN/No6D7NY+vm+HFFoEVVZqnH82Vh/5lRXnAQZvvpxuM5e4L0LUswXYVd9wmCI+Y3jEVChPs7qv8WMg4z9t58fYy0Zo3+A SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:25:48.5675 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 88928c85-1a34-4a07-ff08-08d54c42a68f 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 22/39] examples/qos_meter: 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:25:50 -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/qos_meter/main.c | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c index 67b4a75b9..4e7c5baed 100644 --- a/examples/qos_meter/main.c +++ b/examples/qos_meter/main.c @@ -85,11 +85,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, - .hw_ip_checksum = 1, - .hw_vlan_filter = 0, - .jumbo_frame = 0, - .hw_strip_crc = 1, + .ignore_offload_bitfield = 1, + .offloads = (DEV_RX_OFFLOAD_CHECKSUM | + DEV_RX_OFFLOAD_CRC_STRIP), }, .rx_adv_conf = { .rss_conf = { @@ -310,6 +308,10 @@ main(int argc, char **argv) uint32_t lcore_id; uint16_t nb_rxd = NIC_RX_QUEUE_DESC; uint16_t nb_txd = NIC_TX_QUEUE_DESC; + struct rte_eth_conf conf; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + struct rte_eth_dev_info dev_info; int ret; /* EAL init */ @@ -335,7 +337,11 @@ main(int argc, char **argv) rte_exit(EXIT_FAILURE, "Buffer pool creation error\n"); /* NIC init */ - ret = rte_eth_dev_configure(port_rx, 1, 1, &port_conf); + conf = port_conf; + rte_eth_dev_info_get(port_rx, &dev_info); + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE; + ret = rte_eth_dev_configure(port_rx, 1, 1, &conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d configuration error (%d)\n", port_rx, ret); @@ -344,19 +350,28 @@ main(int argc, char **argv) rte_exit(EXIT_FAILURE, "Port %d adjust number of descriptors error (%d)\n", port_rx, ret); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(port_rx, NIC_RX_QUEUE, nb_rxd, rte_eth_dev_socket_id(port_rx), - NULL, pool); + &rxq_conf, pool); if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d RX queue setup error (%d)\n", port_rx, ret); + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = conf.txmode.offloads; ret = rte_eth_tx_queue_setup(port_rx, NIC_TX_QUEUE, nb_txd, rte_eth_dev_socket_id(port_rx), - NULL); + &txq_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d TX queue setup error (%d)\n", port_rx, ret); - ret = rte_eth_dev_configure(port_tx, 1, 1, &port_conf); + conf = port_conf; + rte_eth_dev_info_get(port_tx, &dev_info); + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE; + ret = rte_eth_dev_configure(port_tx, 1, 1, &conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d configuration error (%d)\n", port_tx, ret); @@ -367,12 +382,17 @@ main(int argc, char **argv) rte_exit(EXIT_FAILURE, "Port %d adjust number of descriptors error (%d)\n", port_tx, ret); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(port_tx, NIC_RX_QUEUE, nb_rxd, rte_eth_dev_socket_id(port_tx), NULL, pool); if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d RX queue setup error (%d)\n", port_tx, ret); + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = conf.txmode.offloads; ret = rte_eth_tx_queue_setup(port_tx, NIC_TX_QUEUE, nb_txd, rte_eth_dev_socket_id(port_tx), NULL); -- 2.12.0