From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60068.outbound.protection.outlook.com [40.107.6.68]) by dpdk.org (Postfix) with ESMTP id 25F4D1B3EA for ; Tue, 26 Dec 2017 10:24:34 +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=02Js3O35RzN/0g9mQ1qPB9krktMJBJgX2VGookc/5cY=; b=KWBdReIouAuBZHEytcHJYnhjxzmSnQSKeFy6T5BxAwFABN/rn1HOM/LmCLvTwKvg07PjvMyFUswETg+1uNWfLBVJy5leShC+3bquH/6RcU9KVE+18hXBfL9+6deaacaTNAjG+jeO9nwYGXnpmT+D7c0Q14qhTvNXWxv7iOfP8UU= 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:32 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:16 +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: 097f9fa8-afea-4070-633d-08d54c42797c 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:ixQIEF8dltOiqFK2HxPW+giX2uVFyMbSoNr09+kSadFQslsLUsGR+F/l1iebn05Wx3+Htqccei6hHqnHbDVFB/wBRcW/uL9XWvsVvI1VSpg5E7Jpz0l4Wizi11VrwgwqYF5WRGImpfGdDSQNXZGPlBaFOpCnBorLyNN1646yEZK5SPObPMaUaPWMLwpxh2pgocKMyCjSsqIhwLe5SjmQzp925xNrntBlw2NiKBzUTNW3O7aMmjyOBzmlWyc6+9Vi; 25:dcLqsbBiYZZO/s/XAzuj3qhd2nahpysZxZ58Y5FxPoeBDg+kqpMqc1W9azyEJ4zmEgZY3ix1CRpaBVJbJJNpKwe8QQE8gkXy0uFWX+lvs3Uz4xxDDHfTPz65M+1dK5y7+PIv8fXhAdk+udseA04okhv3hlQSN5zI47f33ymIOShu3xrRjJCJhHGi3KSlk8FGFGxt+IENV5h51/kKRoA9CLfEhxdL0eT9A9S+UGr+5UNoSoTlVG0hQfXaltN8ZHu+nU4SsNJwbM/jxT9whPlGkuTgnB4aoHCDsy+THJ2B9Rt4U7EQHLumG0kmmmQgRtsusPIYKlVrJaYBtkWB+R3ayQ==; 31:tD5yBYV5cczjbEAo3mSQ3hBdsIu1LQNLPeBmOPt0dLXzSBBttZ2CztOv233liSVky8N399L7qEHblCJLoODouplPWUyiqYXT9fMCcVz5svLyyJpa60PMe3Ar8/zeOY4Kf5lo5us2ya5RS+ZhYeoxO11JOFCml13P3+6kB4s51CYWUN/8y1JUKIexy7PXSIT0qd1MM7FKy38z25F5r4rR4M3uyyqjs3glc1U2YNN4coc= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:m9A+LKXDFuOwqMSH7tU4aLzU3EIAeGkge5y90wIdKGtRHJbuI/osRldShGsnHSNvtHkZNnxbuh3n8vbFjhXcRA2QADLD2C+7tDqjbDbo1rpFISCQPtWK499ITBnsk5n4f9dV/sqr4i4OApRENQImfZ75niB4d260BsqLihoR7pSpilEFEatkkMSQ+hRZtHuvth+wQX7+3iKjLsJ3l4PCv+NT4ASUk9F9f4VqH8wni2KF3hxgWAmkRbuHkrJR84yNCnMKL2KmJifhba7yKgcRbAIhR5gCg1CIxNdnGmCrDVpEq1PjUW5L6KLXt4pvKxS79uyvTFwykCY20bRfkkdXDOKB5eCczwkKVnCDI8ux1XiZ7hhTI9AtZVDSWx1bggsz7RnX7GJSlHJ4V/6/pE1fqA+SJRzBjk9w91SQNyvfqv5fYTwWH0NdZnjFrEvYcn2E7172skH1av1T3S+7XTyJHsVCgqjUTd1GU82aIZIZ/ENog0nW1zCBb/LaH6QjBzrL; 4:37ghJczHVbb1diydnOd/xziO55MShHZyX/TbbOfQnxajB9RJz0Gsss4Uo7iMOXaC2taNz48gj1mfGa4EKNa89AqqROh1kvjixzOwUuU7JTS2K3mXQWv673v3eJw0GQMa48J96FGbzEAqQket8Ns/WoZCXD+SNDWfWqQC47HGnukGfqi+TUZmGi69Kl5mrddPbpYHRQqVZ+GpjIhTrVyPeI84xE8UzDvullAyvgWnfUJ66gxHJeO4UKHIBGypvGUCCFkLU1pzzwplO3nnd93meg== 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:QD9wtk0d1S8GSpX11wpAU3mRPaWUeE0Qs9qXCTQQ+?= =?us-ascii?Q?Nb02IZA2Z99928SBd62FCdiVlkw20QOo2Vbanxe0q+wlnKtg1jc1H1KDfWRx?= =?us-ascii?Q?PI9yPf1RK1WSSNu33oqIuTfp1T7orO8CxRIaWe6STe4ZppDp9fawtCl7QvAu?= =?us-ascii?Q?UxYmSkN0raVvXpxNaqoXOQJpSlhj9kasg6bOupHFGYprd070VOZJ1Fc3PInt?= =?us-ascii?Q?V7SFJlYXRtTSlLvTNeWwmfeg259A+pa+bCxwPPRbF+VNI7q0/mMfXy8ZmeHE?= =?us-ascii?Q?Iy/Now6BBj32QSm3KTESZs9Wrxi+JgX92LlpKBvPmO7/BeULtG7opqebWB1l?= =?us-ascii?Q?5ROYIidi3BAkorMSA3ArIKrcDi2dDJmlz9WEfZXRYz+VqKYKmWzzOv61/5dR?= =?us-ascii?Q?uzqIa/QKTFxKdyRKRAfM9q5j8+hDFhQRO5zQBCrHi/AWxdC2J4fmoTp6Bx9+?= =?us-ascii?Q?AjWIY1Fr2VbMpDaykHjJPq4Z92wfZz6o+U8RNyVzGljP6xS1e7mUpgsC2VMg?= =?us-ascii?Q?3KahB/E2aa7eslUIFH/LmvhAv6EMfK3OFIC5USUDzj2tidSPq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55LLQYq0XGetapo8tvlRmwTvG0atnPpBF3qkoTvdk1NG/J7AmfT1bB6PRj+tsk7WNJUiCUwndwznKtpVmS2iwCMO7bi/qdun/EPU42OEzdvM=; 5:jIDTidmbVnH90bFPfjYaaug27rJJAU74Ms0opzjDvIX7lmfeZHoPtqjw7KolYtdyRcNbGI8sIthjACygkjrgwvacebllL6l6fsCgXwoiE3mhBDqiylUMWIpV823HBtM/Va0lPkl+6oZNJa4OZYUHy86JsaE6CsdjjA9+UvrIJ+4=; 24:6Jvy2w4UlOOmz6CS8z2T29dRGFv8CiRzxkcLGanl5ngUVwK2y7Q4QThDhudEMSpxsTfEJS23iajXZ3Xfk0Qz3m3xZD0mJePWHVG4Vcet6RQ=; 7:VbHOwipRIgqOdbLfBSvEKACBS9xXu2cEwrB6+fcv2v9RYyZovJ9jn+t9kgRRTi6DILoCbRDU8xLqCKFrTzZxrz1jVFttKOY9BxAWsD0sljGVJxRBewCAMhcAVfC5IeLnpnksv1CvNxSYjUdYooWoRRc/PJWvbdYFukG++c+gVPaGAe2NZlZRCfxXoe4J9MjlnrLK2xTjLA0A5UIBmEIzZoMoj72vKSniqWagVGbtGOpvgBlKaPhvGqDpi7MwzEc1 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:24:32.9415 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 097f9fa8-afea-4070-633d-08d54c42797c 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 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, 26 Dec 2017 09:24:34 -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 | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c index bc47dcce3..b62a0621e 100644 --- a/examples/link_status_interrupt/main.c +++ b/examples/link_status_interrupt/main.c @@ -105,14 +105,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, @@ -633,6 +630,10 @@ main(int argc, char **argv) /* Initialise each port */ for (portid = 0; portid < nb_ports; portid++) { + 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 ((lsi_enabled_port_mask & (1 << portid)) == 0) { printf("Skipping disabled port %u\n", (unsigned) portid); @@ -641,7 +642,11 @@ main(int argc, char **argv) /* init port */ printf("Initializing port %u... ", (unsigned) 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", ret, (unsigned) portid); @@ -666,9 +671,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, lsi_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d, port=%u\n", @@ -676,9 +683,12 @@ main(int argc, char **argv) /* 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 = 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", ret, (unsigned) portid); -- 2.12.0