From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30044.outbound.protection.outlook.com [40.107.3.44]) by dpdk.org (Postfix) with ESMTP id 0E2BB1B67F for ; Tue, 26 Dec 2017 10:25:51 +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=4r86j3ytunwwqpOXhPICHmwYhnSHovjX/4BSn7Zmn3A=; b=R2E7us96iti6/m2C2WoeEwXcVgzJHw8XRGmIUOT9IFc+iZugcyiiMMF93Mx4+IY37n9zulh7ONQNnwHBwNLbi2hOYJjcLoFGfdHGL6X2azAs+ZbcbNHr7Ple3pYVeuqH2TUwh7LK+IVQomXyi/6G2+bRgOqdvOjHAjQQvSRE4Fk= 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:49 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:22 +0200 Message-Id: <9b6226717a81971ca659836690df321eca93b4b6.1514280005.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: 6bb1972c-f89d-489c-09f3-08d54c42a75d 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:Q5c0OKNCNOwoRxhb3M/k9/itgzQTVJidFb6Nila+tbNVUnX/7j6yLiUsCJz6b+IWfsmmxwRia//Rg9ZgGKXhLlvDBSRPOUNA+rW2iNFsZV4eMnnbLCvSs3vc2KqSHDqbXBBK/w0hEkdlpfKq/bbrGDJkgONsQ3JTVjRF/UIv4Y9aw72kZce1uEW/n38OjS56aRiNk03kGln0tl81Ro3rdX2W455N1gbjC8qR2XbqpMKpH+1JW1G+OKHRTKjtFUHP; 25:ZuZjjS82Xe41//U1Fv7otmJTZoyFICqSZgPI52CxDaM1HO6cswrcm8xq2ffEzCMItskYSAVj/27RbIeS02+KqebxZRLNtQImxT6yNEA+pLK3bzlj2TDhr9u5a9d7mWeyrDYs+cAmRYK32E0RLFBNUaqvdIAtRBUh5gWPMrTClhTD0ZxMOwzBEu/eIGBc4GtEs9gMEi4DAVq/vAnLt5rKuTR6HdeoFmw7Z3j/fz8SYt4X9ipDGkze6+a9LkIdHAvuuOwevrSCh4SCJSXJ4ZzFWFlv1CiQ8hWG6WjOskiYjbCYi26W2u1b3855IRezNhX5tIT4jc5s2Ov82prsGXEakA==; 31:0cTq7Fjb3+Yfo1yWg/pWXJc1NrTDuRa/euKBOzb45ejwiRBpBn7B8fxBKXJQChO9/PSsAc0BCIzPdOejTVExJjgGNAFGtzbDj5Tzw+h24A4uPMFFwHMoBuynpLoZAiQrpANahj+mgxb2zF4jHo1NEg3r64+jhFHtFElSuLZXQxaC9KkQn4Qb8SppWkJ50rlP2Q6SlKpte5YfFsoMA1TDQ5CGzS9+YPByqaO6RZSF6i0= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:TZmI6/B1WhabsDqYIiObYZn1pD4Rgi/xmlVoMd2QZzda507l6Grx4k3v6xPf514VAmmUdiO9he7BRScN7WshAufvC3+aMqu3hp/YbnPhkQG88RWhinJddYEqRpH4H2AxSIenmWBxhs2E3TqYTLFMpJxJTmMPGNqwMp1tu0msIF6B8XWjCHAp7qXaX5V2JjQqVoLfGtpevh2RP5Zq2omLvghCyafnA9Jzxlriqovjz2YB3zJLPQBrr5Zhx9An1lT4wGDsXwlScs34x3wS8OBqFIsk17gV+MwNr4+DxcWQ4KeEneqapQrzK09hzEC6FgR+Wku/nojTU/YNHjgC3jB5ssEYxDPPIdg+qA4S009e00luPGUmNoZdcDWNMTgeMOAAb5wpqFdF8CNP75nti1Ic79pwObkovKp6s1ProLQWsdHvEf5yCoXtEWAcfa8612ohNWYh5c4esJrdGBfNRmWxRUt/UIDZIYi24+7GNMts9KOrXviGbiRbCJLdOpjKbp2F; 4:uU8tEEcEm8eUWPVKImYuUXe6Ex50Wi9hMYZIWAZt2joVO03Wt64OT6T1qUM82fV6xfqhCCWaoQOxRaLfDzfIvgY7k8brkP6HnBkVMKN6i+wXJw4oy8/hmwFhdLdm6Vsl2LoJWQmGxgNpy/XTT4lqKbLy8wjr9jZVBXYgv2w2RexIcZt7q7bUwHo0fWqwMr+9TlEjXYOkEPwXS6O8LHhIKEjhwuAyUT9LjZZF9bmyQhofrQlFHzU1GUcWF5hrQtBXHPh7tqOiZuw7BJmKIyl76A== 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:Hu2Mm/DPLCgIqW4hZrokBOsyAGXcKXp5YPLKoppXq?= =?us-ascii?Q?VKrDaG7pDveyOa4Ace/2J02CvcCU/xMujqRxQHKZyTab026io3TaRrLV5N1+?= =?us-ascii?Q?L3jelIQFNwqnv5HMFGhbITWAgQRzoXDn078f/O7yd7uK/ZpADJFhuJKC906i?= =?us-ascii?Q?uhy8t6dnXz2aO+Tn8g2MX7ufmG2ruo9IrFd1r6MnsotnbAlqtWWv6/JvXA8R?= =?us-ascii?Q?YXDTqM9A75GHgEA5I4+AAk801Q9AI5mFJ2P/6gP0ow7902g5yaXCze5Rm5aY?= =?us-ascii?Q?4ya9FdIBYa9NilmC1c61bp6kniRioNk6uCaiN3VN9K+lhhyCo1f2hn2zguE/?= =?us-ascii?Q?hpU8pTTKUpPBN6VoQrcsTSSRLIDZQ7mcyNBiYPhB/FIU6TM2mLmlBP8kiLAm?= =?us-ascii?Q?dcqeHoMN2aEFt3EJhVnc5xqzx1YyU2V/C75MXyqqirUYop1xg61E0glQqfPR?= =?us-ascii?Q?Tax9c51DcPJ3CoFE6G79/nzt4Nu+W/WbZ2koy4xm52oSzMruRg1HfrtI5Vb3?= =?us-ascii?Q?LY/7a5aKvod7G70yWgLEkegp0Z0+UZlWZiQHDcOcowaTzpP0gQdnmiAqUtL2?= =?us-ascii?Q?7yeTaJlzkRGu670RFMIegYD2HXbIJjOmmFbF8Golrfdl58V+N9m3a11IE4rQ?= =?us-ascii?Q?Jnab2ieXChfpfgV8ZIYcnzQVl2Q4dFZgo8npq9c6GncRPmf62U4C5cTKEoRm?= =?us-ascii?Q?yBjQWD1RdiEhEiYTJ0apnnNpYsBe3kUxixwTc8enntVaGj/b/AsC2KqSi5wA?= =?us-ascii?Q?4iuvRSDyfs8sDKQr0aNddP8a64ooJcUwdEp9mxjH+TE1rYcAsJUt1BtkHmnl?= =?us-ascii?Q?Z/et+IBJvdB00SbbVFO33YS1Dw07cUetBqVyULN/SeEjy4wEtlpBtVKLsX0p?= =?us-ascii?Q?VXqPilq+BzLR62b+eHnHYAgN4Trv25fkPn4K67XtSELbHPdtVYA4ujNCKEOt?= =?us-ascii?Q?QmhLbyhadv5S2UrkNJp34uEJGvUurtJFd1VGIiCuE29ig4ebzxOUfMSvnCfG?= =?us-ascii?Q?a93FIEpsC6p4VLGz5oOiAQhnWsR1bmRF/WtHiB/12MpzjtiI+iJQ4WE7wuJd?= =?us-ascii?Q?adyFJarvAdfx6f5H9pIypmsetg22YPK/Mg6RKzb80ddBzVI+LlEso0Ah29Hq?= =?us-ascii?Q?oLdv7B17cMAflc66CfPUhhLgyvkbG74jLSEZRQbNRa2KVqUdwk7xVVMe583E?= =?us-ascii?Q?9k5G6dL/jc46P0=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 6:gCflaeCKja2TPBNPUjJ7HtDVrFXtEj1IjmopPQg2CgCKAvcBHP7UlghtADuPQLuVfckJpPktgzwVwEIynTy0FtNcVGJF5n6aBMZL4jLM9cy5PvRTac175JUQdmfozATNQs5sk7jP9ULuzgFXnB8xfxJHvU30GOQSS0o6tD6ty5uKfLS4Bx3Qn2yJXij8DQGGDwuHntR8sqOFH7/kZXJxdgwuiKGilpP/kGL7xEDPnqNphammPfUEm1VeJgxqdKuqUp0BAwA79qYY0XJoButtMPPSu3zNSipJHNf6LDLfLjGHyrkcHUji82PqaCKopU+FrtquqaTzVIwUnjXf07XiBXwaHGk+NnLFUZt5NoTBft8=; 5:MmQh4vrEqRkqzqhTPlHg6XjXPcbAW8XePtvMXyNsHuukf4YU9nQRABEwfCDpdtHR08lU7HyOcWRUv/VwMRnrlHpjpUgKUAgVcn5kksaVeA/lpFWKMjhVwkDCR4+P9veTI3SO/b4+ikve3sjNImGrbf3i6PDuafPeautIrcQGzeA=; 24:WE5+5byNNj4WiNafNwBJRWeVuHo4iyYuaLc15fIjcqviz/4QjBDPuph6Q4mCWcqU/irBChfjuwZxO36heZi+yncemizqa/0OEu3M80sQAbU=; 7:001gRpFCtv/UHE5r6yA1HhIX15Y9kwAteqPlfsNH0CaEJ5TROJjxYZezJ2vp39dRot5n6gEjowko2FWlItTmbrh4bMo3i3i1PVPm7hMuq4S3v/0+pYr8JIgDU0ZsH4QuHIuLWPZtTCeQP/gKJQcXcDi86ViFYTd9aR/TyW9YUy3AegnnN2P08LIZla1cdmo3ONGavIutIZLh2e+QXvaJ4YsY9Kyzq15ax/sxPlyxpDR1qM3bSuMaQ2+gx4+iBCO0 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:25:49.9113 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6bb1972c-f89d-489c-09f3-08d54c42a75d 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 23/39] examples/qos_sched: 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:51 -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_sched/init.c | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/examples/qos_sched/init.c b/examples/qos_sched/init.c index 038f0427d..b5a9af784 100644 --- a/examples/qos_sched/init.c +++ b/examples/qos_sched/init.c @@ -84,15 +84,12 @@ const char *cfg_profile = NULL; int mp_size = NB_MBUF; struct flow_conf qos_conf[MAX_DATA_STREAMS]; -static const struct rte_eth_conf port_conf = { +static struct rte_eth_conf port_conf = { .rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN, .split_hdr_size = 0, - .header_split = 0, /**< Header Split disabled */ - .hw_ip_checksum = 0, /**< IP checksum offload disabled */ - .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, }, .txmode = { .mq_mode = ETH_DCB_NONE, @@ -104,10 +101,12 @@ app_init_port(uint16_t portid, struct rte_mempool *mp) { int ret; struct rte_eth_link link; + struct rte_eth_dev_info dev_info; struct rte_eth_rxconf rx_conf; struct rte_eth_txconf tx_conf; uint16_t rx_size; uint16_t tx_size; + struct rte_eth_conf local_port_conf = port_conf; /* check if port already initialized (multistream configuration) */ if (app_inited_port_mask & (1u << portid)) @@ -125,13 +124,17 @@ app_init_port(uint16_t portid, struct rte_mempool *mp) tx_conf.tx_thresh.wthresh = tx_thresh.wthresh; tx_conf.tx_free_thresh = 0; tx_conf.tx_rs_thresh = 0; - tx_conf.txq_flags = ETH_TXQ_FLAGS_NOMULTSEGS | ETH_TXQ_FLAGS_NOOFFLOADS; tx_conf.tx_deferred_start = 0; + tx_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; /* init port */ RTE_LOG(INFO, APP, "Initializing port %"PRIu16"... ", portid); fflush(stdout); - ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); + 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, 1, 1, &local_port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", @@ -149,6 +152,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp) /* init one RX queue */ fflush(stdout); + rx_conf.offloads = local_port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, 0, (uint16_t)ring_conf.rx_size, rte_eth_dev_socket_id(portid), &rx_conf, mp); if (ret < 0) @@ -158,6 +162,7 @@ app_init_port(uint16_t portid, struct rte_mempool *mp) /* init one TX queue */ fflush(stdout); + tx_conf.offloads = local_port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, 0, (uint16_t)ring_conf.tx_size, rte_eth_dev_socket_id(portid), &tx_conf); if (ret < 0) -- 2.12.0