DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH 0/6] make eth_dev_ops const
@ 2016-03-21 17:53 Stephen Hemminger
  2016-03-21 17:53 ` [dpdk-dev] [PATCH 1/6] bonding: " Stephen Hemminger
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Stephen Hemminger @ 2016-03-21 17:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Newer driver seem not to have gotten the message that eth_dev_ops
structure should be const.

Stephen Hemminger (6):
  bonding: make eth_dev_ops const
  cxgbe: make eth_dev_ops const
  bnx2x: make eth_dev_ops const
  nfp: make eth_dev_ops const
  szedata: make eth_dev_ops const
  mpipe: make eth_dev_ops const

 drivers/net/bnx2x/bnx2x_ethdev.c           |  4 +--
 drivers/net/bonding/rte_eth_bond_pmd.c     | 38 +++++++++++------------
 drivers/net/bonding/rte_eth_bond_private.h |  2 +-
 drivers/net/cxgbe/cxgbe_ethdev.c           |  2 +-
 drivers/net/mpipe/mpipe_tilegx.c           |  2 +-
 drivers/net/nfp/nfp_net.c                  |  2 +-
 drivers/net/szedata2/rte_eth_szedata2.c    | 48 +++++++++++++++---------------
 7 files changed, 49 insertions(+), 49 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH 1/6] bonding: make eth_dev_ops const
  2016-03-21 17:53 [dpdk-dev] [PATCH 0/6] make eth_dev_ops const Stephen Hemminger
@ 2016-03-21 17:53 ` Stephen Hemminger
  2016-03-21 17:53 ` [dpdk-dev] [PATCH 2/6] cxgbe: " Stephen Hemminger
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2016-03-21 17:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

This structure has immutable function pointers.
Also fix indentation.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

---
 drivers/net/bonding/rte_eth_bond_pmd.c     | 38 +++++++++++++++---------------
 drivers/net/bonding/rte_eth_bond_private.h |  2 +-
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 011150a..8961a67 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -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
diff --git a/drivers/net/bonding/rte_eth_bond_private.h b/drivers/net/bonding/rte_eth_bond_private.h
index 6c47a29..8312397 100644
--- a/drivers/net/bonding/rte_eth_bond_private.h
+++ b/drivers/net/bonding/rte_eth_bond_private.h
@@ -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);
-- 
2.1.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH 2/6] cxgbe: make eth_dev_ops const
  2016-03-21 17:53 [dpdk-dev] [PATCH 0/6] make eth_dev_ops const Stephen Hemminger
  2016-03-21 17:53 ` [dpdk-dev] [PATCH 1/6] bonding: " Stephen Hemminger
@ 2016-03-21 17:53 ` Stephen Hemminger
  2016-03-21 17:53 ` [dpdk-dev] [PATCH 3/6] bnx2x: " Stephen Hemminger
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2016-03-21 17:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger


Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/cxgbe/cxgbe_ethdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 8c6dd59..0d636ad 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -767,7 +767,7 @@ static int cxgbe_flow_ctrl_set(struct rte_eth_dev *eth_dev,
 			     &pi->link_cfg);
 }
 
-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,
-- 
2.1.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH 3/6] bnx2x: make eth_dev_ops const
  2016-03-21 17:53 [dpdk-dev] [PATCH 0/6] make eth_dev_ops const Stephen Hemminger
  2016-03-21 17:53 ` [dpdk-dev] [PATCH 1/6] bonding: " Stephen Hemminger
  2016-03-21 17:53 ` [dpdk-dev] [PATCH 2/6] cxgbe: " Stephen Hemminger
@ 2016-03-21 17:53 ` Stephen Hemminger
  2016-03-21 17:53 ` [dpdk-dev] [PATCH 4/6] nfp: " Stephen Hemminger
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2016-03-21 17:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/bnx2x/bnx2x_ethdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x_ethdev.c b/drivers/net/bnx2x/bnx2x_ethdev.c
index fe8cfd0..7e5be08 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.c
+++ b/drivers/net/bnx2x/bnx2x_ethdev.c
@@ -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,
-- 
2.1.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH 4/6] nfp: make eth_dev_ops const
  2016-03-21 17:53 [dpdk-dev] [PATCH 0/6] make eth_dev_ops const Stephen Hemminger
                   ` (2 preceding siblings ...)
  2016-03-21 17:53 ` [dpdk-dev] [PATCH 3/6] bnx2x: " Stephen Hemminger
@ 2016-03-21 17:53 ` Stephen Hemminger
  2016-03-21 17:53 ` [dpdk-dev] [PATCH 5/6] szedata: " Stephen Hemminger
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2016-03-21 17:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/nfp/nfp_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c
index 8810704..85d4009 100644
--- a/drivers/net/nfp/nfp_net.c
+++ b/drivers/net/nfp/nfp_net.c
@@ -2272,7 +2272,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,
-- 
2.1.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH 5/6] szedata: make eth_dev_ops const
  2016-03-21 17:53 [dpdk-dev] [PATCH 0/6] make eth_dev_ops const Stephen Hemminger
                   ` (3 preceding siblings ...)
  2016-03-21 17:53 ` [dpdk-dev] [PATCH 4/6] nfp: " Stephen Hemminger
@ 2016-03-21 17:53 ` Stephen Hemminger
  2016-03-21 17:53 ` [dpdk-dev] [PATCH 6/6] mpipe: " Stephen Hemminger
  2016-03-23 12:09 ` [dpdk-dev] [PATCH 0/6] " Bruce Richardson
  6 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2016-03-21 17:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

All usage of eth_dev_ops should be const.
And fix the indentation

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/szedata2/rte_eth_szedata2.c | 48 ++++++++++++++++-----------------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/drivers/net/szedata2/rte_eth_szedata2.c b/drivers/net/szedata2/rte_eth_szedata2.c
index 81c806e..1d6a600 100644
--- a/drivers/net/szedata2/rte_eth_szedata2.c
+++ b/drivers/net/szedata2/rte_eth_szedata2.c
@@ -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,
 };
 
 /*
-- 
2.1.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [dpdk-dev] [PATCH 6/6] mpipe: make eth_dev_ops const
  2016-03-21 17:53 [dpdk-dev] [PATCH 0/6] make eth_dev_ops const Stephen Hemminger
                   ` (4 preceding siblings ...)
  2016-03-21 17:53 ` [dpdk-dev] [PATCH 5/6] szedata: " Stephen Hemminger
@ 2016-03-21 17:53 ` Stephen Hemminger
  2016-03-23 12:09 ` [dpdk-dev] [PATCH 0/6] " Bruce Richardson
  6 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2016-03-21 17:53 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/mpipe/mpipe_tilegx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/mpipe/mpipe_tilegx.c b/drivers/net/mpipe/mpipe_tilegx.c
index aef7600..7180e5a 100644
--- a/drivers/net/mpipe/mpipe_tilegx.c
+++ b/drivers/net/mpipe/mpipe_tilegx.c
@@ -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,
-- 
2.1.4

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [dpdk-dev] [PATCH 0/6] make eth_dev_ops const
  2016-03-21 17:53 [dpdk-dev] [PATCH 0/6] make eth_dev_ops const Stephen Hemminger
                   ` (5 preceding siblings ...)
  2016-03-21 17:53 ` [dpdk-dev] [PATCH 6/6] mpipe: " Stephen Hemminger
@ 2016-03-23 12:09 ` Bruce Richardson
  6 siblings, 0 replies; 8+ messages in thread
From: Bruce Richardson @ 2016-03-23 12:09 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

On Mon, Mar 21, 2016 at 10:53:23AM -0700, Stephen Hemminger wrote:
> Newer driver seem not to have gotten the message that eth_dev_ops
> structure should be const.
> 
> Stephen Hemminger (6):
>   bonding: make eth_dev_ops const
>   cxgbe: make eth_dev_ops const
>   bnx2x: make eth_dev_ops const
>   nfp: make eth_dev_ops const
>   szedata: make eth_dev_ops const
>   mpipe: make eth_dev_ops const
>
Series Acked-by: Bruce Richardson <bruce.richardson@intel.com>

Applied to dpdk-next-net/rel_16_04

/Bruce

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-03-23 12:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-21 17:53 [dpdk-dev] [PATCH 0/6] make eth_dev_ops const Stephen Hemminger
2016-03-21 17:53 ` [dpdk-dev] [PATCH 1/6] bonding: " Stephen Hemminger
2016-03-21 17:53 ` [dpdk-dev] [PATCH 2/6] cxgbe: " Stephen Hemminger
2016-03-21 17:53 ` [dpdk-dev] [PATCH 3/6] bnx2x: " Stephen Hemminger
2016-03-21 17:53 ` [dpdk-dev] [PATCH 4/6] nfp: " Stephen Hemminger
2016-03-21 17:53 ` [dpdk-dev] [PATCH 5/6] szedata: " Stephen Hemminger
2016-03-21 17:53 ` [dpdk-dev] [PATCH 6/6] mpipe: " Stephen Hemminger
2016-03-23 12:09 ` [dpdk-dev] [PATCH 0/6] " Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).