From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0064.outbound.protection.outlook.com [104.47.2.64]) by dpdk.org (Postfix) with ESMTP id 444191B224 for ; Tue, 12 Dec 2017 13:27: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=hn/Mdkhcr0KSvfJuRPg7cjrWNfScxzaOtVfLdwuGK2U=; b=xal7HqftOIIYiU6Ug5tQiwxX+ufwhNBTyaEkQznvwHsp29Pa2uTj5BAQmhS7U1uvX393bzNsrz0bFZJM1d1ZwvW8Yjt7MNRyMuyztrmS6DeZGZwjzjHUDYJ0gNzRWBsr4RQVG4yF/h+6UoCCjECgDf0kzFcr/R/tb8tG/nzcX+o= 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:49 +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:36 +0200 Message-Id: <6935446af7f9ca0a66534218e4e706216d8e3c8b.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: a6b32009-7348-4e50-7121-08d5415bc244 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:SjSpwUeuyL0jxJQ+NKAuAh4lM6eaNVEy60MyeYrO3jAKqnc6/GSltKlk92iyuUTboSmD4GuEWeALbGoa4QX0FsOFKxdNm+ZiphTnFOqW7Hqk06IUx1Qp+NWbQV4ep2RwauGBUD5as+KFy+Mlzrw28udeVYYmMKny+zw9qqA/ciP0DYaAov6O8Q8rMTNot+KQtcZoYQzVaO4Yu8O4g++Y2J+ZrL41WGuH7lYbYB88fFHhuzypTTl/lsfpWTxQpAt3; 25:vM6eWDXRbaXKLnrt4a7SdZQ9ClcYT7cNX6w41MD9OGA7SjzCEwSnotAXrfehEn28YVutLWJHr67Nbc7onCPzm4XxqBy1wTTVKMWfeK3tbh/Nze12WLgt94FmrgBgUe4+xPqQwWV7JGyuS2Qi6QQhH0MQhNaET+6ePzgoaubXLRMR36TiBSKQWq0GYRuGcHo/mb9nTkhesX4Ys5D/W846kfiUgk8M2aSBdNKUtb6lI3XpQ8clEdKhK8WSVzgOqGDrZ8XhVpUtdWBjSqsNH9lo3rJRMaCGml9EuFM/AuPflgbg4Pf7/jOLUYiQE3uK6W498LXOgcAjnB5d5gOSBAEH5w==; 31:mVzoPFFx/UBxh/CCa8OeYs1UTfReyxOeXX0S/xaXdiLJyF8xF0zfdvT/EmEIfXcT71TYKADi4vC2oeJQ09Afcj8GOXkCHQDCuvezUftTjj8dPb8lLs3HBIZ8TmrwPRecScQ+Q3Q4o1yxbDMYg2lw0EC4N1V4B3eFRhM9wDdZREwUHnkmVj4uNwjn4qV5yZFIuepK0P1vg4pFLyDQdfhUH9IOpBcIlwyk5XfZvPG4EL4= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:dp8gjQiBIEiLreDXVrO0PGC0Rlqf8jwJIsSNOgULsrV+0hNHJVGLBnQu4hlrTLVsu3nAI+I5oRqDr8VkqLZb2TgDS7M9kWnexEFrvcZlrXYLUVgfIxfm38WxOLwCYu82p+jSFF0RIyClTgIJT3f+1RoWdC0kcpXWEdKsDIkQ5M5pCKeD2QCaFYo1mQeJjdR2qjvzYAiifFO2ZMj3Ef5R2TthMDpZhL2uPdaWcP6NtOs+pl7DcNPChFSjjLFyWaswqeym8yh3dC2w6Mm3/XnWSRMbkrG6GLeFFn6e6IQNzo0t+vEgxS0V9KMQ6DF3Ri0OfIQkdaV5ZQCJKFZoup/aOt/C9u8ej72isL9SbWemtwVWpIrMCYp43ToBIPn3M38oVohicjiuQS7eHeVrbyzjiidB7ioJcikWscYmKVsYtdQCEGLQpF7OSLNbOYJTmhID/SHjs15qR6gZ239AKCCGHo8d3ZLi+0ElqvvGNAqMtPlaQltsnLnS1eg2QTvtq86Z; 4:OAutgIWzhU4GHtYr26KlzcO+faAubWqkAyoWQCQe+x3FslNzGOmV7j2rB3dQaCnuhRfz28SX6DO9u7sOvMl0Yx3h6obSd/lFS6MudsScnWqTlldmnp7dXXbsIUE3gs7vvmzB0LGH5DM1uf4NVXqcAhcjPOWY8tHZOFPeEet3oBdTFWFaaiQwk8JASrlhbqqKgacycbKQDu7UAoAXw0Agq701d/I4f2f9d8L5aAj/LOl/fkjdfgCrh3G7UBh/bX/wMJ/NsqI3g8Q+ZXFAq25sxQ== 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)(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:usY5zd3ayREwSfmsq2yMMHbQMSioIE1zr7w5sdD5o?= =?us-ascii?Q?f/fEqAJ9P54V6ROmi3f/otvHO3qRDE7pzluy1jgH5ZaBojbAW4bQ7AGwS+Iy?= =?us-ascii?Q?NUViulRi5Ndhd2vx/ExbhFxLFCvVla7gqAKtyKg6HqISXDNEU6fIMXnGfHKH?= =?us-ascii?Q?aCGdsMmFpMZKa6whqTVc/iIa6H/PdzAHaprAuRIa+/wsLTeZot54F6ElJDxC?= =?us-ascii?Q?JzFmWX+ljltuPc7hDs3+8Z0krk5wgyWzp5NXbvi7K3N/fGwpr+kGskpq2xvA?= =?us-ascii?Q?+pLpk9nAolygm113Ey7Z4dqOmQfDBeIeWJd/L6EZbZ2llHy2+7RaW07OvrSb?= =?us-ascii?Q?+t6AyJyFDmDxA6aYkWml1Yv9V2XVWzIwtf1V8wzXX1g5r7b+XTU+b12RWE0d?= =?us-ascii?Q?kct0QuSNje9UW6CacIhzbtoxuOFI8QRyZj2CNELyPiwi/XJN+P7fP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ah4Go22fY2Y1oqgH/qhQFbFMOysf/xnPE7RqbiY/QxehmP10Z2vh1M+2evB1TjV1NWOaB4VNPsw2ABOzPWoSZmV1hh4KHU+nigjNp67EyjgKeC/Kot4V9M=; 5:NChqXnZfZCZRUvIN0ktIHOvuFGW3NiQ7HklNrfqVytdD+XrzAIx8VReXQhcAxRwlqJ/8ujwk+GPD2kQEk3h+1FQA1AwG4nqbcsNZpN6Bfhy7qckFc7UlbOrloqM5QoLsWX1sqbGKGFFeV+s8XUhR+2JOhwyJyqtYPDx1D3vUE38=; 24:COmhi2/1A20I2a8h6kgc5ObUVQDuMgDvCYX8C4dhILYHx4nTIdUntA6dLTVYSFmvsVUllGFwbR5KKrzpTRz7JeFzfaJ6rMPudsP8WO87a08=; 7:gFlPy6QTemI6whfAaL5AJ/+arcqWQxOUOiTNzF7KcPH0t0dzCIOrQypWCcfti5vteokqfG51gBTuZv7XESeDnxx+LJ8U7Z3RCbwR/hBAgadN5uEyPxWG59Dpkzf6jx5dPkMBXS4D6DQmmh+y8lCcgprLNk3Nk5nvbkoe6MzLFAUvLh/JaQ5pd4hvksR9gB2GQkicJ5Jn2T9+axj/ec8RabhTs/h+O98Gozpk869fY4CTPv9lRm9Awn1i53UDb9DM SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:49.1137 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a6b32009-7348-4e50-7121-08d5415bc244 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 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, 12 Dec 2017 12:27:52 -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 | 35 ++++++++++++++++++++----- examples/multi_process/symmetric_mp/main.c | 34 +++++++++++++++++++----- 2 files changed, 55 insertions(+), 14 deletions(-) diff --git a/examples/multi_process/l2fwd_fork/main.c b/examples/multi_process/l2fwd_fork/main.c index deace27..3451b51 100644 --- a/examples/multi_process/l2fwd_fork/main.c +++ b/examples/multi_process/l2fwd_fork/main.c @@ -156,14 +156,12 @@ 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, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, }; @@ -1064,6 +1062,9 @@ struct l2fwd_port_statistics { /* Initialise each port */ for (portid = 0; portid < nb_ports; portid++) { + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { printf("Skipping disabled port %u\n", (unsigned) portid); @@ -1073,6 +1074,21 @@ struct l2fwd_port_statistics { /* init port */ printf("Initializing port %u... ", (unsigned) portid); fflush(stdout); + 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", + port, 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, port_conf.txmode.offloads, + dev_info.tx_offload_capa); + } ret = rte_eth_dev_configure(portid, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", @@ -1089,9 +1105,11 @@ struct l2fwd_port_statistics { /* init one RX queue */ fflush(stdout); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = 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 +1117,12 @@ struct l2fwd_port_statistics { /* 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 = 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 6fb285c..d3b9c62 100644 --- a/examples/multi_process/symmetric_mp/main.c +++ b/examples/multi_process/symmetric_mp/main.c @@ -207,11 +207,9 @@ struct port_stats{ .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 = { @@ -221,10 +219,13 @@ struct port_stats{ }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, } }; 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 +243,20 @@ struct port_stats{ rte_eth_dev_info_get(port, &info); info.default_rxconf.rx_drop_en = 1; + if ((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, port_conf.rxmode.offloads, + info.rx_offload_capa); + } + if ((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, port_conf.txmode.offloads, + info.tx_offload_capa); + } retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); if (retval < 0) return retval; @@ -250,19 +265,24 @@ struct port_stats{ 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; } -- 1.8.3.1