From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60048.outbound.protection.outlook.com [40.107.6.48]) by dpdk.org (Postfix) with ESMTP id A39A51B3EA for ; Tue, 26 Dec 2017 10:24:28 +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=BL17suytSHLgy9dr/GWOOILvJW181TUL64oEQAT3s+E=; b=n9cphsJ048M2UT+Ccqrn5/y6hu1dwIW9gkQaUpkymHiIfyUsoGmwPhD8licEOCaTfgUpbnJ6W1zK+kUyQYnPvoeP1xs8GglKanikNTPfafhiLPvAWBVQ3LqNsmabHf6CkpbmPXTrcxjHgS9ALSdiMMBvkaLrNybmzgBoveodNxc= 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:27 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:11 +0200 Message-Id: <9ebd68793a7498bb4a07554f1dbc70e09efa44ce.1514280004.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: bd086cb1-4898-4355-1085-08d54c427641 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:+6mOzX7HJFQLhCadi82fYpmzND4BeAeVli22HHnSbHVGTXLDiKs+GUse2X8b124fljmI2MEqRwDSNPNUWJzHeFYebdlVz6sC5xJa36LwVsOWBN13Hf6qexgJXqqxLsJf6j6gr4nGKWOeoPigcM9ekoXk8xL4Qz2OnQORyJmgPsmLJEUArlLq8wohhE2sr/kUqalHfHRH7UaRsJDRql35TEdIeIA92nyXDeH2mMcDzs0SaR/agJKFTpGtaEU2mx0o; 25:a9q5gwjEIXMk960a9oBdDi1LB2x6f4AGCCfRGQszZBsmDodP4+7MSf99UK3CcRQPkZqI83JBuK7aU3AVe5VoeXdfVkZ8X7ybvX7oyIxP9lRqEdQeTiRu3fWFCCSD9MDnvPbLg38sQQXLgvzkaXnJgNU+p6r4kNcCKD8MMlY+iCzGYDHwFMxZDl8f5Y0u9MVYpz+gUTso5YW4nbU+BGIO2zYJKUwLMwbFpRJmWjhVWqeubqafZxYt0SX04f/iuVpI27IE+nfXN6GudqnmtoMLJt0TKTcEnYHjE7lMUABGlo4M+/n5Y/qGcIw32dqN0gog/EERL8Ua6AkepzKzCoEsPQ==; 31:WgCeWlQ0lyLuH+Q+pFWyjl6KLtX1BP98if0CVmnQfwNu9k762PDJo0ujSHpjHy9AlNCtY+gYJg16lPEp0OxdMygqPHXIzy8awfsocnxwusPThqz/JNfGWvfhjJRabiaXekz5DtZsIh/FIlFsRN8rlDhEsNxNzwHjJwlg3c7fc/L4NLC9PzjcaW2A4CnS4cUNAggQ/bB1Tu9ujdudezF6VlLMCNJohTbzyQvDddeeZ2k= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:8tNPo9EY54MA3ibqD01Z+StshgZqI8hazwNRg7NYGUMVvdqjE/q07xUneJEemirG5ZNYgVRLUwpFugvHaT+gEdeyaSMahSAXiTT9TNZZoZfBrOda2lqPw1o8lOfY1/fVY8zcHd5QcICrjfthyA677PytM5U2Ud2TIwx9lReejDz5Q5bzUQJjkARd71B9sGmMe5T3jaS6i7FdE/n6tR5+2BiO9z3/sM+0Ly5s4V+OxTvRW2ytC982gT2aEDOxgGQLiQuZRh8R2GM/qQ+nlGivaVRhxl+ygEid3HzGU7zEtNIUG8fJjQd+fDNnR/WE2kprn09hE0kuPGFTjSV4bGQuXxFMjbpuP8VzZlB9hUnAFd3cjELcg56QMl1T5jAhKHp/l6p+dBAKdrMQFTgHCcwp2nNmwW9vtINC+XpduB0xCHEfe2C+VGLrFsIMfG6re9O7Q2NvNdi6LugzdKErl0w0rsvn/Az5UVI2RI5npmFaJdVr76JlDqgenw7LeO4tPLMw; 4:+TpjrMlwygXQ0SO8r5qi26dvD1ZcvqA7IkwQNOXpcRyzKVpx/rE3/u/TD+VKAU3v3JSPhonnSDpDrCckh2LXphuEj5D9yySvDAWupAbHxnPRkggFNRsplv0+rWCz6U+IaRFyu1JSR1miEzraZLcVdqrbtFlY55B9dFQKS64z/Sin8wydlNx3isroNT7zA6f8TUNob9hP4+0i8/iAjQ9EFmh5g7SslVU199bNRrQsGpqQz4Sk+98VAcjQdsr82HY/cKOfwZ0dnDjCKd2c5Onw/798jZHMCGZ/Bx2vsFkC7ebx6pRI+scL6nZAGQqnQjaH X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(228905959029699); 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:+7HFgPw5ZnkKUJJ56mgXoUOEMO7s71CyP+97z2bX0?= =?us-ascii?Q?R3KMpvxtddmGcohXdgn5hJvwlsBdDNPJLzKK/0NjU6RP/IE2klu+ulWYG1pU?= =?us-ascii?Q?QibqWGirF0qhFF94CeNz1Rx4DyjzUja3r/xNyoeF6n70QdHXhbf8HQZy0t1L?= =?us-ascii?Q?idJzuwv6eSBfztewkYWnRnve3FxxrEsA0RhciAz4xbk6B/h/jmTorBY30be3?= =?us-ascii?Q?VV9CeCi5HzxVP3Dx6n7R3Hevtd1UHQNazyn571Y8J/wEaFPN+6m47J1meUJ9?= =?us-ascii?Q?F+T5ejZ0NuDxxXHnBxRw5mwF4icJeJgGRg/mRvq4h9ObisrmIZTnPg5SqmGO?= =?us-ascii?Q?p2ygxgrRKThhUYjaOg74FPnmEYPr6XEqfBds39ctH8d7kwDcQpEorVo5WSZd?= =?us-ascii?Q?4cjGdz9v6xCUBH1Jdsr39VA7NYj0eA5rX7GIdjJR0NiR1q8/+J3MTf4rVQ2G?= =?us-ascii?Q?X2AigCJjWluO2gRecwo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Bmkd7Z5sveKuw8AzzezZoSf85Y4MaALithqS/Dh5jedzt8cVVzJZaSmLU/w0yLxPgiM0Fsv5gKliQMt9HfpVEjs/QvvGP/hA9FtVke+iO3A8WjbOUpFcAGN/QYExej8WJWFnAoww+Z5llOqPf9nF0mXUiW3SiGhFu6fJ6Fjw+NFNysJzjFyKQw7UX9+KrCjhjWcQc4W8qGw36o=; 5:8cqk4VF/MiBi9KoBZPL93aF+p09WwlkOOFIA6cv16JJHP7jMfzhXTPYS+O+I1GGWN3yT5htEWntgb/lT4riM1OtdDU7GtD/iWzOeRaxSuk8wHLAe/WV68JOxX23OQkVMTQiNawFkP1cRK3LJ1W6cGZU4hJ72MnsIz5ZbP9ikR4Y=; 24:YzoCs4aSUnfjeaSMqRLXEO7ZsKiAh+loqNHrUJ0n/72jgoJ19Y0If4lxkwC/AgYUeFuHPy+FWr0CPJJHfL0N5WdY5AiB9s43tUWMZGxwyws=; 7:YK4GMlO/1X+NZ1VY6EvrWpARxksuCsVQuHw3eScHua9MsXcSDSODN8eysa3L9R6U1cKTlm1kyH/A340s29BvCQX1O/u5DuvPkwIlZQFytyzM4BlQAFOPTN1GCTfhlNj03u1cKmFr7jW1fdMiklDOTFq5VZUFLAqNiuqcmimFJWLbdD0Wz0CO+6V2Q3sL9GmvAKvY4JGd3/CY4EtoQ4MKw5v2kpy78fFxX2+mIvBkmBbUxhiBDI8cIAk1+lxXkCE7 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:27.5196 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd086cb1-4898-4355-1085-08d54c427641 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 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, 26 Dec 2017 09:24:28 -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 | 31 +++++++++++++++++++++---------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 5aefe0987..55fb7d942 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -169,14 +169,15 @@ static struct rte_eth_conf port_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), }, }; @@ -905,6 +906,9 @@ main(int argc, char **argv) /* initialize all ports */ for (portid = 0; portid < nb_ports; portid++) { + struct rte_eth_conf local_port_conf = port_conf; + 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); @@ -915,8 +919,9 @@ main(int argc, char **argv) /* limit the frame size to the maximum supported by NIC */ rte_eth_dev_info_get(portid, &dev_info); - port_conf.rxmode.max_rx_pkt_len = RTE_MIN( - dev_info.max_rx_pktlen, port_conf.rxmode.max_rx_pkt_len); + local_port_conf.rxmode.max_rx_pkt_len = RTE_MIN( + dev_info.max_rx_pktlen, + local_port_conf.rxmode.max_rx_pkt_len); /* get the lcore_id for this port */ while (rte_lcore_is_enabled(rx_lcore_id) == 0 || @@ -949,8 +954,11 @@ main(int argc, char **argv) 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.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, (uint16_t)n_tx_queue, - &port_conf); + &local_port_conf); if (ret < 0) { printf("\n"); rte_exit(EXIT_FAILURE, "Cannot configure device: " @@ -967,8 +975,10 @@ main(int argc, char **argv) } /* init one RX queue */ + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = local_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 +1002,8 @@ main(int argc, char **argv) fflush(stdout); txconf = &dev_info.default_txconf; - txconf->txq_flags = 0; + txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE; + txconf->offloads = local_port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, socket, txconf); if (ret < 0) { -- 2.12.0