From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30058.outbound.protection.outlook.com [40.107.3.58]) by dpdk.org (Postfix) with ESMTP id 485741B625 for ; Tue, 26 Dec 2017 10:30:45 +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=m4kRxzjk63YCm781EGGk8fD/It/Y+bDtZ6RPv7DdE2c=; b=OB+K/tlY0Ht70NTU4FVcurdkvmOFhRxU75A6mlFXThpyXaKxfkb29pM1vcWPubvd3ykpNQ0I7m9E+1QFiTe4qXfkQR364keCgYCDHucFhFHCuADrLSTtUKPORqroSRHx0aT8j2QCcw8gaGr5TjxdGVFOcJYMRFCseGuWFBFIwRI= 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:30:44 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Tue, 26 Dec 2017 11:23:32 +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: 19c65c48-6413-40fd-efe7-08d54c4356c6 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:lfoBLyijBIdMpakGfbK9lPPfZWKzDEk6KASxyKCVeDT5KwraTQuGi3C+4cNOQ/6+2Qkn8raP3O4eScs1xlcE8i90xEFXM6RchjBm4KENjtnKmG8vng7Wjr+SwPos3oo5sN6m1sv20VJyQmu6Vc5Auw5yms4WPysnKtXtRuyHVkQSazIIf9eEoZ8O+t6GKFpgU2ZWhvrvwgLagOrow5IvyceSOg+0kDor62hmlJzeiYmweWnDBXSFb+TXOixkPJI4; 25:X6LL0WvH2y7iqTpz8Gu1dZatePLf6dr7f+iih2NVXByUhA1Q6AdZ87UBUI7aTMUzysyxIYvlm+Y9F9LZEGZ4TTSnteSI0XyTnvwYMENSo21sfRtsGNX4txiBUef+ieGqE4HFoMXUaDZNDSVBSTbG92FfE5LFyPVM8VWMhG4P0OiJ2yPpbOsXWN+lPb/b3BjN9dMi0qJbf0uwqumcvcFDMvyzUFtiW/YVAMsuxtGv+wqMg4ZiDW+F6GtV1rQB7i+/fhowJGMNriimiXWbEntmDm9CiXSEE+Ky0ZHT41SOdBfB/9GPVFKenjh+YQOk8qADA0i5qHd4nYPXfNopIVUvBg==; 31:SQkF94kCTFUN2nWp0xPnlQfiEE44nNsPWweSUfBbTdW7ndof1QIP6rGdDHNY9NyBl+Xf/+TjYMq8zcrLeBq6eBVG6u+hSNDUDakfnkB03Y9u4mr9JFQS1fWkFjhCPjxrIM+Pvm+bWGElTKuek0IcwMAvufrBDTDcQMPfvyhjUh+AQtizJlC/dwareEw1cSsAHYOv1UBfRoLH0FyAhWK32ScNaoM9FYX0c11a3tlk/mY= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:Zq/h7NtZhOhqd0cQyjalXNT1D8VXdX0uexJLy7Jcu3CWj8afqU/+kdc4SQuRj1mXaxHMwf0KcsW1P/k+guC7Q6ErBagcTpeZJNgO1M3kuRC7+rnSyhH24tvKR5Dor4cjqbKxHvCOAwNcKio9TIoLKUSlmRxASt937BBSAXtrNoqxYBOUnqY0YTAQb0/mlqH9xqDxRfe4glfbWdt05GZwADuQ9CpkDl3IUCAZ0BmAy+ao48mPYgOjuuYT+9lqtc2oQar/TEdtXTNr7u9KPcgsLNls7eMqHzbxbXHrReSSTuv70L0Cs8cb8aThKYyEF92LMFyLRe7T1DtpX9FLrnhndgQLx114nBVNRd9GO+H7OlYxaHvMC5MYMXUMluPirJW6jbIkdrqtO+ZVutRN2IYolDwjievq9rvSOwrPcdpd3d1uQjMQLMPzs2bKZkLBR+6kXH9Fb0oQ/jbSw5nqShg8X7CcS7f6C5odsLvdEsGp1leHLdv/zZfaHlSGrgYqGfkL; 4:7LS8T7o/q0ahG5KWvYAJ0KDe5Pz4Xff6r8wPKyNFwuKQIEOwHvZGTmzxc7z9WdVsxyEz+VUxQ9EUV+SApHsI1TO4uCkwlP6BnwSS6KNYpSGnnqqAlSFXzbcnEqrn39wYoyqfhmdlemcaJVunzMu6zejKbqCD3XkcpSz73GOUHKYC77PKwrrIVfjxdL+csKLMmMPbYYcPXXCbCft9mMOP5TWBygU77kqMua/16pXjTEasfHd9MmXUlUbRGZYtiOMa8DwPA6Cpg8Xrpy0ak0PoBw== 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)(396003)(39380400002)(376002)(346002)(366004)(39860400002)(199004)(189003)(50226002)(118296001)(47776003)(66066001)(21086003)(16526018)(5660300001)(25786009)(2906002)(97736004)(3846002)(81156014)(81166006)(6116002)(8676002)(53936002)(2950100002)(68736007)(6916009)(36756003)(386003)(575784001)(86362001)(69596002)(106356001)(16586007)(478600001)(48376002)(76176011)(51416003)(7736002)(6666003)(316002)(55016002)(105586002)(33026002)(2351001)(8936002)(50466002)(52116002)(305945005)(2361001)(7696005); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB3148; H:mellanox.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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:PqBh9BzW03l7uKodSvp10UbX4zsqVn1rmTY1AnmgN?= =?us-ascii?Q?xjqUNUhPvefyEliyAxxDxtmoKlReDxDqJsVGGPvkd1lzIg4GUBbmi2SJK4z6?= =?us-ascii?Q?7zPo0cDswLM8/5zibIQaL7YXDOR9+qsY3cbHD7Rr4V4jGGFrDZzBHrLA3k66?= =?us-ascii?Q?OzG6NCGxg4gfELaxRzm6CWMMMNY9aWt7HZVefwjU1moBXJsZYxfwx1jX50GM?= =?us-ascii?Q?cEM4IWzL95zYSYVGqKeBk4Ynhg1wghjdyBLww1Zqr93JYP5sLANbV/6VUNEh?= =?us-ascii?Q?a1evl74vRcKgZ/6zEz597pJtqAIY7RqgzKun6rlWP/NCxltsBTVCQOSCepCb?= =?us-ascii?Q?2h2Nv78jDex62c90R7GfBetFQMe+2Xr+Xh6gslNJnI90j5LGr9MGUw1UQPNb?= =?us-ascii?Q?myZWEffzcM61WulM24pQahpGKumDaOMWc4Rf95rGLGm/aLwuZ06VVJSeGQCc?= =?us-ascii?Q?yIRLjac3TAPEaVIkKDKiUdwV/hNhLrUbVSpCmYJRtw8osJv449/jHIaAbDY2?= =?us-ascii?Q?ZeJbbab+5/1ScNz7LHffaihC3rf/QfInF94S578zJbtI5liyN6eHbcSoG3jg?= =?us-ascii?Q?rsK9kvKswSzkF9RNH/BWQ3hjLEXHfmOgkTfsoqpNSN8JDSR34dxZRovt8V34?= =?us-ascii?Q?1CzZsi45KwtBMzj7aE273aP1K56C00YryBn94xKShtY67Zl6Nf++y6vn95Kd?= =?us-ascii?Q?7aWQDZDMR6E6IfDnsd6qJop+96NG1/qQ89zmj/uftRA95UsXjTCLj16AiwVN?= =?us-ascii?Q?RfC94Eh//ccvSCMLweJLmmjNvHY4la5Z8/kkTWBqQIkx+eZt63AjJV926/EA?= =?us-ascii?Q?g2oH/JmZveptqoJ5jsE/ynTpvU4sq/uI0ilHF0SGDkUqD6hpfz+abdebRqr9?= =?us-ascii?Q?7dFEd7wZilT6z6i5Z8htvysXld0Uz28n1DYK916ANCbrBLGwP7ZaV0BWjs22?= =?us-ascii?Q?CpfZtZZ6AfYIJu+VHg5ICl3Sr4h1wUFixnuDcH0RZRbMd4x3DRTEzEmZox42?= =?us-ascii?Q?KSSKCWy32Hha4rjGDTdcy1z918MhyrDoNtT1lTpWaauQ5FR+JLmvtsOdniqq?= =?us-ascii?Q?V2d53gWwlSNSIF9Fj3cuwRmFkqc5UwDdqH6m6/mgGmeSpG/V6pqQ5V9h4WXh?= =?us-ascii?Q?9crHuAJu1hDPr5CntudvNNxXIvsps1rQfRqOmqIUUmbOqqaw7cAO88ujCrFV?= =?us-ascii?Q?M+xiYciBOicJBo=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 6:OD5LK4ydRxRdnhgBWRosjFJJq0srM7DiWFJtM3uqW+TT5xeoaJDyFnnIp9Rj5I3wlpJ3F2kM3uI0eFlY/kzAlrlN85VxNNLDkO53Djs5eg4I6fCCHYKggRGb8xTQ4RKQz+2t9KcuU6eCk0ncty22hi1e/IfHXuOP+ECiWqvbKfG30dfVl856G5w7QjOel1WdpU60DSi68CprIBBggOANWGhMpyxgXQsyrjJMdGSBmaOsnM412dHhZwPRMTupSim7Uf0/Wte5YFB+FF4qKtYwEcDdvgf0bK1dsU7QkahdeclsYCYQ5olZdENzNeQ4Rn3tpIVqYYJC1myEGaXH89w4ksePodb/MDjsUWpwnLvneTw=; 5:wMWJobRY9CW856bNcxZ+JP1ApEdH8zsDCgq/ZkPmYx0bGEZTB126T5ATGjFxQCfa73oKio5TfqNZn+pF1lBItV1Mcy9zMSVTVkJm4ro/Y5d+bmjLYn2trpD5ki+yUGfvJ11nGbzjhabAAl0ZyWejCFHeTQILRHnXjtjJG52swQw=; 24:LSF7lH3k8LKtDhTEdSq5io/bPEcwiOoIUd1YVtb2O9Cje1xr7KsQMQ5bIizK1ca8KPiqlnmqjA0+ajTV73GWMXuRatK6/GhQyQJX6F/z4eM=; 7:64QfdFW2yQkukOV+7Uy8kz2+TdgWE362VO5CezOroaWOven0cR2+laErXeFBZTSyr3tlMKcsjK4E7fuOon5HQhzHbWJaV8i38F+ojI65t46p2JbeQvjOuKulEP98JaQgbJFWswtHHgnDDxa/r8SMmGWZlPKb2sZy3sYK8QA6C+fgBdHrJXks0xhqz2mo5dtPve7SOPYE5QTFImR9HDeMsMIiAloZoesJIQXMVnseQKJsdHyJRs8k4QDsejuKsUOP SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Dec 2017 09:30:44.2066 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19c65c48-6413-40fd-efe7-08d54c4356c6 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 33/39] examples/flow_classify: 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, 26 Dec 2017 09:30:45 -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/flow_classify/flow_classify.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c index 766f1dd0e..2391a80a1 100644 --- a/examples/flow_classify/flow_classify.c +++ b/examples/flow_classify/flow_classify.c @@ -89,7 +89,10 @@ static struct{ const char cb_port_delim[] = ":"; static const struct rte_eth_conf port_conf_default = { - .rxmode = { .max_rx_pkt_len = ETHER_MAX_LEN } + .rxmode = { + .max_rx_pkt_len = ETHER_MAX_LEN, + .ignore_offload_bitfield = 1, + }, }; struct flow_classifier { @@ -216,10 +219,17 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) const uint16_t rx_rings = 1, tx_rings = 1; int retval; uint16_t q; + struct rte_eth_dev_info dev_info; + struct rte_eth_txconf txconf; if (port >= rte_eth_dev_count()) return -1; + rte_eth_dev_info_get(port, &dev_info); + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) + port_conf.txmode.offloads |= + DEV_TX_OFFLOAD_MBUF_FAST_FREE; + /* Configure the Ethernet device. */ retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); if (retval != 0) @@ -233,10 +243,13 @@ port_init(uint8_t port, struct rte_mempool *mbuf_pool) return retval; } + txconf = dev_info.default_txconf; + txconf.txq_flags = ETH_TXQ_FLAGS_IGNORE; + txconf.offloads = port_conf.txmode.offloads; /* Allocate and set up 1 TX queue per Ethernet port. */ for (q = 0; q < tx_rings; q++) { retval = rte_eth_tx_queue_setup(port, q, TX_RING_SIZE, - rte_eth_dev_socket_id(port), NULL); + rte_eth_dev_socket_id(port), &txconf); if (retval < 0) return retval; } -- 2.12.0