* Some capabilities (like, rx_offload_capa and tx_offload_capa) of bonding * device in dev_info is zero when no member is added. And its capability * will be updated when add a new member device. So adding a member device need * to update the port configurations of bonding device. */
| 3005 | * to update the port configurations of bonding device. |
| 3006 | */ |
| 3007 | static void |
| 3008 | update_bonding_port_dev_conf(portid_t bond_pid) |
| 3009 | { |
| 3010 | #ifdef RTE_NET_BOND |
| 3011 | struct rte_port *port = &ports[bond_pid]; |
| 3012 | uint16_t i; |
| 3013 | int ret; |
| 3014 | |
| 3015 | ret = eth_dev_info_get_print_err(bond_pid, &port->dev_info); |
| 3016 | if (ret != 0) { |
| 3017 | fprintf(stderr, "Failed to get dev info for port = %u\n", |
| 3018 | bond_pid); |
| 3019 | return; |
| 3020 | } |
| 3021 | |
| 3022 | if (port->dev_info.tx_offload_capa & RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE) |
| 3023 | port->dev_conf.txmode.offloads |= |
| 3024 | RTE_ETH_TX_OFFLOAD_MBUF_FAST_FREE; |
| 3025 | /* Apply Tx offloads configuration */ |
| 3026 | for (i = 0; i < port->dev_info.max_tx_queues; i++) |
| 3027 | port->txq[i].conf.offloads = port->dev_conf.txmode.offloads; |
| 3028 | |
| 3029 | port->dev_conf.rx_adv_conf.rss_conf.rss_hf &= |
| 3030 | port->dev_info.flow_type_rss_offloads; |
| 3031 | #else |
| 3032 | RTE_SET_USED(bond_pid); |
| 3033 | #endif |
| 3034 | } |
| 3035 | |
| 3036 | int |
| 3037 | start_port(portid_t pid) |
no test coverage detected