From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0063.outbound.protection.outlook.com [104.47.2.63]) by dpdk.org (Postfix) with ESMTP id 52B9028F3 for ; Thu, 23 Nov 2017 13:17:07 +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=U0MsvOBjkfjQfVDj6hf8DfYJ423sGmMf6yGm4UBbsbs=; b=tU9Nm3JZGj//ShAU0MSNvYV0Ut1epobEQujt3bfPncktfPzSDp0ktcPPkJ4J5YHeHGqYAGp8pczzoa1Cq7e389A8vE4PjFMLLGyOfYu/LGxB47dfwHybwydLxSIMtzmIcIaGgSHu7zHSzU+fbWA4awJMbiP5CUvkURi5glMes3o= 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:06 +0000 From: Shahaf Shuler To: dev@dpdk.org Date: Thu, 23 Nov 2017 14:14:11 +0200 Message-Id: <20171123121419.144132-2-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: 2fe890b8-e34b-4bc6-bae2-08d5326c1ce1 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:gfSdDp5Q6BbF5M7sDlMxVr7te8qDyJCTRwIBajGLRlJZzoMkp/0lELj9gTMSew9B2R/0TwU+rI2l1Fg4uVjzjUrF15av4rhEU34gGN8ENA92nBtHLtFLiFjUXbPYef+GoJff/HiCCwdZjzCnzuHsLphqS3tF06SrgM3Xdntiq4qj8r7IxvK5MDFLienRCqLfQolNCi2nssSyCkaNjkMt9NHsi29BnkJmRsZwkP+EOnJ5C9seCTQQRuyrWkMlmPgt; 25:l5QskmiWgR8kDVHhihagvciGkAsaYEOHtLYX++Fs6QH/OWVdhYi0gMyNGUIjGuLvyJ4Zs3a18YKQgm69Sw0/3xMoTpV09CJ6wScSeeZQtpt7lm9nofz/DwoCY488ZrdSbGb04OsFJfruTwZQbmg2MLlSBw++qD70CijnhOiW+g6uSqcnLO3lu9esl+wkgIT4s67GV0ftdbf3xv3SLxxBMILISSnAMKsBQhL0F6QXHRTLwhucKTXWhOR/uw/PpEbNv1/DyjA2nTPHuL4KetQIQV1NMKYk4bTwLmj197owHMdNpLcyuGskP3LGaiP3UmExTCftGjGZE4S/iiOOzkePoij70QU6i7pDSAKfQj1k5H8=; 31:m69ofFebv+2wa+Hf0s5bZtEgaFCHY9Btkz/ZDgYvAUT4CgBEOcyFff95rGbWlCqcHCzDo3+S4JqbLtAGxognpLyA710E07lI+7r0fydWEemcZ9UELcQOv4b/9sEx8eDJ2o8lU2ff+TNsRwNU0LEAr/om4VVHoFr2pReaRxwmd/iU8P4e61UvRK0nXHIh+SivIJI1mIkj+VsZPa/PtCiTdwur2/20sfS1zPQ0iiAIX3c= X-MS-TrafficTypeDiagnostic: HE1PR05MB3147: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; X-Microsoft-Exchange-Diagnostics: 1; HE1PR05MB3147; 20:fom2R/RNhwa56BsGTo2jl0rNc+PQ+tR6USz1vuzh4mC9FAQtChnsBS801ryVuERoE8qF32T9yrPF75ESxBtRbbrnGwXQoSCIiaN5+9o/McV5tvL+m/VcoJzkSoG5z0ZJ8bb03XnqdAW6yx1V2ZXMtFQ074z2pKw109lMBkQhxcx8qWuRmuM/4uAgAJcWqca84hn8zzpeL1X7nbOyCUiuVoV1U0eM0RafuKe/JGJtE+1fOQ187s6EMPA3sd1w6qLqifDhQjcTKSUnmv71hPIOaLJWG4izxMrcgD/qIAoWhXnRLGdonJgD9u93oQT+f6guHq4RmN0/TATm01u3WMiqx93xOXo+kx+swy+ShNacVpOUQGn1Xy+FS2ZRrpm695kJGsLY0JdC7PLjhSFAT5+H8G0hgKXmDWk2ZqdiEjvKChlVPNdFGLa6pJlVbKmzFol3duzatkuEwYl7ZdK8z5WmB5dQV2dL7TK3F2Z+6fmN8UdXdrk74mcOZOmTZeS6MZXE; 4:9qy+/BIesvQsMEzhf2lOTK9viN5FeZBipwCB5GsX+RVwn+hnX4Ljavtp1ESlFaJpRwtlu6uWdFiiMZOmfRDkZd3bCPVIUXx2DRxhLgn49+ghyEzMPWF+ZN1bf4CLHZm/MxnJwan8NA7x4LwyNmQ0mOnnUsVABf00hg6HIWjUrz+n9t96nExDt6FjZoPeIOjdsIOWst2Ed/Dwp4AnW6yKD97UtozjqkcGbrPx+T8oaCDkDxScBQVrR3eICpy/ZMvZji7xn1sc3ZiQ24bbVb9jTQ== 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:IJ1wZJJZS3TuHSFoOwwXwqxEStnAM8reNY0eksFFA?= =?us-ascii?Q?YIYzSdK++NQrKNQH2EPWVRs/a/Hr8aNYDQ/4BIiVv5bVBakynsMPTlomgEvj?= =?us-ascii?Q?/Es5VOSmQypzUOOvwzXwKjZPovl7XuBX5IaVzujwl+mJgwWLwhXH/hknAIYL?= =?us-ascii?Q?S6qzM4M477tk1sanHkgm9Rr5JtCRxVDZ0BRfNWLD0+3jMyZiJGoQrneRE3WH?= =?us-ascii?Q?7cyzhl7QWrL5nB5PGAyzoVo1Z6SSeVc5PWRHk2DvkVpjimypdMgc7hcYCcOu?= =?us-ascii?Q?RtXwb5q6z14i1hE+vNmIcnsfn9DJclAUKfkUWssTaaxLOnL5lHqnnvOK0fXR?= =?us-ascii?Q?xuES1bkbSNmSCHYPoPwISl83wpT0e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60XmyhqsIPKgJk6SjmILKh0T4A4vE7AyY+l3tGzuogcb/1aHsEdpQ6cyg9lVwin+aAlGvNzRxQOOkBSmUILkgVdR9iWTEndy2g4FysppAYH+RpZfZQjBSz4OHDuFZsIwAVF64BC4k/yTWLtd3ECcto6qRGQ5/+TMQMMyptwHZy9NxzPbZ/33t8L0wRnwna+fjMA8yrku9HeBPHxRVY1nxd5eyc1UEwBzbDulEhsBzNiPuxagI0Ih+zKz6vBl6Hx+CzxwQO554UQhtVlrCXdT9mjrFOjBGW0R5KudS/ua4jcYNsmxyPBfSiJSGvM7EOC3lKNBqJLnmao01aq7Iwk/6GWHEa7ADh3mzwGplby9leg=; 5:/XzwgRZ6trjUPkkB2tu6cT8CnzNmoexn5NfAcyY95OVrQre6hq6XVB1rhqcLLyIj6qD5b0ToJmYgU5grHWdOWSMxT7AFQtOuCBu3xRzib0fyQKmiJarC2GGhcTVIFF1Du1OfeiE+fnJ6gUaNeJ802X9crSRb/5exh7YfGVrmJIA=; 24:lBeAYZOz9ewT+f8zwBupnZseKmzvpR2om16+tZ5iagD/ruM8G770GxuCtf5PshUE5evoWxUlAI7pgODYXN2FtEoYJ7cch/2iq7UexvJCwyo=; 7:yYkoo8vUYNQDCMPbaPvneDcmpn+X4RcOcjIBdMazLpqcD7u7TcHTt4Lv/wkyTf1EfogldwHwSxJX1RcdpkBHusUL1utKhyHEDHw/HBxeyw/ap2teMjVKxZmHRRFvMvpAVuEOZNM0hPWrpk899fVO0EqYUpWnt4Mn1x0HFvm8knoKofVf0wseOR21LuM7gdACu0CNdeTE9YTAy/eWCM83ilLO4aE46UlvD8LbMrfwuEQawKXaRVSz/0E2rMAzKR0B SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Nov 2017 12:17:06.1299 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2fe890b8-e34b-4bc6-bae2-08d5326c1ce1 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 01/39] examples/l2fwd: 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:07 -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/main.c | 38 ++++++++++++++++++++++++++++++-------- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index e89e2e1bf..a1e378be6 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -110,14 +110,11 @@ struct lcore_queue_conf lcore_queue_conf[RTE_MAX_LCORE]; static 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, @@ -649,6 +646,9 @@ 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; + /* skip ports that are not enabled */ if ((l2fwd_enabled_port_mask & (1 << portid)) == 0) { printf("Skipping disabled port %u\n", portid); @@ -658,6 +658,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, "Cannot configure device: err=%d, port=%u\n", @@ -674,9 +691,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, "rte_eth_rx_queue_setup:err=%d, port=%u\n", @@ -684,9 +703,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", ret, portid); -- 2.12.0