MCPcopy Create free account
hub / github.com/F-Stack/f-stack / test_propagate

Function test_propagate

dpdk/app/test/test_link_bonding_rssconf.c:320–440  ·  view source on GitHub ↗

* Test configuration propagation over members. */

Source from the content-addressed store, hash-verified

318 * Test configuration propagation over members.
319 */
320static int
321test_propagate(void)
322{
323 unsigned i;
324 uint8_t n;
325 struct member_conf *port;
326 uint8_t bond_rss_key[40];
327 struct rte_eth_rss_conf bond_rss_conf = {0};
328
329 int retval = 0;
330 uint64_t rss_hf = 0;
331 uint64_t default_rss_hf = 0;
332
333 retval = rte_eth_dev_info_get(test_params.bond_port_id,
334 &test_params.bond_dev_info);
335 TEST_ASSERT((retval == 0),
336 "Error during getting device (port %u) info: %s\n",
337 test_params.bond_port_id, strerror(-retval));
338
339 /*
340 * Test hash function propagation
341 */
342 for (i = 0; i < sizeof(test_params.bond_dev_info.flow_type_rss_offloads)*8;
343 i++) {
344
345 rss_hf = test_params.bond_dev_info.flow_type_rss_offloads & (1<<i);
346 if (rss_hf) {
347 bond_rss_conf.rss_key = NULL;
348 bond_rss_conf.rss_hf = rss_hf;
349
350 retval = rte_eth_dev_rss_hash_update(test_params.bond_port_id,
351 &bond_rss_conf);
352 TEST_ASSERT_SUCCESS(retval, "Cannot set members hash function");
353
354 FOR_EACH_PORT(n, port) {
355 port = &test_params.member_ports[n];
356
357 retval = rte_eth_dev_rss_hash_conf_get(port->port_id,
358 &port->rss_conf);
359 TEST_ASSERT_SUCCESS(retval,
360 "Cannot take members RSS configuration");
361
362 TEST_ASSERT(port->rss_conf.rss_hf == rss_hf,
363 "Hash function not propagated for member %d",
364 port->port_id);
365 }
366
367 default_rss_hf = rss_hf;
368 }
369
370 }
371
372 /*
373 * Test key propagation
374 */
375 for (i = 1; i < 10; i++) {
376
377 /* Set all keys to zero */

Callers 1

test_rssFunction · 0.85

Calls 8

rte_eth_dev_info_getFunction · 0.85
memsetFunction · 0.85
reta_setFunction · 0.85
bond_reta_fetchFunction · 0.85
member_reta_fetchFunction · 0.85
reta_check_syncedFunction · 0.85

Tested by

no test coverage detected