From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0076.outbound.protection.outlook.com [104.47.2.76]) by dpdk.org (Postfix) with ESMTP id 6DD2B1B1B9 for ; Tue, 12 Dec 2017 13:27: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=Br6vQUok8gEICRhLmx7VDglleafXoEtqvPcKUtKcUOg=; b=RzQafrbzWyrfolTuSLXSVWYIj2LZHc06lbVG0DHpFzf7VmIHI+bUpH+3G8hUtL5/NOMVljpldvRq2A93uRvtqVFeSQzP+04+tjTBIyikXqbQCOmrNdIlUekKiJfJc4DpXgibxrtDtXJS8a65RCgPjL12QzxHnjn8R9mSQhAlzkk= 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:37 +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:29 +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: ea406588-1fbd-48ac-5b57-08d5415bbb3c 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:xAbN3i8oYuryQTKvnkHWaAe3RZb/K7JR4imCEhOF6PPxOixrwhSqUurnT1Rhi7+WrLfEA/FmfLx5yY35Jo0SkI4Bom/dCluS/H4dQ/koJalgu74NeohQBkXysYpZIb/WBKlqsVJcnVOWTtv4GBOGCTFZHaphKwyYD16aUGf7OymDNJrDdzjsbBXUKucJYolCcIYVu/zrJaJ3B8WZ7a8C9QDBbYRLy5zoSzFPqFGSm4NbNWX/2jh29KeY+BTltxoR; 25:x71uTHu/cXQbXLyqRyq6IXaHjYU0S8ggrMd+oAH11SQ9d/ZSvzODlfF4/2dQ+kGG32rY746YN7L3rI1xTgq2PRGM8O/FHzlq6ukXYNsEYcH0mUTx1bdSjfODEox7JlHzO2hE07qsCRy7A/sp8mAo13kxS4W2kZW11SlSnTEYICxJmOiXwYQCjQjTKcCCvE97PYhd59NnDLWrTW/uif/yImqJ1i5b+k7qThaqWw3WeLcpuMJ8gjxOvYk3ymJjziZTUr0xdASlU10ddcHOuqdqo49MB7zzHtCAiq28ph7tOsbGlkrEI1HSjsYOfaKY+Jd16cPlrD1c73DJhMwYKNiTRg==; 31:QluJpXgwTxfU1ivKIo7U2Om/sPXwjgEg6JHaOOM0uutp/MIa+AVgdFRylbJAaGmnAhERDdT/2NY4HZHYHYN5bblUGV0w3EFsArGKiGeFc6RNpJOgyg0TWIZcIkQD5Xv8ONc3a6EKgf9c0PJiErLSxp589C5xOU50sRMd/ZKMoos7ccORhcK12XN/WB5ftkF3fbYaUyymRyxTk4EM7h3dm8QhfOwB3lcn4k769oR3GoM= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:ZNWVtHz6LtNvB8V1raa4Zcx2gMjvejtGNFSR2TV/JGxOtPM/mKSpwomncZGbv9Uq7GNUjGDIHRWqrNQ4keOvI12MDruQNo1s/aclSWQLWSR+AIQvr3aLvTNFrjvsVdkeYI0wMGodb4YEF3EF5IQFbHx24YN4yoFd+IJ7igw2p80mhMHfi/ef4AGLeXsS3MMENXyPEFwcyTKbZohwEA3G6cymEA5BvC2NB7IAEfquCK/8KX21rXpavF3P3MlW7g9jzrtadxqFXyUXD4r/tPE48sS+kmTTrA7URi7iIicclu1Nuri/stZsYpwUqKUpIOtWMdYTnEoxUmAQTA9GPxkH9uj0Q1mYNJfVIOhw2O8shwuungQsxsxvqfnD//BIVCxPVZh6OCkQ8lsbMTYbRUite1vIcmyKXZC4vZ2MrA0GjervWv9SsryFIAxREMGnLXCuD1kzH2ZPDQo2pL4BwLKTEKyoKPid+39iAqE8Darb9BZwCiS/y5K1aHppPAlPofAP; 4:p1qJOY9L8q6mdMJrZqBCmaxt0u3K5grJdcb3SScof6r2OGSGVoPj3rrXCSojn14uHf3THMzS8aCjgDSnosn34fz5HwdxzCiXTCD4dM1WdqJomdFTLmQLhve0QdFBK5IkSLoznr9L9C0mZTC3ZHN1PW//iL4oVA6c1ZDPb+oxoZHF0FFSz7DyWTlGS5TGknj7SkKHHZIk+Vc15RAWCJuK5tQjViMF2GC5BJuOQRR1QGg2YQBmk3TuetIgpcQNBBCol9RUnBCR/eWmCAiDLk5mD7xTqN3a/rqsU4Rum4+Yb6iJGDv/CRgANs7+5unWf4Nu X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); 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:3Zqxqn4Pl7trM1U722Nee3LDcpJL1CVZtK4Q/4LwC?= =?us-ascii?Q?WYvAzKcQKvcWlwBiBc0Yyi8D3XkEHSToMghLP9yqetpDC3WpvRMiHY6QKBM+?= =?us-ascii?Q?nS7bximezjSjEIGpFwk6IyrCDHnpAPUYHpJH7ExRIfxDs1TfZPYKoReoYn+6?= =?us-ascii?Q?8fonp5TmjIRnIvikE2MncM+tLyQjLRlzPEkkdrCJFdkSleBvoHYSvm3Ikw7y?= =?us-ascii?Q?ZlwHBnGmHNWw5gP8OcupDGH5iQKwLSg3gs3Lvl7ianfk7EuS4KDfD7R7Jhpd?= =?us-ascii?Q?GPKuPQGqtsBsSGljcPuJlNAS68KMw8e9iPOodUZZHb3yu5EmYfUCyQhqbCFD?= =?us-ascii?Q?6yoTHtZG/4b6doQ28kny9pQgo2K447Lz4bxaAaAZnclTx2G9rXk3ybGgwMSu?= =?us-ascii?Q?16dEBIeAKjhZbN22XTNus8NlS89NTwPltV3fyBeOFT8l5stA2UOQt4QJYU8K?= =?us-ascii?Q?HbXI6XeEQzXWnYWrHUC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u7LADarSm3wlY5RURd9OZHAFtkf/s+MBwk9PKy8c9pQgHhhHqtcs10whhnTHE2Q=; 5:aE/QJodbIRl3tOiFy/+O4mUUvtONyWSjIbadEu7CEN1BADHoiobsajCqOLg3p5UB1JhQdMxT9EJY8Slvu4bPW081ZwT6ziY/e7UtAMV3dRFkIThJB9vRBM8EgJgTwUw3Z//SBYcl79K8ZD9D8E1caZy3uDng0rbIVXGvNrMxXpE=; 24:YLWsr/awVG/kk+uIxS8Udhdx/tPdgPIOyfJkX5cvg8YwmO9jPTlneDF/K06C4Equq1cFkmV/UjFvZSKVSKMBTcFUZaEHTvsQM+GBcrxJAq0=; 7:ZIQ0e2pGsa/six2msvyY52cLfsumFCA6YrB4NWL7ZSwVkVXaXWi9bPuEK+xu1fOPwHPr4iQfa4BNYuG1Hnk65dOj7aXpHjNGu0lF99PRT7sgsjn9TYxELa0vrvBDC+irMulHT8UfzdMscy9OikMA5Qc0P8VTVjS0MfNSTWm2cwtu84e1pp3QHWOs21HNEXGN+zRBnodEU/wGP3AZLxBXCScbKyEBrgikMfe49nZekjscqW7uLCyRsRmXaeIgJ9ga SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:37.3167 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea406588-1fbd-48ac-5b57-08d5415bbb3c 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 12/39] examples/ip_fragmentation: convert to new 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:39 -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 Acked-by: Konstantin Ananyev --- examples/ip_fragmentation/main.c | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 5aefe09..1bb0563 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -169,14 +169,16 @@ struct lcore_queue_conf { .rxmode = { .max_rx_pkt_len = JUMBO_FRAME_MAX_SIZE, .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 = 1, /**< Jumbo Frame Support enabled */ - .hw_strip_crc = 1, /**< CRC stripped by hardware */ + .ignore_offload_bitfield = 1, + .offloads = (DEV_RX_OFFLOAD_CHECKSUM | + DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_CRC_STRIP), }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = (DEV_TX_OFFLOAD_IPV4_CKSUM | + DEV_TX_OFFLOAD_MULTI_SEGS | + DEV_TX_OFFLOAD_MBUF_FAST_FREE), }, }; @@ -905,6 +907,8 @@ struct rte_lpm6_config lpm6_config = { /* initialize all ports */ for (portid = 0; portid < nb_ports; portid++) { + struct rte_eth_rxconf rxq_conf; + /* skip ports that are not enabled */ if ((enabled_port_mask & (1 << portid)) == 0) { printf("Skipping disabled port %d\n", portid); @@ -949,6 +953,20 @@ struct rte_lpm6_config lpm6_config = { n_tx_queue = nb_lcores; if (n_tx_queue > MAX_TX_QUEUE_PER_PORT) n_tx_queue = MAX_TX_QUEUE_PER_PORT; + 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", + portid, 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", + portid, port_conf.txmode.offloads, + dev_info.tx_offload_capa); + } ret = rte_eth_dev_configure(portid, 1, (uint16_t)n_tx_queue, &port_conf); if (ret < 0) { @@ -967,8 +985,10 @@ struct rte_lpm6_config lpm6_config = { } /* init one RX queue */ + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd, - socket, NULL, + socket, &rxq_conf, socket_direct_pool[socket]); if (ret < 0) { printf("\n"); @@ -992,7 +1012,8 @@ struct rte_lpm6_config lpm6_config = { fflush(stdout); txconf = &dev_info.default_txconf; - txconf->txq_flags = 0; + txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE; + txconf->offloads = port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, socket, txconf); if (ret < 0) { -- 1.8.3.1