From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0068.outbound.protection.outlook.com [104.47.2.68]) by dpdk.org (Postfix) with ESMTP id 180FF2B84 for ; Thu, 23 Nov 2017 13:17:10 +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=5dEIXJbC33EsEhCzze30OwufadQznk6waBOCBruR6xE=; b=m7PgroRe2kpbc7rbZEf2aQFZINIat+TTsDK844kHWc0/baPiwkGAui2zLSaiRc1LXxgIiwQKASk3z0Sff/wI3gQsE3XTXm8CvqYFG3AfF/NNcT9DpysSzQWrQXINUJMStwafDfApT3SqC8T2X/DGXvIfUCreMksyHjEOK+otbeE= Received: from mellanox.com (82.166.227.17) by HE1PR05MB3147.eurprd05.prod.outlook.com (10.170.242.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Thu, 23 Nov 2017 12:17:08 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Thu, 23 Nov 2017 14:14:14 +0200 Message-Id: <20171123121419.144132-5-shahafs@mellanox.com> X-Mailer: git-send-email 2.12.0 In-Reply-To: <20171123121419.144132-1-shahafs@mellanox.com> References: <20171123121419.144132-1-shahafs@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [82.166.227.17] X-ClientProxiedBy: VI1P18901CA0022.EURP189.PROD.OUTLOOK.COM (10.173.66.160) To HE1PR05MB3147.eurprd05.prod.outlook.com (10.170.242.145) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: c8904582-a032-4d08-d037-08d5326c1e7b X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(48565401081)(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600025)(4604075)(2017052603258); SRVR:HE1PR05MB3147; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3147; 3:SdXJtMUrCOEQp0/ANxph7Q6tgRTBrYiYeg+4NtD74SqYzUmox3G3cnMFBQD0UR+bFQHTNw7s9mzWS6Hvy+gtR5iv43RaFyyTze0XyCGkRCmWUmzAV0ayLn8K6pyEFzF286EYX3D6wccWKrGtIvL73zz1OmiJgKFlEIIShWfjb0NsgOnc5yzHgrmHVvfZiX0AYqq2ENfuwVPFy6hw1fGnmCN/b/BceEtb37mqak/uRc6M1dcP4sXGdhUgk2EtfwRI; 25:qdl+lIhjvMGrZSwKej066Bj43SHC66MBjgIi8GpnQahCcz7T4cRNjvpQxkvb+YBNnyjKjlZiUqbYGJkZs6NgOeZlYjrrqRcvlhh1FzaMNimk8tNOrmfD0aFSfVBLg+q7Yx+0Q045PpvHxS0pWKV6Xk3DDk33zD2rJVhrYZ6S7yfCi+axTS4S/HHxltevDz0ZO4LTEOEP9AdMhc1X0w+cNlgz+QVGBHDJT+nJmvyBcCeCstVr7pgEEX1e4AnOHDrP84Q/ekD9x/AbVAz1JM4xbra2WntlDbI8yc+1Cn7l7Lsx9JSq58CZagfm9IiDIClHpqBjhi0tsU++3KC9xOPPzgvtqbHgrohN4M4iFrYGdDs=; 31:OPfWWoDtxvSDklzsn+KbgH2ab9Z5yv8Sy/0f+DX2Blw8ahPZiyXajsiZyTrvF2DUnDoMTtmVPoQfnzLKsqz9wBCiHHuDIJlizN5nHjC4YNIBqyZTMKhA+t+qB5xl9cmE/jd9sqn6PON6HK6h7d3954g79vXrlNrt9fy7TYtJtrXeSZnkWg792AkbVG3aSzKlTkg//il0KGtwHBfNnoECfoEeg1qzDGRVkmyjdPqD58Q= X-MS-TrafficTypeDiagnostic: HE1PR05MB3147: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3147; 20:gssw8XjwDKwiAKLJTFIW6AU5HNX4wUEG/25R4UhOH8wKElfXkO/ac9fEB3TFGUOYvnaE4zZFsT2UFfiIHRyTphmkczcIkBTc5KSD1PnHPY6li5G+mwDOvEZxB68uLwLVxvYzFQCTjk4ChTsEQrhgYGRrTsokHbCYSfLywsR8ZdVj13vboOmAxfQO1OjlW/MOpXYkHDlDdjEFuHR8qvWyf00nHRSTR2U/alntDgOROAYm2yXl+qWfhbVrdU6kXoUn+I5UHocHQWVvwtDuoPSQxvVJrzCSrX5qvhtJMS2YoeL/YMMJ7VYTol3C4SeGNOGV3h+mfGOWfyJcvi/c4jG+/T/zLiDbR481NW5SO0ttL4/1KZY3Oy6+g/k8qJF6I7fWNdZphOGIxyqpLtdNbpAJ/OkDGrYHQ61mH8dqEs68MUIcY2pvlzpx4ZHgIrs5Xsy8H9vscpIGuZnuvivAlsr7HBeLRV/aYrJ3UNmcoyVuNtekx/0Y4pYkZbSAtJkuinwM; 4:g+kLukHYqwiU2/Y1bjlTYyIY+jCaHSnuarRypyIXHZfLshGRv70wb74sWxkcTJX4JKXWuOjPQHmLtGJ/1DRgh2EJUgs2OPKQT7HT5hTcLaxOfbPKnspdhl2KZ6nNZqK+l5lgSAHOA2ayh5FRLk8bIy70c43faCbTtzVYV0AhH+A7WfKNAw2MFlWOzoHlnnqKbPLIP4cWhYcFWWDhr557hbLLZFBh8hEfpGJ+j9NP3dUregQupvofPjFb+PF3yW8kuR6eBzGoNiFe2/e7SlPgJA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3231022)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123560025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR05MB3147; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR05MB3147; X-Forefront-PRVS: 05009853EF X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(346002)(376002)(366004)(39860400002)(189002)(199003)(106356001)(50466002)(2361001)(7736002)(105586002)(76176999)(55016002)(305945005)(2351001)(189998001)(101416001)(97736004)(2950100002)(6666003)(5660300001)(6916009)(69596002)(33646002)(50986999)(48376002)(16526018)(2906002)(47776003)(52116002)(66066001)(36756003)(21086003)(33026002)(25786009)(16586007)(316002)(81166006)(8676002)(81156014)(3846002)(6116002)(1076002)(5003940100001)(478600001)(50226002)(8936002)(68736007)(86362001)(53936002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR05MB3147; 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; HE1PR05MB3147; 23:POev8vLrAQzlECdJro+7Li7BO3rrSSJ19jnJHmPkk?= =?us-ascii?Q?ZA0asmpTGcrHH6nq6B4MotqI5yvpjTTh2+Yvr6HM1dm/TUD1Eev0whWasNlq?= =?us-ascii?Q?0BrwBEnlECW1Ix0s9sikM8jZZKf+t9tvt3fsItfmDwFE+cwEU73BvNoVCT04?= =?us-ascii?Q?dvYyOnrrDUjRAM9cjtRhczhbvLaWABGaZpRMkCCDTNpUp33HYvkzPXG2KRd0?= =?us-ascii?Q?F3lm4TTNPeOrEQ50hoQNdw85nyxw1rlV2UrvYoy0EWcZ3fvEt3pvZr6jZl7f?= =?us-ascii?Q?YDr7mUIpqD6UDLVdt+r4H0cby6hAxwLWTZ7kEPxpnj9TnKCg8bxXpVf5uPVx?= =?us-ascii?Q?nCXPMDU7EBXVVCRMs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; 6:4emuh8YK/LfoAkUI75s7Hol9SLXi6pG8nzAhNwjFbFUTKVsKBijg9AbwXdqCHFG75ElEiJCUMTt7WhW6lNx+WGRpaWAfyXkUpssGzCFniJ8nbzPKjDhn0v0VRQ1ous56Ns9NRD+cidTmbDzk2eHS+djCP+1++yIczk8IhnmNeo0N0PIQU/Cs5AvcSCq7Ye793KhGSGBhecg7yuyXrBaVxpqaTXZaQh+4cYovV32wuE3T19tHhJfJEcBNq0YsK9+/JFNmtsLp3LRsP+9yTs4R6klEn2ux5Q8/8brx3Bvm3nJe7HdnS1R6HtADWJNnB7pzv4O7wwBHC2Vx6h06AliMJVREkx0UE/kamhpx7+V7o9c=; 5:H11naHdaUV1H9kiTUFvvUJVLmMSZogTsKem01htGX9x3aKVrN61OjLFb6cO7/7nFzilrxySqRbU/qUuCzRx8Y+ev7s5PxUzpf35y6qQ5EGEVTsDsR29dQk6isEeVgZZqF1wZXBaI+F1Ua7nclo/I8O71MWbDNh2ThKo/GQEMbDI=; 24:7nHcH8hJnEYQOWOB7lmeUdfDaurmrYI7lWT8ggAv7GAYhAxMENhbX+3on6Bml2lDCMJf24h1qtAlScl6bXS++j+haquDbdnOxm2vuTgxZ7g=; 7:JWyaFOALsrUjOiDlJpfaI0sKrWlRP4L4k7bPv0FlzBz79c0U8iZLEKafQ3BnTwT/dhHYBExPuAFxx/r16eQgJRyUBYqIiuNCa/w1bov8VVATVDUFX7FsbZmh/3ElyhbwU63ZzQVbv8Cow/1nGGK+eWmKafvmK+yfJ9oZYPYye7K8xMHJG5ZP2U14le84WXFl+tZXR7Hxr1mPKRSiKmC9qyA4CbffKR0MTOicNVfQg2I0ekumsdMTVJlOsTZ8R+Bw SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2017 12:17:08.8174 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c8904582-a032-4d08-d037-08d5326c1e7b X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR05MB3147 Subject: [dpdk-dev] [PATCH 04/39] examples/l2fwd-keepalive: 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: Thu, 23 Nov 2017 12:17:10 -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/l2fwd-keepalive/main.c | 39 ++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c index 358ca5ec7..798abf792 100644 --- a/examples/l2fwd-keepalive/main.c +++ b/examples/l2fwd-keepalive/main.c @@ -107,14 +107,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, @@ -658,6 +655,10 @@ main(int argc, char **argv) /* Initialise each port */ for (portid = 0; portid < nb_ports; portid++) { + struct rte_eth_dev_info dev_info; + struct rte_eth_rxconf rxq_conf; + struct rte_eth_txconf txq_conf; + /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { printf("Skipping disabled port %u\n", portid); @@ -667,6 +668,23 @@ main(int argc, char **argv) /* init port */ printf("Initializing port %u... ", 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); + 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); + 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, @@ -684,9 +702,11 @@ main(int argc, char **argv) /* 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, l2fwd_pktmbuf_pool); if (ret < 0) rte_exit(EXIT_FAILURE, @@ -695,9 +715,12 @@ main(int argc, char **argv) /* init one TX queue 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", -- 2.12.0