From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0079.outbound.protection.outlook.com [104.47.2.79]) by dpdk.org (Postfix) with ESMTP id 4C84D1B03F for ; Tue, 12 Dec 2017 13:27:37 +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=UpZ0A6OYuLA3dS7UfQF7KF/+4siiSXaHf0ZzIc7fWDI=; b=boE57XW4KU7Be8xwKDCQimMfZtRAPf0BFcoXsNgFa9ukHoWtjTfvFZMZYpIBECX13uEEOySbkZ+pd1tg5goXxI6egZBI0HwriV2I3Ol7e03lDF855sguDmLHvPVItYQpxl91obE7e8mYHZiU1CmcyKymcY+ys/t8J8yJVjEUEro= 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:34 +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:27 +0200 Message-Id: <27dca57f9791d197e50d12ef09d83820b176d322.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: d0907eb2-4795-4ef9-9393-08d5415bb9b0 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:6DuYziP027jPUQVx1bLmw2C3dJmTmf1Z0OPnBYX3yWi9/SkjIVpZ7fQXAXMNYWQpkv/WS9nNZKpFbxOdeVXyRAfcg+1ZHu6ScP0BHdVtFCqm1puLvpUQJdV1m7fiQd7Wqfbih4+DsyHgb4L+OW9FqiFM4jzMWdX8pGS/s+g29NTBbyoDbj4/tJSHYmMSkhegQdbKrDycLHkA4oNUmdHq873FdDGCZ8sNnEmTbx1gLnliWfXoBYbiHGQANPyx9KO6; 25:naJAF9UocZ8tqeRMZulM6FFkVDrgLTmV7Y9XbRmXobdtRWJ4UvzVo00H452EhL7JIPnMr62rCyMCaGFWsS5sGIm4/VH/hnaaKW4ydJcWITksVaVM9x0d1yiSm64eToPIk0Uid1V5ONUrTdIZSTSbIQRZ5HHkr/qRyzlcXd0lxJEkyiDS7VRGNa9NGIoYRnXqunqUiJ9WfQKC1eCRxdgEJe6OccbAqREfohixHdLE/pDF35H6e9AtM2vD/+NlIQLSOWxrWUf42NoPOGDUsfHQVoAxY9JzF/QopVTZEts84PKILgzeZ285+VfeVDhLEbt+ofNajDU01HahG0/EWdj93Q==; 31:EIjZX6b4qmXIu0WgxTmP6iaKl65C+2ztDZeFiP8jCbI3A1W9ZsS/IKD8Mjkyj+46bpeZxykvRp8mwB7oBwihss3GOYlvnawop1OcPadVHwYFisA/VVxCSoMqRna1UsdkKTO1yuoAYNkBvRIJG2G19nnMbe9qMXnA2fSmSyk5RjwZn3huU0jw/lxDVkjT3V3WqhoVL9oZqiT8s7SI0PK/EtWsF1P95rCQtthG2qN1ZWg= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:7D3Wgfxzz6so7ETHI/oz5fdZJEfhKMekIXZjyVBMOCLUmlCkaOTlj8B/1DNR9rnzMQg+PjgZqu2GIqlysZhrJ9pT7UhXmXvwhasPa0eWyztlDlhMH/mWZl0n5vt7ed/ewNUzW+WCEl2Cvdow5KWpdq4v0WslbFAnL6xdzjvUtcMooRCJx3X1rXhA4LeuVpyUCbmwly7PZ/E2bdWTJYhs9Fq0SkHlBIfL9vgkPSb3zcrqMzlh6a4zWzIBrJraju9Pc0wsxiSVQkFLpOhYqhcPEf0Dpswmt0lroyhnl17qWlisK419paoApdDz2T0OqJQMYwj9uorj/tQWJf3ZGA3JHL5QD9gLgYGDTZbujp1UupHkk/GZ9MDbl87j4Big/MSTl0L3OpTsANctfr9qwL2lL+StR9KuGkyUDuf0TGkK6yw+jxGiGpoWW+rdwhijuwaXuh6lescD3DInJvxfaaA7Bn7jh7Hf4ixJcxk6XzjNThBqtpauBpZkYEoD2QF+gVaP; 4:/LL3V0WxsCaXjFl6h/0apTNSxrSY0TZ1QnyrsOuBn/qTt47gh2KBTt15HLgV4t7yosil0klrZ73FjtFfIb2eY0G+Hvfc+1blWutXum2rh0Qv0QjiAM2HewCcXIViPg4Kv4db/kTFACR7t6o9XtE0sWFROrBOOBHeiTi9GcSOdIU9ol3x2UszJ0dBe9WVVoyTAmVS6Kuk15w+CfkMAHa1emySHg1lKNKFmoLGwbCPniib5URDjqieUpDfqWGKPTgnpmZVU7AqC95jyRxkBL74ww== 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:pjqaW4q9+ln3ZpHpL5SuJuYfMwyQrnjeWfxAQ+6sP?= =?us-ascii?Q?PKwET+fOYnHoOlgYIgIgBttj+lhW95hzOct/ZxHj3Kbp1e7/dBB+Wc2smzK4?= =?us-ascii?Q?6XOYf0QoIGWzessq1cIiOibEbMQcNf9EhbfLY68IeXnM4x7SNt3QtyEFGWQz?= =?us-ascii?Q?oJ/kKxDYsTljfWUliG7RoEfRQwvNv1VUH73XwDW/1pNGZjmNjdtLJvy2qNmJ?= =?us-ascii?Q?CyT7C2/BgjG4ZlYEyoXMISomnN1JpgjtAM49OGmJJolqfKJPPcxEtonghEbr?= =?us-ascii?Q?3E4Ez4xq8n96IZZeFi77lrBxbPvfo2KK/Porg53suWX5Xid9AQBdNQA/Zsz3?= =?us-ascii?Q?eanzcXOVilvq2JzwdJeU1KEs17ZPJ4iCNmmB3k4cfqB4QE8YgyXZckgcFCOQ?= =?us-ascii?Q?uBgSGWJZ3SrPJeuXB38WcPaX1kxNVICZthjQ0A0ahtjISUrPqA3fCl6ILw/e?= =?us-ascii?Q?8qWcJOFGbCAvR1C8aJydlmYkMdScDTzOBkF81doleWFdsJIRHiolIDUvtziX?= =?us-ascii?Q?ccdLwpfwXhSYO9j1cQrGFvDaUhBDtNcKV1g08DdiQhvJwcrL8tQX9MLQ0w8v?= =?us-ascii?Q?6gsAcAliM+ZrPMqUBgg6fKTV47FvApUhQIym09h4LpNh3S0+RdQJtjyML/sT?= =?us-ascii?Q?CE3yiBYkOwhMbdmAzIYUU/CSLE34wsYTIVVqJZ+kXsw6MVjpHBp0REtVDD2G?= =?us-ascii?Q?D1lHqFhmVvFlnlHJbqjQwR/3kx6wxetZgOVntQy35BcUGe17J+SYGMHT1jtl?= =?us-ascii?Q?i/8OtCNjnLjaQP6X4NtiyeqZruftxyYNPgw1FdtAj86c+U94POA0OzMD0acp?= =?us-ascii?Q?YCX73aIhNE8Y2MoiVyF6B/NyjSaqKljej0g7bvhRGzL5WIjwmDEUYomxtZmX?= =?us-ascii?Q?ACMW8fYvTBD5XuBm9KWYCNQCn5uhazMP2Svpg5LTGPznmBOlsodAJxbdHFNj?= =?us-ascii?Q?lt9x5MZ/LCvI2CMkYhuclM875Dneyb6Ml3XoWPAvdkV+bq7xrUE4YL4g9TdT?= =?us-ascii?Q?TQ1D7F8ZWyyopaOdG73ssqCX1owmm3NnY9FsP8ts84yfnBdk8E7HQQPVtC72?= =?us-ascii?Q?l15Bch7eoAe7SrAuV88DhjytpWa?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 6:gzVTmyxSPMYB8cqO2FpvDYPZgKePdrcOtiLT6Z2STAVeoSnQLHHEA+rNI1AAc5RRLdv5YGHWgbM6pqrYPNmS3IEl0yubLPxz3X2VAqraWtY4JGPU5W/a7rohzPCA00vr1r74niXBmxmkoJr9BbB+Syc846IhcM2PMUGekDYRcdNYRGHjtgCci5ehoczJYh2Y2UqZMegLTy/D5bwU1Ma/xZVQCOpEHJtn+lHqZOfOqUN284Cra94psNIbCJdvcpkf21k6unpROTKoOIzwKMlQbb7titSoXbZSy75aE4c5fFBCuS48N3e8NyeHbcNfDSxoUhAKrw3haDn3WWDGq1UU9lpBLZLRInPjLfbvpyqmafE=; 5:UkNqg+/XhuCcUNfYI2Ks3PNOz9CsyFQE+hMdVDAanaksGWnmHnGfvrJ+8m12B1OtRWijHVYpyIqSEo1/20B2YbRzxTRPn8iWT7rcM8EGHmv/dBUMdcArqPIfOH5aiwsnt1qz/rH/yse4JyGFnz0FEqiCFfjCj7hZmmc3vpYWddU=; 24:lQXqHTZwzjE749fvPfAk3xDwgNTxijoFNugHhSc+j8jEw+dYPvEUeJzwhJJUydyxOSnA2vG5M6nLYNdHfvqRG8MCFzGX47KC+rN48JdCy0g=; 7:tsEC0SoYzg5rho5z3AMdCywRhvTOTw6RnyGvYUGwIABpPIj+ljzsbOjw4PI2ncqh0UQq7l5VO2dUMrsW9zRIsyfDzTa7a6fHfvfv1JHEcErbyEfhSJWNwWhjNIvMBLpX70DmI9sAEi0PUCdoiYeQctokmmSq9iz8IslKnFRVPHiDRBytlNhJmdAP+8T2pSvLT7pmtTdYMJtR7/ul+2gfu3lG+j1sPoHU4kUSRDMCZhGSBPAq26HRXdo3tFLFdk+H SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:34.7229 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d0907eb2-4795-4ef9-9393-08d5415bb9b0 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 10/39] examples/exception_path: 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:37 -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/exception_path/main.c | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c index f8f5bbd..dc0546a 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -107,16 +107,14 @@ */ /* Options for configuring ethernet port */ -static const struct rte_eth_conf port_conf = { +static struct rte_eth_conf port_conf = { .rxmode = { - .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, }, }; @@ -447,10 +445,28 @@ static int tap_create(char *name) int ret; uint16_t nb_rxd = NB_RXD; uint16_t nb_txd = NB_TXD; + struct rte_eth_dev_info dev_info; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; /* Initialise device and RX/TX queues */ PRINT_INFO("Initialising port %u ...", port); fflush(stdout); + rte_eth_dev_info_get(port, &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(port, 1, 1, &port_conf); if (ret < 0) FATAL_ERROR("Could not configure port%u (%d)", port, ret); @@ -460,17 +476,22 @@ static int tap_create(char *name) FATAL_ERROR("Could not adjust number of descriptors for port%u (%d)", port, ret); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(port, 0, nb_rxd, rte_eth_dev_socket_id(port), - NULL, + &rxq_conf, pktmbuf_pool); if (ret < 0) FATAL_ERROR("Could not setup up RX queue for port%u (%d)", port, ret); + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(port, 0, nb_txd, rte_eth_dev_socket_id(port), - NULL); + &txq_conf); if (ret < 0) FATAL_ERROR("Could not setup up TX queue for port%u (%d)", port, ret); -- 1.8.3.1