From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr60062.outbound.protection.outlook.com [40.107.6.62]) by dpdk.org (Postfix) with ESMTP id 2F8151B228 for ; Tue, 12 Dec 2017 13:27:54 +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=yLa/7R/xkNgTlAl9BY3STctk2UEkEoeuyq6I9vnbKaw=; b=vj7hKpBFZWsXRbHn6E6LBmQ8y6+tkbFTdBC/kZzzU2inOgHwSGOeugH2k5Z2lIyux5f2h5T2PJy6MHIA6PebHPYPlCke3QN/9heZifp07ly3Pf7ZX6C7BNYt6k8yaoMZdN2/Nq2Ch9+CuYRs+jTYZqlKztCfUBeQGib3N3+k4mQ= 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:51 +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:38 +0200 Message-Id: <23a7da133ea3d2b4c238f1aae0387cccb4d3fcee.1513081088.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: f5fdf45c-ef3e-4231-6cf7-08d5415bc3e3 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:ORPrxKR+uEtoawn4sX4y/B1djQ/rHus0VjAiJHvjuNMwPB7wkfv5zdCgxXZIEEHWuF7ObBAdcKijj82sElPfmhAWiABdxFYAAaV6/I3Y+Msq+OO2CjAqI0XeMorZoy7YXj+16dBDMHff0j7oQWqpC8Fp+mtd+oYHAGdGhjemA/6hhkMvX7/H1doM9rqtJRqqseEcjWM4g7qZRQ0+wMo0qJPYjafxqgd0EKvipZOS0TMMt9/76HMkFCmdiGfmJIbt; 25:QoCLbC8bNAp5UyQxVwdtoQLmKaImVBN9ve+0Ul5gkj6w/IX1dx5rdLsMXXBOsqLDAD56/sl3kOHfBDpRXgmaaYI1w3z0SoMUiIxeOsnDLSTdR/4bnZ3IoRpmw2yVVMm0z+DmSFKBwepWUmdX9/Ovd5IGSHuZTzmWRcp+njr6+oBdb6HA5ncY+Dqf7hTwbcIjxFRPxQj869PBzAR5P2Qcm/sWFHisuDK/RTWR02TXSDeKdWK4CqV9hgs+yj00OXo/2Xi/CV0Afy8rbNzYMSDzZ81HN+XmkC8K9MTsDqave6VEhYby97Tf0rGC5IpLHcHuPXk4s1g2klEdsE/XCV6P5g==; 31:zz9KAwy1ic01AghCc6qJOFVQABPwIg1RZORoOTOBVxVr/wsmQKE2tex3JDu8Xe06vK8Kry+Zmu2/xFZ2iaTIi2oWlY+axI7vSl4PqZZGroBbCJsIkklCwoj3TEX0tHcPIvj/8XOCSf4a1fIWEPM/EmRjfsNgIwOc0b3v+7+WOiLwgEnAclTClHkU+GOLYUCwCIs0/xxbFMK0NOnXl9k4YzZR0zsHzqHCO1UOIHfqcwI= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:6sfyZOzWd1AUty6VaL4bFihSGUGJ71EoBlSgQyR4yRjHzeS+D6FxZf5yGggxjBq13La4KsRHMNrZB5dhEWXTnS5OK8U8qn6NFUJC1PNcwgLH4X+n65tuJHwbI3H+FTNcCMZRuLBJ48DSP0c8I3DVLP4I1m55rPGgRlcOuwZ7e83eb9VRwpEkhWZzsmTxNR6uUAzASMgK9wthLL3Ta5comsKsW5jbqcZrf2oYCxLGajJpKstmi8lLN05IivB2GvvDpNDQHbCSVNMmOW33GTf8Q+5KDuo24i9w5BEMIh6bbb6QfptHOkfyt4g2lHdSLj8pYwgtDtFbbt6rXinIalRU5QIZsTCcZ87lJic2Vy4SF84v+7NowuIyv8rO/764N+YZCGzVY3ftj2kkt4UgeIpEJ/8BDcSOksv9jNheIURg3KhW+E2r99knlp/2ZE54Y+E7IGQSWklDMVXiAtBZJvT7WMQMeIPxt8Ok2p8fT49n4DHX5SzDlF50DU0T4Ep9vPv8; 4:mAjGR0+Io9qqWHpJYFtlgDk2UgWIBt+qQcBIOq+flVgw5arxTcYpvazziaByZtBAzs5UMnAp6hKXqVA8c4QyhEinr0Z0+y/844XjW+Y839jW8uzYkhwPFfSSlNGXlh3atOtJZr7xtsyAzLVKt1rfFC9CKQWcgwO3PrTPRhks4WgV/e3WDmHJdfPnXxiGBe/4RbRRI1IbP6SUc3ufvrmUiO8iONBEBxSu4+QOq1ZOP+2eMfNoUztx1C0pJD0ymfZ3P1mtUmIJ5zHD5B39xFeUkA== 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:gR1NvEMoutyWit3pqi8T+CWF+epICl+IDl15TtUfR?= =?us-ascii?Q?5SkWUzvC01kHRL03a3/U2eSwgvQnpm6dCyi4xIUOz8E7UnI/yLyHAkPLWfGr?= =?us-ascii?Q?LpyECPxXWiSTA82X3Gzues09cf7k6msO1bHAOL222gWV1jhEt/vbj4tEPdbm?= =?us-ascii?Q?wOkw5ABTS4vLNm2Q8HI93DBLQYZzXa68g95dONK43FVQwIRxdcdzNq2S4n7q?= =?us-ascii?Q?Af2MrdAxtc1HQE/ji2IO4WL4o5bwSkU3r3MVL+FY+nyK/CK3Kx4ag2MsEr/f?= =?us-ascii?Q?4T1JtcmsySG82cyZxllVAZE3FIPSzAIV1624wAEPwTy6d6VUNIF7SQdQjO1C?= =?us-ascii?Q?4e3S41teZFHNv4n54vYfeFbP1h3vrjLvF1OuARR8XuZlaJYlbZUPRm1O4f/x?= =?us-ascii?Q?KrN1mo3hGpLbHqfOUe0z3fyOhuWqkndfGrM5WS9gOvI12sbeVzHijlUFqFHv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xCH4+a7mPN3ntnGyVBv/kQv0zgo5ib/Y0e5dqerpPc52i4KYN9ZYzDVEbEsVwnFkBaZ7KDU3CwFeJ6aLv2W/osn2lTddn5+LGFnezs=; 5:L0Xsk8WHv9XeysV2G7mTe5t9XdeYj1VH54+q7oo42c2WSRt/pw9FQnP67ttqigyKX7tb2aC4ux28rJbh/EgDGctyROjmFn0BNI6X0y/kQYPsLplZKXeIhyOxe0M+8m6nmS23QLf2wTWb6kbM26Ix+nKMzTLogMA+6mw82xyA6wc=; 24:AqOw6NRKI2vMk0+v/+3Fq9Pdd1Z4zRiqUDE5MLNuFtJZwIXUUm/XDZTIbGXR4iDLkPb/DkF5trpOvPmjhIJu88OlkVBYypSS+ctpPnTDMj8=; 7:9n/ueBF8BtLX1I0I4HtZUp4zIeQQZv7e5UOdI6AM4xJ7EHzsjE8B8BStUzEV8XBeQMjCNkZobmjd2HgP09vlVXPHbgvrFspYoZMa6eUzH0MOHptL9aFKvQ3F/VPB5lvygJPZgrAlCvCOh/QgG0XsOgYSl91o/TKC64FV49EJ78yUo2hJGo3jh0W/PCkPcTnuKJ3KkJT9dFBePpIgJlBRubqbc9DKdueC5Ue3pY4aCkb4WM5nKrdZwZfl6WVE6bQN SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:51.8169 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f5fdf45c-ef3e-4231-6cf7-08d5415bc3e3 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 21/39] examples/performance-thread: 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:54 -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/performance-thread/l3fwd-thread/main.c | 41 +++++++++++++++----- 1 file changed, 31 insertions(+), 10 deletions(-) diff --git a/examples/performance-thread/l3fwd-thread/main.c b/examples/performance-thread/l3fwd-thread/main.c index fa65234..2d61f03 100644 --- a/examples/performance-thread/l3fwd-thread/main.c +++ b/examples/performance-thread/l3fwd-thread/main.c @@ -335,11 +335,9 @@ struct tx_thread_params { .mq_mode = ETH_MQ_RX_RSS, .max_rx_pkt_len = ETHER_MAX_LEN, .split_hdr_size = 0, - .header_split = 0, /**< Header Split disabled */ - .hw_ip_checksum = 1, /**< IP checksum offload enabled */ - .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_CHECKSUM | + DEV_RX_OFFLOAD_CRC_STRIP), }, .rx_adv_conf = { .rss_conf = { @@ -349,6 +347,7 @@ struct tx_thread_params { }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, }; @@ -2999,7 +2998,10 @@ static int parse_max_pkt_len(const char *pktlen) 0}; printf("jumbo frame is enabled - disabling simple TX path\n"); - port_conf.rxmode.jumbo_frame = 1; + port_conf.rxmode.offloads |= + DEV_RX_OFFLOAD_JUMBO_FRAME; + port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MULTI_SEGS; /* if no max-pkt-len set, use the default value ETHER_MAX_LEN */ if (0 == getopt_long(argc, argvopt, "", &lenopts, @@ -3567,6 +3569,21 @@ static void convert_ipv6_5tuple(struct ipv6_5tuple *key1, n_tx_queue = MAX_TX_QUEUE_PER_PORT; printf("Creating queues: nb_rxq=%d nb_txq=%u... ", nb_rx_queue, (unsigned)n_tx_queue); + 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, nb_rx_queue, (uint16_t)n_tx_queue, &port_conf); if (ret < 0) @@ -3612,10 +3629,9 @@ static void convert_ipv6_5tuple(struct ipv6_5tuple *key1, printf("txq=%u,%d,%d ", lcore_id, queueid, socketid); fflush(stdout); - rte_eth_dev_info_get(portid, &dev_info); txconf = &dev_info.default_txconf; - if (port_conf.rxmode.jumbo_frame) - txconf->txq_flags = 0; + txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE; + txconf->offloads = port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, socketid, txconf); if (ret < 0) @@ -3644,6 +3660,8 @@ static void convert_ipv6_5tuple(struct ipv6_5tuple *key1, /* init RX queues */ for (queue = 0; queue < rx_thread[i].n_rx_queue; ++queue) { + struct rte_eth_rxconf rxq_conf; + portid = rx_thread[i].rx_queue_list[queue].port_id; queueid = rx_thread[i].rx_queue_list[queue].queue_id; @@ -3655,9 +3673,12 @@ static void convert_ipv6_5tuple(struct ipv6_5tuple *key1, printf("rxq=%d,%d,%d ", portid, queueid, socketid); fflush(stdout); + rte_eth_dev_info_get(portid, &dev_info); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, socketid, - NULL, + &rxq_conf, pktmbuf_pool[socketid]); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_rx_queue_setup: err=%d, " -- 1.8.3.1