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 748D81B225 for ; Tue, 12 Dec 2017 13:27:52 +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=4+Ik+rUBeYzQ0S7T6JiKLam2XMRi2xgjXLhejLDuISo=; b=FDv4HOglzveurhkUM8jfqsXorwTVMxLbhgy+qSFbXbq6B4sa7epPkEJQIkbJfexcKOB28X0JzJnbSYyzACwhofEtmJ4D85/8pe/agHAFG61n2rrk5AB5o/zGKnOB/GtVY6YxVybF4IPTTMETpJ9HoNlUtPlUKFJhfFVtd9qGkp8= 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:50 +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:37 +0200 Message-Id: <8fd63879c7b0ab049bd361ad071904b1a9b43791.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: f4e3c9f9-ef93-4584-de76-08d5415bc313 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:or4tV0X6mF98mTf7wc4jvj78NjcCAMbfetKW/9IMNMu5Du+Bpm0VzW+msChQLU5DooO8iAR+f4pgvrNZ7iYAzuTkMR10Gm7fC6n1+Urb6I27kDkySxX2uk67u90+ktpnTv+DVMZi2R08WCR02im6/I5pxgHf8bpmYiWwUz/D6Xaw+jL7hvtjS7Psm//DdM9OJWENxnluaMTrNLTYdQimpHpYa1gjOtt4/tGoC/dz38vCtoYt84zzihVGJrUWr5GW; 25:fwWQNk1RJTel0bo9lyPG4MmEePD7gkQKsW52+jAf9uFYJlQBpP3PtxUKiz6E8v+eUZHCE/vgnDGGEUtMp2YrXoio32IDG1NxlYotojCEj49imwCXsdfQLBvUhR0BT8NtK6HgWniDmcpRw6RcoKtlkb+EqdICVFo41ERrmzVGZT1HKzACP99yMlEvHfMjRcJdELdM9cRsNtOEHMQ8NUY5GbJADqk8CP1Jh62ZlpxwAapKLz5tFeRhGfkz3rDlltQLIf///z2M0JnEHlJsDleZLf9dcwEDgpx2pm0zIr4VDZJgOibdPmpt69ePzkb0QXDah2AnUTriL/90y+c1n7Y9Lg==; 31:iTTE8Id5pFz4IFE9SUF5S6wityxdNgERI/D+/bc/iv3DrKUegwSer6QPUr8eYRaHvvdrqcfEC1YVgzvQyrQkGIVcHaVSy9de8HrjkBPDbW9orGJ/KQRAe0ImNHUdMVjuUayXx6r9rxiLNpCDdO21mrwVrkn2FJ0UlPcDgsCJydTxszfm/bb4sBcDVFtxmeCFFUX/M6cpe+uVXy7K2xFbHBGf2van+B9AtwFF3wcqjX8= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:OJPO07sgDb9uIMYEcbD4ejjl4GgJJUzuak0C3hW3q2uiCVlkhkeYaotwsWVagpgvRYAgailJ4HGEfaaAK2egvM3CA4yOSzmN8czUQwoCxIKjawbJWcv9YxThWioUgYjiplnGECagZhLeS+vXoHsrjA43iuLxpBqWV7JsDlVVOfhOsYnNV5bveAcrzBSWqc08ZpuouYYySmXgv8uS7O10QTEWxOrDxeO+q+/0cphYfjCHqiFl0mg6CvTUWBgN4psetgfoor+9sXRzjLkAlwO8k8UZcmRg0uVR+MP5vUosm9rnGZisKEe3G0Qiej66+KvsJlvSQoL89uqWkVrA+LWgkXTmWYjBsfHAaeA2lmME8eL+IhTBD2SbmExM/j2nDIM5lqx/o3oPgGYr/52ZSppQo37jTYrAiXDBLz6LU9/YvsH7ko3MUMcN0bVImPsjEFdT066lWl3b4jLHLawBjOm3OapnQFWeOwmYTesoTKppd/M93vNpPC1RBd86cMe/bJ4j; 4:7l3tpt62KZSGYZDXyLsF4OFPcRUKjfLOyIvDhmax1gqQ22CHLAlR3CMQPBIwr+tL5OnqgZo+7MRKp881j6CLVQznRPGHyZ4BLnH5ov0h/hSUhx0ChWCbEpL7fMlzaOEKLork1GdMzaVtPwRnluzHMUirjYD44kx7Ffz7whiASM/iqi4gWWyLm6hIzjgRvFOJLZsbIKuCawcffWUGIx+6fhoiPMEx7fcsFfv/rbQBGjvca0GaKnn3PfjC3+rGhaiU4DfO5mayQpAG6HeqavUJLA== 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)(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:SXFd39SQhY5lp9Dumw12yfrTZn9ZKbLrbFjJfuOLP?= =?us-ascii?Q?hQad+utVzC3oa/U+Hxg4ExX0O+feDwkRV6hhBlzd6809fNsi00n/9gBU3ylA?= =?us-ascii?Q?625EMw8grhltWRXKoKnW3wWCoaL4Y4kTP6ok5wBAa49G67iLDTFqcyhJ1pUA?= =?us-ascii?Q?78zXW1XXCf4qOnfMyEjkDkhX36RKcL53gEq6cJEGZ1BpKxzvr56TmDhFtLpc?= =?us-ascii?Q?5246vkV3ftYrr6FeplrDjkxa/XFUnb7Z5iJrQMNxX85jwTqEMti0S4aqUtCZ?= =?us-ascii?Q?U6Hrwfjif2ErQsK10Jx8+pz78gAWDt+1DWT9H5Hevgq+O4ETomUDTHlXpiKv?= =?us-ascii?Q?7HFTMmEg/K+T/1KIBSltQPcv9jiZvHR1iLM5HJ9nWOxFNaf3cKv5h6jnN0zH?= =?us-ascii?Q?FDVpKnJIihl9eIsfxnpLR2KoBp91d2G+IHBJkTt15vLkuFoCEK8kSXBYiDaR?= =?us-ascii?Q?FWQVcZ2HLfdPPrMTtSk5B61mDw9X8eXTDfDxMZX/C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b9hG8Sf71+mDOf8+mtULDeO5nljOHDYaSv2m9NRY5kFPbvJn8Xq7rWLe64jeZvZcBjcUcPm6jo7wD7JBgR9hB8+PwEJVG+N54aZF0sKLf3Bkfbuanns6XTJxdDL23JoQlgSqGEHihXU61e8ATw/DnWXDqB+t8K9Hcm5h+RgQZqQ=; 24:LJ9VjzKLjTKRKQUDmfWsMrXmoD/v98Ulf5XU6gtgUL2XEIXOd2H4taXS0ktxksYBbO88qlJwj5eb6zuG/q87PqySKIaV6CmUlVCP2bcJJvQ=; 7:yqYP3JYlKlPWpvT0WvLjAP8EVrAdD/d3QvRp7yrHv2+grJoXeqHuVZfqbuPH5PqKsIVpRz8cq9egIm09OWzRahzzdjkA8lU7WlBkp1PRnXXTMVts20JOaGYpxotEY1ucSBQhOAL5d73ec9GeUsw3X57e59EGwQGFEOiBD3HO19NrXXfxluEK6d3PUQ9KGkArb0FVozwPwBkGaKnGagOndnBAK+W+uhBViQ15lK2qau7OdQWtnBKRuMTJmL8jgL5U SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:50.4691 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f4e3c9f9-ef93-4584-de76-08d5415bc313 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 20/39] examples/netmap_compat: 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/netmap_compat/bridge/bridge.c | 8 +++----- examples/netmap_compat/lib/compat_netmap.c | 27 +++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 7 deletions(-) diff --git a/examples/netmap_compat/bridge/bridge.c b/examples/netmap_compat/bridge/bridge.c index 2f2b6ba..ec969e1 100644 --- a/examples/netmap_compat/bridge/bridge.c +++ b/examples/netmap_compat/bridge/bridge.c @@ -55,14 +55,12 @@ struct rte_eth_conf eth_conf = { .rxmode = { .split_hdr_size = 0, - .header_split = 0, - .hw_ip_checksum = 0, - .hw_vlan_filter = 0, - .jumbo_frame = 0, - .hw_strip_crc = 1, + .ignore_offload_bitfield = 1, + .offloads = DEV_RX_OFFLOAD_CRC_STRIP, }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, }; diff --git a/examples/netmap_compat/lib/compat_netmap.c b/examples/netmap_compat/lib/compat_netmap.c index 12b3fcb..f145019 100644 --- a/examples/netmap_compat/lib/compat_netmap.c +++ b/examples/netmap_compat/lib/compat_netmap.c @@ -690,6 +690,9 @@ struct netmap_state { int32_t ret; uint16_t i; uint16_t rx_slots, tx_slots; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + struct rte_eth_dev_info dev_info; if (conf == NULL || portid >= RTE_DIM(ports) || @@ -710,6 +713,21 @@ struct netmap_state { return -EINVAL; } + rte_eth_dev_info_get(portid, &dev_info); + if ((dev_info.rx_offload_capa & conf->eth_conf->rxmode.offloads) != + conf->eth_conf->rxmode.offloads) { + printf("Some Rx offloads are not supported " + "by port %d: requested 0x%lx supported 0x%lx\n", + portid, conf->eth_conf->rxmode.offloads, + dev_info.rx_offload_capa); + } + if ((dev_info.tx_offload_capa & conf->eth_conf->txmode.offloads) != + conf->eth_conf->txmode.offloads) { + printf("Some Tx offloads are not supported " + "by port %d: requested 0x%lx supported 0x%lx\n", + portid, conf->eth_conf->txmode.offloads, + dev_info.tx_offload_capa); + } ret = rte_eth_dev_configure(portid, conf->nr_rx_rings, conf->nr_tx_rings, conf->eth_conf); @@ -727,9 +745,14 @@ struct netmap_state { return ret; } + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = conf->eth_conf->rxmode.offloads; + txq_conf = dev_info.default_txconf; + txq_conf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txq_conf.offloads = conf->eth_conf->txmode.offloads; for (i = 0; i < conf->nr_tx_rings; i++) { ret = rte_eth_tx_queue_setup(portid, i, tx_slots, - conf->socket_id, NULL); + conf->socket_id, &txq_conf); if (ret < 0) { RTE_LOG(ERR, USER1, @@ -739,7 +762,7 @@ struct netmap_state { } ret = rte_eth_rx_queue_setup(portid, i, rx_slots, - conf->socket_id, NULL, conf->pool); + conf->socket_id, &rxq_conf, conf->pool); if (ret < 0) { RTE_LOG(ERR, USER1, -- 1.8.3.1