From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00062.outbound.protection.outlook.com [40.107.0.62]) by dpdk.org (Postfix) with ESMTP id 7FC302C55 for ; Tue, 12 Dec 2017 13:27:24 +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=x8Jj59P46kZJp9v4tMTFKpHxBvghO5okCBUhlAIKh00=; b=k514gZef3HksRUd/6Ed5ocK6H5HXvC2Y5COXukNBZlsg0PlPbGqIG4yD8me43+GxcBc/diC1iiTWscp7/8k/KIhx3o9HwGRdXz6chwM6qHAI38UhEjRW9w0AHt9nyk/4mJ9g8ZwV5HNqjRiu+bja4qXKyvbG4vcRGnFt3TfH+34= 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:22 +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:18 +0200 Message-Id: <28ae15a1a94f6d54b47be65ba4fc0f4038f2e2d1.1513081087.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: 90f3b539-4727-4db5-0b2b-08d5415bb255 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:dyuCaihKTdgIP+tyeF3WdgJn7NmrC0idOCjBWr0sFSWFUs/h3XtKTTeQPRUECQoVM/8Sm0h28KmUiq/oNYskKnWJpGnrUl/nQcnHfJqPonZDAdY7QrAXLLn/bWj2xC0yG2r8l14CfilDJb/aj+t9VWUShkf2++wnYM0WzG8DViQ3P+TUBlUCflipvLVwTy9kCpe37sujeL1eNSjDl6o2NdL40hlpUD7pIup26oMXzahL4y+93Xc/PJtnaE3G8Mer; 25:rlxXEmu5kbwxDGHCngXmUiEQkbdlp7onrf2G6JdZklTq2+VyOw10l6SGvP2L8ZWLlRDi6550fV4JwBC5+Ij7EC+vIGeCRKfDZuc+LPCX8saf+OcT7y65/BYnZAHpDCeGZK6vPLw+z1xfIWEnZbiQv/1o8zUwtxAwa3jVzW0c3duGYkZzA0A3QnEgQViYsrH77iXPeFgNlGftkX5GpoTfNln/fwFY76wBM7nkWGVXFei/T207YcK1Hc6q5iJrlj5eIzkqb3dCJD5zFGXk27q14F4/oDats24e5zjb/qy8MOZkIhJw9zzDKewNBeB6mYdbSURUtRiwx0YC+LD6+ot2+w==; 31:KJjTUY4YKrCITIqxUCijXYa+ERPdYPbFJ1kPWdgefcvVfB3FF031SG1lxzmFJVNBgfBMUmBZYDWGI8QrgD0jRqBWeEEXtx8Ywcg34IWQHQnBTZcQwhrEk48iDdp8qxMiav6Y1+7oYtSmv/TzIm97mJPcGhSA8GsBw0mFLxq1bf7jGIvlyj7ptC7H9x0YF4dVUNLkSOEXwATbfii5ULsuGlmTiit+HBapHwy2TDR8iQE= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:jyXNL1RPdoYub26zb9MRebIXs41QP4ixkj1GPOa4ruHKV9ncca0Fp4Xgdp4Swf0lqTsOi2wtRtx0C0rUPvW8gLuOmE8dV7EHkmtKjYTSX72DnGxp2uaKuUFPvwWBk1tqTepC/8m4doQEmzRhd0UrcsMkrwjoJRxJM5544hs6vi4Xt3KKw4uffx17UWry/qBO90WjaJ54DcYbil1E4XbIML7NmLtt2bn1kc5PIO7v32I6ZK+C49QvHvpNJi7SJbhL+CgAQ/2uaP/+Xn/Z6Jn5DyNFFWhiwcIPr8jGo8uQ7NgG/WOdPr+4RGl3+ojyje/Yc1T9vkkbRzA3eAo20ngYuHxn4SHyDNYuHioAGue8aQxSc0AkErmSEzHqDOeWkB90hSNqV7YC5htaWajR1BAOEm77vm7LSUzZb4ACVfgrPN0zABo1t8HiEDj8VPPldNPpNsMb9TTst3Qu3iqveXzeG35TXjnFqe/9W1VcfVr9LXdziQNXDSgCP82eqwVNKd9V; 4:R43bIJkmUDg+aIfP0HuZGqh7wMiHJaND/1Q7nIf1E2ZvQDa6qX84YfN9Wt2WhnxUXg5ELQjcYAblKLELuxb8CZDRrcWut9L2lw2tcqmy3+NvZ92Kk+MH2oJClVHmyT+OCKA9TQukxCqX0NL0o7AB45M49c1qtHLgrZUpjf6nO6rMysCnrucfYqTWu6W9p7mcjmKYCcO/lWbBspMkmu74GWTRPO38HzMQJt06IcelKqjVu9Advaw9+8giMPq2LdV9CVn+VxccAg5TY6owscDdJg== 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:nE3j95oge79c3wykBb//8e5rDl2CVSRIWybe0yMNx?= =?us-ascii?Q?9Q8F7NadQd7O0g3qTuTXkfWMiDUlHHDijImwpYJm0g0zfvq3T6ZD/akc8H1X?= =?us-ascii?Q?Uhh9jKc/bHo+nnThxZmEXzMzbZ3FYDL8Pttyzwt38oQCJ9sP8D4h2mHGX/Fn?= =?us-ascii?Q?qyW35H4lJMA7Kg49wEAqEKde7wXcNj/T6NcvflWSmlhab5bCTD3FPPJJ7mAG?= =?us-ascii?Q?yIYEYNNg1wla4DoO1BIA34OkWPpAG9dFUrdLrNv1CwKV+dNDd8JFasBbeWsB?= =?us-ascii?Q?r3ZCui5oNQVS0PV87+nYe+jcJoK9HBcdrhntpW78mhJvKta8ehqYZg1Zta0w?= =?us-ascii?Q?UcaSNMffh6mW05wuFRfFj1ojSiid9X1tP4nq29Pk+k71omslUkOWFzUTebxR?= =?us-ascii?Q?N8R00l3x1SouS9z0ycV1jzFxslaPiji0Y0a5FjtO+dBnE8kZwHM3+yek05fe?= =?us-ascii?Q?5FAPZN7m6xkYAL3ABZyie9lj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biQspLCModx+RvdukIXosZ32fxEaXzIT9vhfaUlzMXR9eyVd+65QJcDgryY=; 5:fNSqoSCXehtsaYwz+TSj6L0kx81HIO3/XZ7RRQqkvq9mfBuEUUZjg9SLS2XihoIzBXXSJ9h0VXNeJBSrLS/4BYmxgP4P9gkh3AEVbjvP/kNfpMIEpHCaC290Uzy5dz5VIe0NpNZ+JZ2+yWiuCrTxrjpMaseFKuhuswAZN3cKF1w=; 24:F8BAci3wuaXQn1ViB47peR3Ht53EB1ch1r7cv5AQgC7/vkcZsS98fU6/KYzkLagTpVaWArVW4ikqb/LAIG0gKfvcCwN3YjhKIBANFAsOfbQ=; 7:jmEcMgIsvq2lxEKl8IzRpxQ/ulb5rIIWdL1ex1x/pwJgoTkg3oiN6MW1YP5XUCr1enppEAu+lVNQdxcedoLhONmJlFdmMfSdw0nH2q4djDYEXtgceGgl/jCxnE5t8sn2UMStVrJZgp1dFYP4PStMK7yiPvhDeE5mpmqXSvLLcsxLm7ND4SJLD4kaonRH5z8GO+Gz7V7dsj8JCw/TVcnHjaDxIXbCnV4ieJtztKixChOhewXIwPhvpYOe2yHc+ci7 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:22.3806 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 90f3b539-4727-4db5-0b2b-08d5415bb255 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 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: Tue, 12 Dec 2017 12:27:24 -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 | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index e89e2e1..e25b107 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -110,17 +110,15 @@ struct lcore_queue_conf { 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, + .offloads = DEV_TX_OFFLOAD_MBUF_FAST_FREE, }, }; @@ -649,6 +647,9 @@ enum { /* 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 +659,21 @@ enum { /* 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); + } + 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, 1, 1, &port_conf); if (ret < 0) rte_exit(EXIT_FAILURE, "Cannot configure device: err=%d, port=%u\n", @@ -674,9 +690,11 @@ enum { /* 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 +702,12 @@ enum { /* 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); -- 1.8.3.1