From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60085.outbound.protection.outlook.com [40.107.6.85]) by dpdk.org (Postfix) with ESMTP id 556501B625 for ; Tue, 26 Dec 2017 10:24:39 +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=xnwe0SBG7GIuiuv68/TTJ5IEcExwe79pJuuQcuH04SU=; b=DuJWX36HZ76NFW2OhIcErow5V5+i5gJg7nZ50uIPZGbN/ls6fMhx6b+2tX7JNAcRIGJ6j4rzQqeZdSihzNS9w+hKJzrheAbLZuJ5FdJhYhTT24ZKRPTqFgcLV91SzMT6jq2J4R3Ac2XMwBhop3scBMHMr9t9WDkTRDD+prnq88A= 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:37 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:18 +0200 Message-Id: <601ce9db107a44e7f06f366de6613e1bb071c17e.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: 69ad51de-f5bd-4e03-7d61-08d54c427c7e 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:4NmdgzYORcz9UnT4KR4xwOQFPKx4L0lTBBE1m4okp0McgFrNofZHRYJrWMATpRjk+A8yeae9ogkWfO5octHVEge7VQoolJn+1Dm8xVCAlpm9lauV7ZjZKZ4ByC9ScUOpgVtqteG6rBFYjcog+dQuuwy9WsLCXSescz0y9iwikxZLHaypgeJgQU/dfZkR90iqM9UWKTxwJZh7LyGxiKN+xBsPxEwxe0EbiWjZfqsnXduQL+DCRgS1phRdPUddJ1CC; 25:+NltL89yDJ/NHSuxXbnhjvWrIwoa8noOtA9XGem7bqeP3ExRsHwmvSBkF8qsCn2O5UjYz91EoQ0mW1m6tzkuEbmvrhTAxHPDrWqr77wNXktOTcfuW45EDbs6HznLYAbRkQAl+3n8Sdrg+0Hae+Ddq4jAME3XXWysQwVvuTGcEYxfmNy9WxHpQ2TLB/tdRl4NLtV8oZvFAoDE+1ejSsXFHhdTJrPTSdDW3Enm5cgj4qjaTva6x8A4KN3BYEeNDrVB2bIsOX+ieOiXHENp+lRd7KfxWPDOIEK4nXdWMUCYLvSVmAJqdnLkwBQh57h90Bsc3sNEqlh/PXHVOXjm3nQr3A==; 31:+nFj965Qf7rrYFZFjRCJxymQt5oWWEoXxktVQU6fW1D2jB5XyfsIO+rfPSF6SH1yDMs/P6V44wkiKF0rnZMEplgewWfuFLea5V+6Hn8rg9zvk2Z4SEPHvUyouuZGS6xz+er5F7fEG1Wa9SRrOWjYc1J3V+QjEYjv0bQVnPE7el0GcYUiCZPXoREq8dc8IEVuMNkYqAD40MwpigasiNNxjYz4sEW+OPjhYLBmG8D4ur4= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:DUYNdmoedyU3e8gWz6NwCIgtwirVxa1fWUudtaoqrxWqyMuVAFpkEhIe4EbCbNEdtJt0mV5pr3Glsbj/03QOC4obRkCzutyjuT392l6SVnjzD5RSDItKmW9RPRI+PspSGqCC58wyqQjOBaLRNj1S59Ae8E1rp3k3B/sriWeTWK8gD7HC4rVQfMgsZF7rEdvrgRh0q0qOW+xDrer5EeEteY8WNFCft4cFQK4K+zixozi/+wWStUzoA8FUj1MTNa8FeC9sObZKSnVFzfX3EISixrpkzALzlf25oBAJBfrgGWNuLsm32eY25wEr626Zuh2YBTcA/QpbeTaQwSBy9tl9sQNoZIyZfWquCDu0QbPdZOsjozK6x6FftYdRUFHwSSuGXKOi1bu8SVYZrAzqTLYfUbBbL68vWVlhnfOyeEbRUVNeWydLg1JqACOWnq/nv3kgrULYx3vE0IcnOMZ/6WR9TPfJapvEs0oZUKfYLmal8eFjb5tz2HN7LTN9d9mKC0EE; 4:LKZiyoiE5bFVUkKiqCO0DZaK21DwyUR+TpywBLku/tGWfbKdE6usHLrhzn/MBTn/3UayQVpP9QNolMPwC8MTNZTYAuGhSNYqGyBD0zWU3Gto+Pj4+Xa4OOGe0Gq7uVAZyRa9odVdDwKqh9xTRyAZ4tn4ONZcvPJEOHcIijkX0MGZBKwZTwAHOZ7G1yzzmcg7RX9kGjBBDBv1yfA8U1lA6Bl47i4VbwTsoHsbiPl6/10PjqjAlPyBSq82yl4FmJJRLd95OmIVi0+ZuPtDUyiGgA== 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:dqG6yb2D6KU8oLq9lGFW88JmXok/RMtXLZlsE+MJl?= =?us-ascii?Q?plRd2W9l9huoaMfrw1IIoARDvEAOBCjt7YVEfm90YtsDNLR7yOCwmKgt/KwN?= =?us-ascii?Q?BwpFPGE3UmYm8OamtwJbLnLVwJdy3qnM0uiHuJre6oApuEb1ll/Y6uuU8jIC?= =?us-ascii?Q?lz1Vx+IzmhD3iSPGiAp7lUYYgC6WsEZ8/cBAoojlDqM63DSqJ2ShD4eNi9ra?= =?us-ascii?Q?d+mtwB0Eog2XZVnKeDl/7GIP/ptFvzbcuDBC994PmhL8ICn/e5MhxdjJ/rCN?= =?us-ascii?Q?k9Ud6eIjkqFhvv1iLoo8L+KMQl2u4DfCtsJDrN9sE4PWkj0s9g8ksuk6sjNk?= =?us-ascii?Q?gXaYMIYZtVBrFXoc6d2qq3M0Nvjb6kmg8tBwiQjgh7SgeiAsgnW+Kus0sEl3?= =?us-ascii?Q?SlLOZGsJguV8uecFIP/sFvR42WbPjfs+lZBanPenFkjGLuZnjj3Qs6Uv8wxr?= =?us-ascii?Q?VWMQCV0HODuzF9hvFl5ducA3A6EULsS0ou8Ta8l/V5eEBIZTNeshhJSip97o?= =?us-ascii?Q?BCyipMFyIr4ThZM+6fNJ1MoF+TNP8f+YEHvefQoDPhunh7q44uIUldi7qh+h?= =?us-ascii?Q?Eh5VowkGDTuJgK6oeeNphdz90AaYNnv56aGsCzVasTUa/kY7LtD+dMJGxtqC?= =?us-ascii?Q?dCarEngvD1zyYCeM+8pRq75/Wi0w9h85ZeWdOqUauJ6R8C2bldniwum6jbTe?= =?us-ascii?Q?KRjneaQRdFlBaXGdDSC31ciYSG8x6etLraGEbUNI214It6gL2IcLInwbUYhz?= =?us-ascii?Q?pZS+EySxBVh5PS70rxdB3FwI81tEaVL76fTn2Ld6BJf2VCm2yYtFiK8VBA4v?= =?us-ascii?Q?0KXnbqgadM7pREMRFp7nwmVO8TF69oj2NQ26ttql6EKjI7psKPH2j8HgWEXt?= =?us-ascii?Q?nWC+dMmky921+NBafvEsF7WL/soxaf+EldOjeH5JcE/N8FHiYb8VqEFXbGbq?= =?us-ascii?Q?qgwYg+b9BqFnAmBLmfab+PhJSiPnCUSLGqW2GW2p7MHScOWS8E8/ux7A0mZ+?= =?us-ascii?Q?RpU7wx/KeFw+XPJsNAjvtBTHav8MHmuvioxyEMy8oZpk73HcZHMk1y9ixoe0?= =?us-ascii?Q?m7C1bEJqVeqv2CcfM2fPNeLIsBWkhrvhIpkVhNEdeTAcqlqDnIQRL2XKxyJz?= =?us-ascii?Q?NsKADQK7UTW4QohGQKWzaSggAII+Zq3lYVxk+RZqtu+aPRa+r9+5y8VIm9bc?= =?us-ascii?Q?yFOdhhiwmtdaWI=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 6:M6wTz9y6ObSak78zEplCFZlsaVwpXrPoZRojg83+FPYdvDyxdFBiYnA7Mc/UNkyku4hslicdfPrKqxJ4MwHqBDyoHn9c0BCiy7rN7h3lfe/HkqOqTOuPbbwMjoKNYMAjMa50+20UfTvt2cZ63aj2yaraOgEads5MYKoVA3EaOsHMlT2CD6b/Gm2h8S1WJtRfckILUyd7wkiJq14cMR88b4pwHr+W6TOqJ86ijk+1IpKo4OjM5OUsiFTwrMppTb8evUCUUiNMgNglfUlaN4hB1ZxXiG1Y6u7EhvoGcwFN1iU86R3yyqlVdRXT259FIeKE22cdQ9gs3yxjeL/aTMMbHqVlS/kxqpUwW7cmoowDU9g=; 5:7DnxO0EkIKExzk86y6VPrYOQpLf4SNZFFde8U6Qmu32CirB8Qvs0/g3VGiJbMfmQtGlBdsB7vMUcrbJff6m4ontzJI9CxXXKRm+nHzDQgzaH7hULuN011aAVoPTmgeeciZdQ0rr62bjVO2fgQC5O8RwLQxsv1bCNNqeniECl+qU=; 24:hEPNhaX8Y25j1xn/zqRMHM3LVBZ9Pry/9CgfXFVgkWKQWZxJ2/qT8gOXIeonCtJv+uoQ/5qEM2o5vVHr7IBNYr3WHgOGo1PJGj48ecwWEME=; 7:5RU9MKlq1e/jaJTh4bXp1sQn/rFnOe2rPvRCd0xwlzR8MCiwAE9G4zqByfsIcMtK2iX2BU4NZrArwxfMEMdu8qhbudjUTjRuouO1enkL6pYHQFgNpmKpqM5ZUfIl798QPDPr4+ErmUC2pG5y6+eCDsRXWK25Y9RQpJHQ1BQ8zA/8gzGD51u/+0Y2oPjG39iSZuLcoqRIMbF6dQYjX79RTOiEoB0BTtUsV3rVjChDk/NsqaIOmYwgo+1KzhKCORNC SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:37.9885 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 69ad51de-f5bd-4e03-7d61-08d54c427c7e 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 19/39] examples/multi_process: 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:40 -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/multi_process/l2fwd_fork/main.c | 26 +++++++++++++++++-------- examples/multi_process/symmetric_mp/main.c | 22 ++++++++++++++------- 2 files changed, 33 insertions(+), 15 deletions(-) diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c index deace2739..673c22e63 100644 --- a/examples/multi_process/l2fwd_fork/main.c +++ b/examples/multi_process/l2fwd_fork/main.c @@ -156,11 +156,8 @@ struct cpu_aff_arg{ static const struct rte_eth_conf port_conf = { .rxmode = { .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_MQ_TX_NONE, @@ -1064,6 +1061,10 @@ main(int argc, char **argv) /* Initialise each port */ for (portid = 0; portid < nb_ports; portid++) { + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + struct rte_eth_conf local_port_conf = port_conf; + /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { printf("Skipping disabled port %u\n", (unsigned) portid); @@ -1073,7 +1074,11 @@ main(int argc, char **argv) /* init port */ printf("Initializing port %u... ", (unsigned) 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", ret, (unsigned) portid); @@ -1089,9 +1094,11 @@ main(int argc, char **argv) /* init one RX queue */ fflush(stdout); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = local_port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd, rte_eth_dev_socket_id(portid), - NULL, + &rxq_conf, l2fwd_pktmbuf_pool[portid]); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup:err=%d, port=%u\n", @@ -1099,9 +1106,12 @@ main(int argc, char **argv) /* init one TX queue on each port */ fflush(stdout); + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.tx_offloads = local_port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, 0, nb_txd, rte_eth_dev_socket_id(portid), - NULL); + &txq_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup:err=%d, port=%u\n", ret, (unsigned) portid); diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c index 6fb285c74..87dc280b8 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -207,11 +207,9 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool, .rxmode = { .mq_mode = ETH_MQ_RX_RSS, .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_CHECKSUM | + DEV_RX_OFFLOAD_CRC_STRIP), }, .rx_adv_conf = { .rss_conf = { @@ -225,6 +223,8 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool, }; const uint16_t rx_rings = num_queues, tx_rings = num_queues; struct rte_eth_dev_info info; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; int retval; uint16_t q; uint16_t nb_rxd = RX_RING_SIZE; @@ -242,6 +242,9 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool, rte_eth_dev_info_get(port, &info); info.default_rxconf.rx_drop_en = 1; + if (info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); if (retval < 0) return retval; @@ -250,19 +253,24 @@ smp_port_init(uint16_t port, struct rte_mempool *mbuf_pool, if (retval < 0) return retval; + rxq_conf = info.default_rxconf; + rxq_conf.offloads = port_conf.rxmode.offloads; for (q = 0; q < rx_rings; q ++) { retval = rte_eth_rx_queue_setup(port, q, nb_rxd, rte_eth_dev_socket_id(port), - &info.default_rxconf, + &rxq_conf, mbuf_pool); if (retval < 0) return retval; } + txq_conf = info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = port_conf.txmode.offloads; for (q = 0; q < tx_rings; q ++) { retval = rte_eth_tx_queue_setup(port, q, nb_txd, rte_eth_dev_socket_id(port), - NULL); + &txq_conf); if (retval < 0) return retval; } -- 2.12.0