drivers: make struct of networking operations const

This structure has immutable function pointers.
Also fix indentation.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
This commit is contained in:
Stephen Hemminger 2016-03-21 10:53:24 -07:00 committed by Thomas Monjalon
parent 65ca78fdf9
commit 89b890df3f
7 changed files with 49 additions and 49 deletions

View File

@ -348,7 +348,7 @@ bnx2x_mac_addr_remove(struct rte_eth_dev *dev, uint32_t index)
sc->mac_ops.mac_addr_remove(dev, index);
}
static struct eth_dev_ops bnx2x_eth_dev_ops = {
static const struct eth_dev_ops bnx2x_eth_dev_ops = {
.dev_configure = bnx2x_dev_configure,
.dev_start = bnx2x_dev_start,
.dev_stop = bnx2x_dev_stop,
@ -371,7 +371,7 @@ static struct eth_dev_ops bnx2x_eth_dev_ops = {
/*
* dev_ops for virtual function
*/
static struct eth_dev_ops bnx2xvf_eth_dev_ops = {
static const struct eth_dev_ops bnx2xvf_eth_dev_ops = {
.dev_configure = bnx2x_dev_configure,
.dev_start = bnx2x_dev_start,
.dev_stop = bnx2x_dev_stop,

View File

@ -2142,25 +2142,25 @@ bond_ethdev_rss_hash_conf_get(struct rte_eth_dev *dev,
return 0;
}
struct eth_dev_ops default_dev_ops = {
.dev_start = bond_ethdev_start,
.dev_stop = bond_ethdev_stop,
.dev_close = bond_ethdev_close,
.dev_configure = bond_ethdev_configure,
.dev_infos_get = bond_ethdev_info,
.rx_queue_setup = bond_ethdev_rx_queue_setup,
.tx_queue_setup = bond_ethdev_tx_queue_setup,
.rx_queue_release = bond_ethdev_rx_queue_release,
.tx_queue_release = bond_ethdev_tx_queue_release,
.link_update = bond_ethdev_link_update,
.stats_get = bond_ethdev_stats_get,
.stats_reset = bond_ethdev_stats_reset,
.promiscuous_enable = bond_ethdev_promiscuous_enable,
.promiscuous_disable = bond_ethdev_promiscuous_disable,
.reta_update = bond_ethdev_rss_reta_update,
.reta_query = bond_ethdev_rss_reta_query,
.rss_hash_update = bond_ethdev_rss_hash_update,
.rss_hash_conf_get = bond_ethdev_rss_hash_conf_get
const struct eth_dev_ops default_dev_ops = {
.dev_start = bond_ethdev_start,
.dev_stop = bond_ethdev_stop,
.dev_close = bond_ethdev_close,
.dev_configure = bond_ethdev_configure,
.dev_infos_get = bond_ethdev_info,
.rx_queue_setup = bond_ethdev_rx_queue_setup,
.tx_queue_setup = bond_ethdev_tx_queue_setup,
.rx_queue_release = bond_ethdev_rx_queue_release,
.tx_queue_release = bond_ethdev_tx_queue_release,
.link_update = bond_ethdev_link_update,
.stats_get = bond_ethdev_stats_get,
.stats_reset = bond_ethdev_stats_reset,
.promiscuous_enable = bond_ethdev_promiscuous_enable,
.promiscuous_disable = bond_ethdev_promiscuous_disable,
.reta_update = bond_ethdev_rss_reta_update,
.reta_query = bond_ethdev_rss_reta_query,
.rss_hash_update = bond_ethdev_rss_hash_update,
.rss_hash_conf_get = bond_ethdev_rss_hash_conf_get
};
static int

View File

@ -171,7 +171,7 @@ struct bond_dev_private {
uint8_t slave_update_idx;
};
extern struct eth_dev_ops default_dev_ops;
extern const struct eth_dev_ops default_dev_ops;
int
check_for_bonded_ethdev(const struct rte_eth_dev *eth_dev);

View File

@ -781,7 +781,7 @@ cxgbe_dev_supported_ptypes_get(struct rte_eth_dev *eth_dev)
return NULL;
}
static struct eth_dev_ops cxgbe_eth_dev_ops = {
static const struct eth_dev_ops cxgbe_eth_dev_ops = {
.dev_start = cxgbe_dev_start,
.dev_stop = cxgbe_dev_stop,
.dev_close = cxgbe_dev_close,

View File

@ -1165,7 +1165,7 @@ mpipe_promiscuous_disable(struct rte_eth_dev *dev)
}
}
static struct eth_dev_ops mpipe_dev_ops = {
static const struct eth_dev_ops mpipe_dev_ops = {
.dev_infos_get = mpipe_infos_get,
.dev_configure = mpipe_configure,
.dev_start = mpipe_start,

View File

@ -2289,7 +2289,7 @@ nfp_net_rss_hash_conf_get(struct rte_eth_dev *dev,
}
/* Initialise and register driver with DPDK Application */
static struct eth_dev_ops nfp_net_eth_dev_ops = {
static const struct eth_dev_ops nfp_net_eth_dev_ops = {
.dev_configure = nfp_net_configure,
.dev_start = nfp_net_start,
.dev_stop = nfp_net_stop,

View File

@ -1317,30 +1317,30 @@ eth_allmulticast_disable(struct rte_eth_dev *dev)
cgmii_ibuf_mac_mode_write(ibuf, SZEDATA2_MAC_CHMODE_ONLY_VALID);
}
static struct eth_dev_ops ops = {
.dev_start = eth_dev_start,
.dev_stop = eth_dev_stop,
.dev_set_link_up = eth_dev_set_link_up,
.dev_set_link_down = eth_dev_set_link_down,
.dev_close = eth_dev_close,
.dev_configure = eth_dev_configure,
.dev_infos_get = eth_dev_info,
.promiscuous_enable = eth_promiscuous_enable,
.promiscuous_disable = eth_promiscuous_disable,
.allmulticast_enable = eth_allmulticast_enable,
.allmulticast_disable = eth_allmulticast_disable,
.rx_queue_start = eth_rx_queue_start,
.rx_queue_stop = eth_rx_queue_stop,
.tx_queue_start = eth_tx_queue_start,
.tx_queue_stop = eth_tx_queue_stop,
.rx_queue_setup = eth_rx_queue_setup,
.tx_queue_setup = eth_tx_queue_setup,
.rx_queue_release = eth_rx_queue_release,
.tx_queue_release = eth_tx_queue_release,
.link_update = eth_link_update,
.stats_get = eth_stats_get,
.stats_reset = eth_stats_reset,
.mac_addr_set = eth_mac_addr_set,
static const struct eth_dev_ops ops = {
.dev_start = eth_dev_start,
.dev_stop = eth_dev_stop,
.dev_set_link_up = eth_dev_set_link_up,
.dev_set_link_down = eth_dev_set_link_down,
.dev_close = eth_dev_close,
.dev_configure = eth_dev_configure,
.dev_infos_get = eth_dev_info,
.promiscuous_enable = eth_promiscuous_enable,
.promiscuous_disable = eth_promiscuous_disable,
.allmulticast_enable = eth_allmulticast_enable,
.allmulticast_disable = eth_allmulticast_disable,
.rx_queue_start = eth_rx_queue_start,
.rx_queue_stop = eth_rx_queue_stop,
.tx_queue_start = eth_tx_queue_start,
.tx_queue_stop = eth_tx_queue_stop,
.rx_queue_setup = eth_rx_queue_setup,
.tx_queue_setup = eth_tx_queue_setup,
.rx_queue_release = eth_rx_queue_release,
.tx_queue_release = eth_tx_queue_release,
.link_update = eth_link_update,
.stats_get = eth_stats_get,
.stats_reset = eth_stats_reset,
.mac_addr_set = eth_mac_addr_set,
};
/*