/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
* Copyright(c) 2014 6WIND S.A.
* All rights reserved.
*
return;
}
init_port_config();
+ set_port_slave_flag(slave_port_id);
}
cmdline_parse_token_string_t cmd_addbonding_slave_add =
return;
}
init_port_config();
+ clear_port_slave_flag(slave_port_id);
}
cmdline_parse_token_string_t cmd_removebonding_slave_remove =
FOREACH_PORT(pi, ports) {
port = &ports[pi];
/* Check if there is a port which is not started */
- if (port->port_status != RTE_PORT_STARTED)
+ if ((port->port_status != RTE_PORT_STARTED) &&
+ (port->slave_flag == 0))
return 0;
}
FOREACH_PORT(pi, ports) {
port = &ports[pi];
- if (port->port_status != RTE_PORT_STOPPED)
+ if ((port->port_status != RTE_PORT_STOPPED) &&
+ (port->slave_flag == 0))
return 0;
}
}
}
+void set_port_slave_flag(portid_t slave_pid)
+{
+ struct rte_port *port;
+
+ port = &ports[slave_pid];
+ port->slave_flag = 1;
+}
+
+void clear_port_slave_flag(portid_t slave_pid)
+{
+ struct rte_port *port;
+
+ port = &ports[slave_pid];
+ port->slave_flag = 0;
+}
+
const uint16_t vlan_tags[] = {
0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15,
/*-
* BSD LICENSE
*
- * Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
+ * Copyright(c) 2010-2015 Intel Corporation. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
uint8_t need_reconfig; /**< need reconfiguring port or not */
uint8_t need_reconfig_queues; /**< need reconfiguring queues or not */
uint8_t rss_flag; /**< enable rss or not */
- uint8_t dcb_flag; /**< enable dcb */
+ uint8_t dcb_flag; /**< enable dcb */
struct rte_eth_rxconf rx_conf; /**< rx configuration */
struct rte_eth_txconf tx_conf; /**< tx configuration */
struct ether_addr *mc_addr_pool; /**< pool of multicast addrs */
uint32_t mc_addr_nb; /**< nb. of addr. in mc_addr_pool */
+ uint8_t slave_flag; /**< bonding slave port */
};
extern portid_t __rte_unused
void dev_set_link_up(portid_t pid);
void dev_set_link_down(portid_t pid);
void init_port_config(void);
+void set_port_slave_flag(portid_t slave_pid);
+void clear_port_slave_flag(portid_t slave_pid);
int init_port_dcb_config(portid_t pid,struct dcb_config *dcb_conf);
int start_port(portid_t pid);
void stop_port(portid_t pid);