From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60086.outbound.protection.outlook.com [40.107.6.86]) by dpdk.org (Postfix) with ESMTP id DEDF21B233 for ; Tue, 26 Dec 2017 10:24:19 +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=jNGnwQvQA7qIEkhTLZPaal/7xjGtX4dN3CJAZIIRpnA=; b=ny7KbF/Ai7SXU1Cn/rFCb99Os7ZB7rBTGBg3mRhGc57QU8Dcxwtc3qGfxidbQBF6CftrQMXs7rghXn46yUEYgxGipKSP+qg/EtYF49J34r2SzPid7r1h+bu/ZOWjBq6dOWhRsgiEFQ/uGJIYAqxZNudqSmp8x1yIbhg+uKkbvJI= 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:18 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:03 +0200 Message-Id: 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: 62ca932e-8d1d-4459-5f1b-08d54c4270e1 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:n1xK+aljxgEyBEhT6Gf1h8jTCf3BENYEuOU62oQBdnxUD9CWDKzRyDXcSY0E2xHjvKn3ODIdv6PgJKt5qSG4MObtLX/O4WP0K15rTcpv2LirFqNBwive2pmvTl71wFc+r/fBLSgL6tuSjncHi+IwFYVqVNhbCYv055/VEiYg+kP4TFo976TJzaDJXG5wEmmJ0m9Bg/lnoY2FfUEddXnCw3fetPh0I5M0+jJZE+q2J04QH8/DeFs6mQCotnLcABza; 25:9RPbP1B8Qzlz24S+TRrbMxmpCCEblnM7dh9qI7qfGtvlS+uWZhMBgGO3pMDMOmh+3BTiORw0tSbXO+mkWlLG0fcSCgtxNxxUgq8S+gDAKBOt7CIVnRIipGIVfyLjmfEypHBw7elFnD1b2IGu5Jp3G3YG4xxZB8SwDU95bwMkfpqzGGakYJeHquCqdB6+ZFAy8RPWPFkPE5aZLND+BblilrkB0MhhIy4i6SWh3JAgfuheBMF0bQ0UPVk2crHrsv1QszHIdd5JuAicFTKhTPXgo3tt++qqUQEZY1QSTmmFnAgty85XfWcU4YLwmexPBTdEV2tJKo8lo+ryfjRWHiPNkQ==; 31:slz4V4rYdGG/QAP1BX57ZeLc7WjqpC0bgxIToAF0xukK61un1T6yvOXFOrLdiBAPj4LCojj+fAp1y0cQVCpO+oaMB8GX/44gLbfPzH/CZx0SVHLKhGDqFRXokA3GjHMpq7vbgf46YQvgcngwyA5wc6wS6OwuQnCJ+pYRAcwVdxf91UfidEti2827Tvg3ltWSr4E2mhgbq4TlZqsS2f9Epe6OM2a+MU5YDeF/mQpLVbY= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:VPJR4R9Mp/talrKG0HE8hMJmpSJyh2S5LihkQPMHcvjmZT5N0pRDd875BN9SoeYW0tYmdR6ASCnR3EWg5rSPv5hFxRzu16SuURpFcfbT0GzFsu4EKg54HZ1WqQkUq2Cv2ZU0/+EDhvOy9vSpNxC9tawcLI57LMP8ReAClRdAczkxSAEyHnuZcBspwA8zMPjOj7lgPyn92WXc4QP77tc/JqV3+kOPmjlpVDhXxcgTh+VB6PbehEnTmAQBNMP+RzUbYqy2vVIc28m2Z345lacQvekYfNmy8JPbES6V8eKiSP3aD/G9Pkw0ij/PiXm9ksS2Fv/82Av1q0OjGrvWUvy7gawbkzihbPl7J+9EiNQjOoqunY27lwTOfTsphK6wYhuoJS36ByPICV67wgrXQS6W5q6qQoZRhkWbEaAY+lliB9YKtqXVB9mjg3URbgZU48LnheZpX1pbCBXDA5UyN8zqbTAeApPCyLniw1lU8Ls2LDnCx+oBENmV6ad14a/IKtN/; 4:tXRRVEawDXPv2h3i+72DYALuhqp9cMKJ+V5FjuKoGQNuPKjHWqMWIiJn6mbp7XhtW+S2wzPGtN1jSXqm2j8KtaVWacgG9AxHLdOHgDvOiEjQ6sppvO32hAxNU0NrACyZjly+7HCsPPkPAMx1FKy68NQxbHl0Bl2l0K1P5fER6xyOOgsc2n0K78di+XSRhGg1bjQs20wHbqgBMGPu+yUcrUV6frfk5uD47oQjhl4hQdPpCFwad188HEfwO1v69L8citE70xEGHn6quXiuiocAJA== 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:RHDN8KPLLpc/waSaqnyw0EnRuaVAZwhuYB+slFekU?= =?us-ascii?Q?FOjZo6ahmqPBupS3jIWajYtZa9VY95ra/XKj7HAg6MPBJj24jlbY58K21a8x?= =?us-ascii?Q?HDn5a4o7xnLm58C0BS+HegIm1jtfNVLozRoLyr67mvhtTof3lz7lK6XDzgzL?= =?us-ascii?Q?hRgJylm3VLxrjLu23BRxPLmSO+naDuYb9hb/WaN9nsBsw0Y4z0FEoZR4Cl/Z?= =?us-ascii?Q?GIv49BpA4CNhIpoBdoRT9hj/LFCnSydbLBsW6u8hRPO0nnAdmhXvLEa7QiWR?= =?us-ascii?Q?zh78JL4PYgCcnh7iB7pFuFq9PX/GXp+diCra9Oql9WlW4tlcRutlu1x+aUD2?= =?us-ascii?Q?PdfOWhQg8nKYuGFOHCHc3G+XJajU691QqeWvG02+inx1VV3NDr9MtvkupvzG?= =?us-ascii?Q?1G3dSb/LMmplGBeVd7Bp15gvNn20Dz3gce0JyVu+ZRQ9XSs8xHyE4yX13Qer?= =?us-ascii?Q?kn/dovbQ5NkM0MSijCdfTF2FhUo7hYV+2aHhiajOZHvAfgL8JfQ+AytG/MnA?= =?us-ascii?Q?ojsrpz+LdlzJc1JxPG3UuiOqa0VexUqfv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yHoYMNvmMtRlWt4wTmW9JUZNUrkC500yIZRZjTuKzZ9Svpc2d66V9mKkSJ/8cngPE4pGeLM/zNOBThdNllF8zBC72RC0iIvvPYJ991RiVO21RwaEZhEg=; 5:dchhvrJ/9ZTTtg4H5GoDSDH8ec9OqbkR1PWQ1M/fHNwWoP2r9LOz7deNBaSG5O34R2St9QrR2C8SVduKFCuxFuDvMdUlUpBisT11gsZmkDoMTfFbQplWrQ0JMCYrgaRhafGo2Yem8pxN/6afQKB0ICZm/U5NPqndVUWny0yzhL8=; 24:+OGZ5nADB3axO64UL9Ze00+jQwAAUxAy0CKzYVqZW6Z/jK5t/PP90771jHqnaIOl2Ux78x3E+7BWKz5YlsdFwKMHW1Ch1JGYJWblJZURGIM=; 7:Y64OOl0h2pY1Kbso9Q2sEMs262oLATz+SmMwIpN4AZ5kBcxWIMS1glrgFZnGDJEHGfu5As2RQ7I8DwfArsrpOOrbsYhEnJEqwT82H9I9eMrs/EFIZJ7ZbZ7V7i6JR30n17yDtoUoAwIcum6NkDdL0u8eEJEV2dxfN4ir6+S44LgleLz60lp9CC5ddPW/KRnH+1cY1/GTEsTZfCudHe8wun/cIyiA25WUeaxJCRFrlx354LE9KMn1VkejE58UENkH SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:18.5038 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 62ca932e-8d1d-4459-5f1b-08d54c4270e1 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 04/39] examples/l2fwd-keepalive: 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:20 -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/l2fwd-keepalive/main.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index 358ca5ec7..6decbd994 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -107,14 +107,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE]; struct rte_eth_dev_tx_buffer *tx_buffer[RTE_MAX_ETHPORTS]; -static const struct rte_eth_conf port_conf = { +static 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, @@ -658,6 +655,11 @@ main(int argc, char **argv) /* Initialise each port */ for (portid = 0; portid < nb_ports; portid++) { + struct rte_eth_dev_info dev_info; + 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", portid); @@ -667,7 +669,11 @@ main(int argc, char **argv) /* init port */ printf("Initializing port %u... ", 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", @@ -684,9 +690,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); if (ret < 0) rte_exit(EXIT_FAILURE, @@ -695,9 +703,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.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", -- 2.12.0