From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0076.outbound.protection.outlook.com [104.47.0.76]) by dpdk.org (Postfix) with ESMTP id E68F21B20F for ; Tue, 12 Dec 2017 13:27:48 +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=PDoHxJ/NSohD5gGYp2ZYeI+X5zivxQXgY/ZbvVDtLEE=; b=Rhivn3BRoK8UvMPWNkUIoI6jcBB3nbFkFlS9GUaIwMnEi20VMoicrLR/Ll2/XPdjDImZxTfnWxKXyaNnjKJsy9yQoRRdG0jTjYDZdl0q4CWdAXa0dnxN/4Mz0FK59dJkFcfNzILHlQZgNKQHM7LGqjT/2Ee8kz35SABFon/+Hng= 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:46 +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:34 +0200 Message-Id: <087251da4e4423b097ef3727d759cc728117c4a1.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: 2d7f2faf-b65c-46f5-e4a2-08d5415bc0b3 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:6+bvyksJBSLpPHHUVKcYGC8YVKhdR5p4BCAH7VU4HSOZ4EC3Bt9oUZPS550zH/3lBTqV+if8QuvRFPFzB1OO1pqsEMcVPzKAs8tokHbMlWhMlzPbE4V13mz56Mmnkbur3ZUNZbxod/vbRx9kJBVBuLlDWYW4jZBk1/OmENsdV+DtOH0Re7/VIQP+chyryewWEMdEiZP5S0BH1n/1cOP4LsYZavXrewgXgXJw10pIeiCvp+8lEy4SBbRlJL6XL9LD; 25:4rqMENv+HANh89lRRnmfzQg2lxC2Qo6rKc4wdzDoeKtg6f62ZF4rxC6Zkj8VWysBR4GKrhTiO2wAzcWci+WO1bEH6RS1DaeO33agaCOK7kVyRXY2acUPjK/UIdfccrdrZFqdULNAVnD+mEUe6qnlHVBhvy7Ki2vulJTB2AESxqCuMKJtiCeU0aOoT6N4QrQcXvYDi2WJNu59GrX6qqozKXWw5oOZw8SJl1i7M9qFmcPcCbrauBO9qYDxyOngMY6Nez0KSZSplZH1nyGTV79HIoNIDYbRTe5EkqVUWblAXhiavy0u1kDO6sYpWNJyoXH3YhlxU9k16Fen+SBjas/x5Q==; 31:H+0KuDY5zTHLfCtKBe7Bej7wFOfYIcCGMZ25U/lABQsf5/kui4rqIDaK2A0c1ox+ryK3tA6qcEg1Sw6OO+WzNkqE6V44BwNvm6En6RwAiU3Cy3PXy9E+mgjp7lrA3uGnoZgYhTFjGHJb3Jguxo1mcmONY8Rs+/Y+kTu5RScdaTP5k3TV51p6oxELzc3fmwaW3hsQgsDpVPh0u+3v4W41+Mbi/R+GQ4CtenyJIa5ZQGE= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:NycIJO+F6RoG4j1WsdJi/qcBVGCBl9KXif4mq6wPdb7+6K64+SCQj3FxVMHs7CiAP/61pj49LLea7AG50JxDy9e0kKgtSrKkgrLbqvN/W1JXhRNsK6VOoyOYOmhxPgWgbqSDNU6ZyMvn/KXp24MkMgQn/g0Dz7pbuhVN/N7/tKqSfKHxx/9RvAcD4n5cGvtUPkOro7+5Y4h1qEIb2mJawkZdYiadMXCnlWV067oiELEtPG9EWoJj9c79Mz3cdLTep0DOU5eoUcHQywFR5ndBM4a+9EzOfEpf4uRcgn+4MDfM2dQHgn0xVSh7tJq7h7gPOL2gTqZShCjVkg5Ih1EfjcUcVjZ01I0YYncNLF3+44x23VPwsUEEvj/VvVytYKSlCxrQy3cGXd6d1Mcyq81AScL6XDFZoBLHLwD3sH7sK+tqpXditNZ9CQaYSKLrf0e1/wqrcTZJCzg2cTV5RHOnLtUH0GTl2oHQ/3N+uAiByu/KGVsqZ8FwNtX5PPDzVlsc; 4:5+0FYcVCEw9rzpK3ZWZA2DJYmMYo2uglmixWkGT0zAJynZfREasL9nfa7YOJXSDux2umNUu5IZ1NJdNKgFRKuiQSKjRcUI6DhwX0iCVg1vJEw/uFQ+Kn+1o4GzZUL/5VcBlrrrUJz8bvCxNs7As+nPFrQMoRW4wKYfh0LT3qdTvFJsjGa5WicCYMpoa1+LB5qZ+UB6KV4MhvdNX8EusCAJq6E9i9OHIRREHiCKv7FBKoOBHJpwZRiFPQtF2V5JeljCg3jkC0JQcbt6K1iKmoKg== 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:6wI/wh+DWCy7xSAVLjfUKdQHvlIJEo+44sCXu1uPL?= =?us-ascii?Q?2aEiFXrUmOTjx7cLdN0o0+gFlh45jEA9QG60AAFt8+UomR9PNsXX2oT4UGaF?= =?us-ascii?Q?jZD69oDVXu8BnK2px6mD4abS1KEAZ//1OmYqLJMyaKIXWcUeGJ95FMxJK/OH?= =?us-ascii?Q?pY6sU1SbZR+PJkmQvlarsThZkE27H5pbbh3ddxWtreiV8p0dpdReS/lsmbj2?= =?us-ascii?Q?bcBnLWlU27jPoNI2lXApjMIPc5ds6msUQBbBVcEJoo0Ng77j0p6L6RwmDOqS?= =?us-ascii?Q?NYqM+Tsg+qiFyq35A/yEt+FDG5Urcy65pTSwCiT/vWstlpa6uRY5OnTRdXir?= =?us-ascii?Q?115JDBGZpZzcMH3jXBqDGMRloUVpN5xrieYlK1HHBi2cRbDUn7dylH3moQpt?= =?us-ascii?Q?yOtKYx90j2YPqQiXyfSHHcb23i9G1smSQRI753XMTNhDyZ/P48kWaHs8ezz1?= =?us-ascii?Q?SvY4vJbLf8yF9SvHOdi8v6vqrBMiUR79MConqlP7xNQ1y72Kc3l60btdYJ0/?= =?us-ascii?Q?D3Zj5r7bFJ4fS0LvFSR5qfYba4dp0nRvMgCpfx9qNLHyM7GmHQEZQkiCwImD?= =?us-ascii?Q?MUNRjV8vCCt8Pdm06QF15ta/G5wn7uHCthyZkIo1UKIOGa6qY8funql/QlQZ?= =?us-ascii?Q?6SKOMtJuPgCjctCio/0E3cwpv8NR0HyadGVk045NmzhdTeph2w8k69marsnr?= =?us-ascii?Q?m7TPqiiOkSD1XTKXHxYPPzEOaVh8IpqcQvzpamgBDgYOmhIWSzDv1NmoQE1F?= =?us-ascii?Q?q7Uimj5dKVKLnH1Lpj1Mkp0PbtGylkssVxarXqZLjEtIRCvadljQIwJkuoUU?= =?us-ascii?Q?sCc9EJWL6ZxoNFUi3aqGn73TBPGZK8kW5tTrPWWsetmOFoE3DCWKOpVSKvGS?= =?us-ascii?Q?wpm/JmTu6U5YPdConsXgUK/mLDP5vYYsnE24HuJ/ifMzZt3hhVyfQBpQ8pZM?= =?us-ascii?Q?CN8UtMkk9hjauR8H/gETeghiA4wmD465EGoyW6wthsGlTSUS5JBO6s8++VCG?= =?us-ascii?Q?7oisGxaPQf0H4p6BjPML7uWLiFpDa39O2TGchk31Kq1z+gjAH3KjV1DDYMhI?= =?us-ascii?Q?d7xEvPFdw9V3lXhmUOK+T6QcjGQ?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 6:Ckh2p8w6PJibk4oImDBzaUncXY42aXhmwZpZRu5ixNgmtazXq7ztUTZ+WgAm1+pRRITyf7tU8r7s1gk/jb2JieyHBN3K1kTWmXC7iOW7XijRCdFI095e9+ZjmFu42wdcnl7eRL3wPziHiccCD+oCPsrKUv7YmoHITczhzmb6MAZquwAHrU/D596l3wMrfWeR1EAhRYh2jirgh9SolAZTYWkCX2d2hYX5dMsRYmgGjUONeLSd54hsJCIuJOICNsSfJIalHw7sRJGkE/fvIz5wqg1yOYtl6JLE4aGlE39+/GmXnK2kHIlBI9rQEdxcqaD82vnEKdW0R07lBQ9s4C+GoxlT0ZQR3FBwd5+bpN4StXY=; 5:IYhbixGx6cKZ0m4f5DnFZudvEeC1XYZO8zZVLz83gAq1fNNiJOKTXCYDjTDfOo3isHe17T6kAKuzETnE5Vg0uAFCV+YxRWBsugyw0hWMFgCxENm675t5AKN1prZi1ZHgi9O6Z4d77j/d1PuffJYaht2v1/yWd/teJET5VwgYRkc=; 24:07AsggQtinK2ZyA/vHO89iFLQKprjiMOMV0XbPUSg9hyGJYQxas+M+KItdcnyNG5tkeGdkphYG8m0IovO0QLFACCFufEOqaRUi+XoA9WrUs=; 7:GHitBZWBNQezQp8/A/zj/NBu1Rl26fxIaQ2VoCqJs6ElvHyjMHelRpbuYZPYGIi8ZuMto13URKPvuaOlC4i//b9lak2vt5SB9eXgz2V1HbpZ2IAh2n74IRCHUX+jMghGeGTE/XvQ8k7z3K9Mwc1kxppufZPDJu61yO8adsceXdxXVqrzPOGNRQfJ6PVB0qg2LOPJOzsb3GV0MQrW/6jtk76qsitvuQofUDfYH5ySOM85JVRvN0vhtwvBnkv6xUo+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:46.4887 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2d7f2faf-b65c-46f5-e4a2-08d5415bc0b3 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 17/39] examples/link_status_interrupt: 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:49 -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/link_status_interrupt/main.c | 37 +++++++++++++++++++++++------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index bc47dcc..e7716a3 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -105,17 +105,15 @@ struct lcore_queue_conf { 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, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, .intr_conf = { .lsc = 1, /**< lsc interrupt feature enabled */ @@ -633,6 +631,9 @@ struct lsi_port_statistics { /* Initialise each port */ for (portid = 0; portid < nb_ports; portid++) { + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + /* skip ports that are not enabled */ if ((lsi_enabled_port_mask & (1 << portid)) == 0) { printf("Skipping disabled port %u\n", (unsigned) portid); @@ -641,6 +642,21 @@ struct lsi_port_statistics { /* init port */ printf("Initializing port %u... ", (unsigned) portid); fflush(stdout); + rte_eth_dev_info_get(portid, &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", + 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, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", @@ -666,9 +682,11 @@ struct lsi_port_statistics { /* init one RX queue */ fflush(stdout); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, 0, nb_rxd, rte_eth_dev_socket_id(portid), - NULL, + &rxq_conf, lsi_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d, port=%u\n", @@ -676,9 +694,12 @@ struct lsi_port_statistics { /* init one TX queue logical core on each port */ fflush(stdout); + 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(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", ret, (unsigned) portid); -- 1.8.3.1