From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0076.outbound.protection.outlook.com [104.47.2.76]) by dpdk.org (Postfix) with ESMTP id A30AD1AEEE for ; Tue, 12 Dec 2017 13:36:12 +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=N014IgNJA7j3qCLXTffLbdcCrcgeWpoE1M3GLNnY6LM=; b=jz7v2DlyWBBUToX/n/IuZRm+ww3KhXJnsyZNUxeR2e+JMytecgyKuzZf9OC5rFFUfyuvvZew9FvU0fKnR8wU1n/OIu7hZNdHAoQTY8eWBbQ+oF+cw5gENqKvZ/1oaZBfI0Pxpa63dKQLqeoDs2MJDsUngqIuql/ybbNMnXOCH34= 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.302.9; Tue, 12 Dec 2017 12:36:10 +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:35:26 +0200 Message-Id: <12987e211807bbef54672cac1c3ff8287cd6c1fd.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: HE1PR0102CA0051.eurprd01.prod.exchangelabs.com (2603:10a6:7:7d::28) To HE1PR05MB3148.eurprd05.prod.outlook.com (2603:10a6:7:36::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52d7ddb3-e0c1-49e0-148c-08d5415cecb8 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:HE1PR05MB3148; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 3:MwwLfhneGxgs0O0rPyy87YmFUVloYCCljY4z1Rch6kqdmcA/grpfkwXSXaYb5TYXLYfME/PNrlYbiUrw32R9G7csvCaGTe1s9652+T9iQa8M9iUmPwWpPSIp65hmX9aabPKar+rUkNJ+Q4Us0SAMxRz9QX3DhohuiA7nFGM6lKvj/fMj9HF+4mcfWcCtJwKn3S322qCPxmyzwzsrFU4oBxEQyDEXhW6mIoLYo9vyIAAOWs/pY8uzImnxJgj/bHzX; 25:WIJLD/s/h7cXDCcgt0ujNhEbF8WFgF+nb5kJbzi8yfrQBsox8PMCuBsyax89OZZ/4j6tAd07ZX2cWt+t18gKSwriYE/DZXrLz1vK7wu4BdmtJS8qLO2v0sBln9s3EwiEA9n0Ajssi79LFtZUH5H/PBDQGn6eOxpu22jZg9JBcT3B9//iYyMA5DvI+wfKDl2SPbwkTB0PBLNqDuAJH1aKXyc6Px2pG2HZnLQG/nghijAKDXVeeKMxQ+BqaYB6cmFFg/oNH7z+xI9fJktRlqBfhVJ+/0dWTJ8NaAnhUWe/3tzRg8WXd6/J+JD04hsNy7MEtID1zavR9LGe1Zbpy0gSiFrXh9/8gsOikdYQWAsi8C0=; 31:okkyC18rPW1eH2atY2zcjkWkV3uoBRbTaff6w32aWQ1P/BYysrDx5h2XrxiyKulme9v6RZHRhsW2kUp/39LcO2tmaaA2x9lbSL+t3166Cx6caK0FrTS29tMjMLh40BFpZy+Zxq17177MqMMvjfJOcRNfM0EMZO1Upwra4PCtPbNwXYEONv+3zoN7zAUXp33A73YI+i+IF0G7IbMW0Kb7yVfG/phqn/u8U+HhzQkdBiE= X-MS-TrafficTypeDiagnostic: HE1PR05MB3148: X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3148; 20:Pa86P6nHUxT8IBGG0MkUoaeSKk+Bt3Weh26D9gUDl646M22g8hicPyQylrybTrO+U335f7qLFxsgiP5Z5u8Kpaezkqzzt0mtCGl8Gcfy+nSJBXw2drUNvWVMdSAyDEr1Otl0O2CKiixD0HSkOvqP3Vg3KAK6L3AfXxV6/RNu6aZpjRTMCNYfAJTw0GNzcm+FE9dHdluHugUszqMoh00DXahhykj674BxJpFIxawRyH5bak8NztsRKfbvUxamueBmsf9TeNOgoRA8y9NJn6lUBGgBRO7N31XxWTDw/xQyC+Ov0XduGDAFG3xqXpxpx40OXvsGlQEf422RiTkbMHGIEtB35uidVg2hwx0bZC7IGx6HwHqk5/gPTQgBP6UhQ5CFbUXl6oW7/tV0y6IrCP0knG9u+sRsqWz0o1kD19I2CFgmzUMVelLmryrWGlyvS5/jsfKvzpT02p583+AJtaWg9PQfk15nNR4HO6N3+DijeSJxiTTEAEoo2HPGdGO0MhsS; 4:d4vhdtQ5bcEv4/McraVMlef1ARZzrCUnJ7XvCuivdUkc+4wGYc+sxxMQotab2goIgz+5A/7KRmwTpnzh/UXloLwWAwe2DUHdOQIc2k67WQoSV0zWGeJbszIz5FIzfY2/L+gZTc+4wLvumiz+rEte1+VxQqLoRUuX0r5x0+LkbJesczqnh4/Diw+ELODi/WZlB3GBZ79PhZ8JDNaUGMrAB1zYijWjGHDDVGAYsbwCaTTQjj7XcMRB4U8ZJ4HN2+sGAaTrKeWu8MFm5GJp7rfGnw== 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)(3002001)(93006095)(93001095)(10201501046)(3231023)(6055026)(6041248)(20161123560025)(20161123558100)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:HE1PR05MB3148; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR05MB3148; X-Forefront-PRVS: 051900244E X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(39860400002)(189003)(199004)(25786009)(7696005)(52116002)(305945005)(316002)(51416003)(97736004)(47776003)(2950100002)(5660300001)(66066001)(7736002)(8936002)(16586007)(68736007)(50466002)(48376002)(16526018)(55016002)(6116002)(3846002)(86362001)(105586002)(21086003)(106356001)(2906002)(53936002)(8676002)(6666003)(50226002)(81166006)(81156014)(33026002)(69596002)(76176011)(36756003)(478600001)(118296001); 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:zWl1+8AaGPvLpU4SbEkBJ9bViTwugLlyM/pZv3EbO?= =?us-ascii?Q?+Sv5d0FRPicZpCbLVIupP23mZxqakDYzgLeZCl27PC5nEvK5Y4Aw+AgstVUV?= =?us-ascii?Q?00tBW6r5m3uFQY/mUFZ9b7Q34DgekjIGk2X9wb5czB35MZ9HzEnXkjoP2sd0?= =?us-ascii?Q?cPXWwrtPFY+wJA9Uzx8sOK+2e5dpEclFmH/+JfYDOFf8jpeiFqAeyBaVRJGR?= =?us-ascii?Q?W6PI1DiUSBJRYp38+xAQHujC4gY2lcGMTJSu2Y+PLRZQ0aEdnEng0LrlG7fI?= =?us-ascii?Q?+b7q0XzJAaPGs2/yshpMo2Mg0w85qdyWUW9lTNHN+29iZNJ1xBpTF5UNlFZA?= =?us-ascii?Q?C6W+xuNmyCzO/K+lIJnKYtS0GBmmJ/v1/RKFkO+Wi2e6sJfM2k5OjLYMESVI?= =?us-ascii?Q?yy7h//v5tts3sMttTZ5bxDxOoalNUeVfLQ87E06XTJtwCeCWzR9/csp/L6y+?=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h/H3pGjL5FG/8E/Rwo+E0+Nh6fNHcmTqUUJxOEp8eaRWDe1qz+6j4LgrG6Y=; 5:HIpuNq5KTsii2GGfciJ0U8SRZUhKgg3bSIIr7a/8gwW11l/EfiStkfsvofJg3JgjC/Z1J5zUa+121lujkx/h4rVZWT30q7DxcPSKRwFpf10qgebSYLuyZkq0LIT+sx+oCYK2Qin8DHHGHjLqTPZTGPZTdotxfriDrLsuaH9kcys=; 24:oP+8mRJ5wmczcd+ez8jjkKdZIHLsDk84hCr3pnmfV15azNnPdSc2LnQ/ZUnJPoNubVd/8rwd+Z80YkLFu+LOGRw2WOTO0kxhGdo3qp5JRyA=; 7:tMjv+/00wBVAjHlUf5AOrN911vTEjf1R80JvNY9saMEetc5e5fNpv/pchwX/Emw0WeaI/5X10q8ekK1bQaSLdq1ZPsK6VqSyk3abi/bnjOOPLf9KfR/8DIoN4ORKep0XqFiIiUfxf8Wfm/n+RKYHCeAAv6A75VA46bLJ5eOJwtL9+ZL2T/wYhIOx+s7aIjd9JGa5Ctd7c7F/I6SwdyUfMF6qmx2PAXvartOLBbRwEP75+amHt8TC3j5DmMcCT4w6 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:36:10.0826 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 52d7ddb3-e0c1-49e0-148c-08d5415cecb8 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 v2 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, 12 Dec 2017 12:36:12 -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 | 31 +++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/examples/flow_classify/flow_classify.c b/examples/flow_classify/flow_classify.c index 766f1dd..0a94348 100644 --- a/examples/flow_classify/flow_classify.c +++ b/examples/flow_classify/flow_classify.c @@ -89,7 +89,13 @@ enum { 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, + }, + .txmode = { + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, + }, }; struct flow_classifier { @@ -216,10 +222,28 @@ enum { 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.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", + port, 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", + port, port_conf.txmode.offloads, + dev_info.tx_offload_capa); + } + /* Configure the Ethernet device. */ retval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf); if (retval != 0) @@ -233,10 +257,13 @@ enum { 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; } -- 1.8.3.1