From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0075.outbound.protection.outlook.com [104.47.0.75]) by dpdk.org (Postfix) with ESMTP id 708581B209 for ; Tue, 12 Dec 2017 13:27:47 +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=ptEYxUvS1agyIxnGlcAq0R+Tc/9ZphbcR5j+y8lN68E=; b=iPksEClswFEblikvo9xdZMoZjkFJITXU1m+VO375FIkxlaxZCmK1FxJozXSqMEKUh584JfIn7202sM8GpAduUA0C+ayFgaVIRfA9nGHQ7wN8XKBAS2SS/qabYPYh5a848QlTO85zlWNC1Lx/A10ANjZaceTzZ6gM4wAaf6wPeHY= 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:44 +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:33 +0200 Message-Id: <2197ea28acdb2cdee34c8cd553315e7fd4b74672.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: 534852ff-af2c-461e-ef35-08d5415bbfbb 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:kMyE8o0rUS25ssWkDuohqEEWMpsXtc4XcjjiBYB1Ntq618Un/xK5tWmbZ64QMhXvWWJYyv/Y+mBeJwiGAhkB+8qhyqvkIsS7XFrASMXN5p9r1rF1JFpXvv3dtD6cplnqxqkFHgD7LeWCo1bEgUToNkS4321D/oOg2m6lXKaQ3DE3kuyg3YOqRjhdhi/KFX+8NILM7Ne05SILYio90tXmoHxZKcDoctdX9k/TvltXBt6rRMrsC+NgAUCHdlfWGDRY; 25:FXmDZsFXZI/mJQIiqIHJnO4RXmqBA+RN/WZJeGMdzlsXwKJeJaw6Xnm0kpXRNT/CLq0eTv4uWufEAVZBVCfIldQ7RiTLQM8xeaiPtnzhMUuISPLNvdVjYyIqi+1OtiZUQOTkNWTg7US1JLp8hMgaj/j4NQ0XtKKx3DWFjImRdJ2i9Eb6Psv8QCXj32jKb5vmrC5R0zhvrfRVjldp8KnCZwKkwTXBOP2jvZT9PPlK+4ZG5SPRB9FOASqzdlsO4SbaoxtsA2yC+mdG8hyVKtFMRijMu83VDNGcc6Dw+Oe6Gus5koYgR8Oty/JUTJr5sWHkGYNzc/WvrgyZbkh7Zst4Bw==; 31:sL6d/9GiLB08YBdTApd5syHqmBoTXT1E4DE/DHR2MpDzlDxD6iCDr+jqd/ytS46sm0Fxq6OCEansdIiqC58AkuKBmUPSlYKw+Y9EO/vjpwKBsq/085F1MhJiXdgdG/B9uzSSR4giC/cxO/PYMdM11q0vNNCW3IgGt2UfC7lNhTCna/ahIF9m4nVbx8f/NZ4PA37Zl6wAe5pfHAAi+w6pSybl7SrN5XPNiSQwRxOt4NI= X-MS-TrafficTypeDiagnostic: VI1PR05MB3149: X-Microsoft-Exchange-Diagnostics: 1; VI1PR05MB3149; 20:9cbWtW0DNErjPsgv57A6oT6QOSvcpAIz0RnwE72mYOebWPOOc7ISNC5WymHZhTJBlw/NSsXmA8y3cd+eV18in+ndTs/YICjALZb+UpBe3UFuLGGwUlv6Vtzv0x96+DdHkV57SjFBhOBRCs2Bay64X4bMh3AIDZQa2UUxDcukQ+9MQjaSs0WBIRWT9Qzc0MLVUI1KQnfZj8SzMlM2JqvjYgN08zETBM5NGw2j2pWG06Vj+4qhXOOEu+8ADgJoHpVTJKfCxZvOrqrdWNzLokywfCPI0zbXib01a3CojDisMxfN1iCFEkLLa36nUNUGR5EctjalMRYqEhRn8pwJPSHHUy0jXQgetpEdr/Sg846ackr/4kzuN0bLCL1Jmf0o9anVbv0m3BppVR+LuIWAFpnfE9ec0I9udkoFR2jNWN51JJ1mzxyVS8L71aTjwCHDMvMWq1MDctE5emeTjEsvbyp7MeacvXs9gHYXvIq+b3WKvreH3KO9QLV7P2djSKZ0g1Ai; 4:LHfRcFJoCc4apSbm1Fh8+loE972jjOABjoBKm8iFaQMqcqs/mLL+AMcsBcGS8H+/KaDmCKJbaT5oUhIcQHnRPi7e+hvmV1ySCPXuMchwnTetj43yzcK5LFj0OqvbBWpEe6oREElTq/gLcDdA789jVmPpI7qWb8y246R5ZmZfbH4/4C1DJQnb4rF71RrKLnRMzyeaoVY9rrCobtDWvuW0h7K4bcTtyAEU0Sj5sjBBFEkcLKfpkplRtZ0BjeJW6yWZY2GMmy1vkrt2SvbD+OYHhQ== 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:gBKlI1gjgH1irOvbBv3HD6jpqAByZxmpDSZTy8c5Q?= =?us-ascii?Q?8nvjJmYVousQlqGQFVA2h+lRhF8I7mjaKoIpaQp1nJbsxVhL+k61TpGzBOvz?= =?us-ascii?Q?JzV7hx4AVgPVVMQtgrksP05XLtzSyUfChps8Z7RkMh7enuS0HbdX2FLHyQsN?= =?us-ascii?Q?Lq/tdPUoiXff9f0imib/3TfnrxOfgPex2niDSDJAYPTfx7oBy4KL0px1jwb+?= =?us-ascii?Q?Ub8oM83OL1Fm88Nz45LidDp4b3qyXysAolT5EQbGKV7lyXlNo4RSlK5R6x/U?= =?us-ascii?Q?ZsfGgiYybQgsGaHm0I1OvceNyPYtJ7cbwaKOZCS8wjzWZjZeDTUzrcWBNuNP?= =?us-ascii?Q?V6x9VxkDSqsmF8qa4/YlDjvodMDb2hGPPrOuzRWzOj97xXCccmdh73LDtfHh?= =?us-ascii?Q?mLCt/EBl95l9Cn3dSU0klwk/bQ1L6E2rX/R3OAltuzh1f72teB5H0XwAw+7/?= =?us-ascii?Q?QwOUG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axu8v/BiY/HwMQvjHYsQD9qvGb9tpw8girBurzmwj5iGBNXB9sIVqlMB1zMpshQSHwIquqF2/qXQfLO8BC2H39AUrDMWhIZ/i4=; 5:iNx3UgKGyUq5x41S3VIFJh0bK9H2hfDq+y469dM+kIjzwxpwXwmHfneaSkloCAdO7M1yeBoKYzm6yWhErjxEVfXc+q4jA5SnnwidYbM41sEf8YHfh/ne16J7fbZiP+4mhE0PHIcvH4OhuQADUzyiRyFEvUkAJuCzNNs+ayJMecw=; 24:U/LYkNY1otb4TL0efm3MBeWyKrh6vQ/TXlOfxirsTuuM7C0GdyPKKU9cFZup47zASztOLeqVmJEeDMRcGFCb8a1WtjYjnssAY28onRv2mAg=; 7:OaFRckTvOaU7upFux9r3cS753+oM1sudg1dJPwJNMPii6TLlNdJ12h258fp2iGIBFrQ8KHBQkCTgCCP++pkHLoZtn3bE2gZSx0KIhFZ0WN3Q2pPukcZRJQ9uuWGMfZf3/Ejn0CB3MHz+lb91ECP3u+Gn2m6SMY5ghXXTGh+RviTRmBBL4gfBjzt60qwMBcbpx9QBvoX5CwbNYFEKNQsETUug3yJiBSFVw6TDPNWIOy76kXdhpOeYRWfA+kkKFXkE SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 12:27:44.8637 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 534852ff-af2c-461e-ef35-08d5415bbfbb 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 16/39] examples/ipv4_multicast: 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:47 -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/ipv4_multicast/main.c | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index 1c58516..ddefd71 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -138,14 +138,13 @@ struct lcore_queue_conf { .rxmode = { .max_rx_pkt_len = JUMBO_FRAME_MAX_SIZE, .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 = 1, /**< Jumbo Frame Support enabled */ - .hw_strip_crc = 1, /**< CRC stripped by hardware */ + .ignore_offload_bitfield = 1, + .offloads = (DEV_RX_OFFLOAD_JUMBO_FRAME | + DEV_RX_OFFLOAD_CRC_STRIP), }, .txmode = { .mq_mode = ETH_MQ_TX_NONE, + .offloads = DEV_TX_OFFLOAD_MULTI_SEGS, }, }; @@ -714,6 +713,8 @@ struct mcast_group_params { /* initialize all ports */ for (portid = 0; portid < nb_ports; portid++) { + struct rte_eth_rxconf rxq_conf; + /* skip ports that are not enabled */ if ((enabled_port_mask & (1 << portid)) == 0) { printf("Skipping disabled port %d\n", portid); @@ -748,6 +749,21 @@ struct mcast_group_params { n_tx_queue = nb_lcores; if (n_tx_queue > MAX_TX_QUEUE_PER_PORT) n_tx_queue = MAX_TX_QUEUE_PER_PORT; + + 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, (uint16_t)n_tx_queue, &port_conf); if (ret < 0) @@ -769,9 +785,11 @@ struct mcast_group_params { queueid = 0; printf("rxq=%hu ", queueid); fflush(stdout); + rxq_conf = dev_info.default_rxconf; + rxq_conf.offloads = port_conf.rxmode.offloads; ret = rte_eth_rx_queue_setup(portid, queueid, nb_rxd, rte_eth_dev_socket_id(portid), - NULL, + &rxq_conf, packet_pool); if (ret < 0) rte_exit(EXIT_FAILURE, "rte_eth_tx_queue_setup: err=%d, port=%d\n", @@ -787,7 +805,8 @@ struct mcast_group_params { fflush(stdout); txconf = &dev_info.default_txconf; - txconf->txq_flags = 0; + txconf->txq_flags = ETH_TXQ_FLAGS_IGNORE; + txconf->offloads = port_conf.txmode.offloads; ret = rte_eth_tx_queue_setup(portid, queueid, nb_txd, rte_lcore_to_socket_id(lcore_id), txconf); if (ret < 0) -- 1.8.3.1