ethdev: force deprecation of statistics
Subsystems (2)
v2 cover ethdev: force deprecation of statistics
Several fields in ether statistics were tagged with comment that they were going to be deprecated, but comments don't cause compile warnings. Instead use Gcc attributes to force the issue.
Of course to do that, all the drivers and tests which are using those fields have to be fixed first.
The input multicast statistic was listed as deprecated, but I find it useful, and therefore the first patch is to revive it.
Stephen Hemminger (7):
ether: don't mark input multicast for deprecation
bond: don't sum deprecated statistics
cxgbe: don't report deprecated statistics
i40e: don't report deprecated statistics
e1000: don't report deprecated statistics
test-pmd: remove references to deprecated statistics
rte_ether: mark deprecated statistics with attribute
app/test-pmd/config.c | 22 ++-------------------- app/test-pmd/testpmd.c | 26 ++------------------------ app/test/test_pmd_perf.c | 7 ++----- drivers/net/bonding/rte_eth_bond_pmd.c | 7 +------ drivers/net/cxgbe/cxgbe_ethdev.c | 10 +++------- drivers/net/e1000/em_ethdev.c | 12 ++---------- drivers/net/e1000/igb_ethdev.c | 12 ++---------- drivers/net/i40e/i40e_ethdev.c | 9 ++++----- drivers/net/ixgbe/ixgbe_ethdev.c | 1 - lib/librte_eal/common/include/rte_common.h | 3 +++ lib/librte_ether/rte_ethdev.h | 19 +++++++++---------- 11 files changed, 30 insertions(+), 98 deletions(-)
Signature · 1 line
2.1.4
PATCH v2 1/7 ether: don't mark input multicast for deprecation
The number of received multicast frames is useful and already available in many/most drivers. Therefore don't mark it as deprecated.
--- drivers/net/ixgbe/ixgbe_ethdev.c | 1 - lib/librte_ether/rte_ethdev.h | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-)
drivers/net/ixgbe/ixgbe_ethdev.c +0 -1
@@ -2715,7 +2715,6 @@ ixgbevf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->opackets = hw_stats->vfgptc; stats->obytes = hw_stats->vfgotc; stats->imcasts = hw_stats->vfmprc; -/* stats->imcasts should be removed as imcasts is deprecated */ } static void
lib/librte_ether/rte_ethdev.h +1 -2
@@ -204,8 +204,7 @@ struct rte_eth_stats {/**< Deprecated; Total of RX packets with bad length. */ uint64_t ierrors;/**< Total number of erroneous received packets. */ uint64_t oerrors;/**< Total number of failed transmitted packets. */ -uint64_t imcasts; -/**< Deprecated; Total number of multicast received packets. */ +uint64_t imcasts;/**< Total number of multicast received packets. */ uint64_t rx_nombuf;/**< Total number of RX mbuf allocation failures. */ uint64_t fdirmatch;/**< Deprecated; Total number of RX packets matching a filter. */
Signature · 1 line
2.1.4
Re: [PATCH 1/7] ether: don't mark input multicast for deprecation
2015-11-05 17:04, Stephen Hemminger:
Quoted 3 lines
The number of received multicast frames is useful and already available in many/most drivers. Therefore don't mark it as deprecated.
There are other useful stats in xstats.
The idea of this basic stats structure is to provide only the really mandatory and basic counters.
A multicast counter is not so basic and won't be implemented everywhere.
This patch won't be applied.
We'll need a consensus to definitively remove the deprecated stats.
Re: [PATCH 1/7] ether: don't mark input multicast for deprecation
In reply to Stephen HemmingerQuoted 27 lines · On Thu, 5 Nov 2015 17:04:33 -0800 Stephen Hemminger…
The number of received multicast frames is useful and already available in many/most drivers. Therefore don't mark it as deprecated.
Signed-off-by Stephen Hemminger <[email protected]>--- drivers/net/ixgbe/ixgbe_ethdev.c | 1 - lib/librte_ether/rte_ethdev.h | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-)drivers/net/ixgbe/ixgbe_ethdev.c +0
-1@@ -2715,7 +2715,6 @@ ixgbevf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->opackets = hw_stats->vfgptc; stats->obytes = hw_stats->vfgotc; stats->imcasts = hw_stats->vfmprc; -/* stats->imcasts should be removed as imcasts is deprecated */ } static voidlib/librte_ether/rte_ethdev.h +0
-0
lib/librte_ether/rte_ethdev.h struct rte_eth_stats { · line 210
Quoted 9 lines
lib/librte_ether/rte_ethdev.h +1
-2@@ -204,8 +204,7 @@ struct rte_eth_stats {/**< Deprecated; Total of RX packets with bad length. */ uint64_t ierrors;/**< Total number of erroneous received packets. */ uint64_t oerrors;/**< Total number of failed transmitted packets. */ -uint64_t imcasts; -/**< Deprecated; Total number of multicast received packets. */ +uint64_t imcasts;/**< Total number of multicast received packets. */ uint64_t rx_nombuf;/**< Total number of RX mbuf allocation failures. */ uint64_t fdirmatch;/**< Deprecated; Total number of RX packets matching a filter. */
I am okay with removing imcasts if all the drivers that support provide the same information in xstats.
PATCH v2 2/7 bond: don't sum deprecated statistics
In reply to Stephen HemmingerThese statistics are marked deprecated, leave them alone. Also keep track of imissed across all ports.
--- drivers/net/bonding/rte_eth_bond_pmd.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/net/bonding/rte_eth_bond_pmd.c +1 -6
@@ -1814,16 +1814,11 @@ bond_ethdev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->opackets += slave_stats.opackets; stats->ibytes += slave_stats.ibytes; stats->obytes += slave_stats.obytes; + stats->imissed += slave_stats.imissed; stats->ierrors += slave_stats.ierrors; stats->oerrors += slave_stats.oerrors; stats->imcasts += slave_stats.imcasts; stats->rx_nombuf += slave_stats.rx_nombuf; - stats->fdirmatch += slave_stats.fdirmatch; - stats->fdirmiss += slave_stats.fdirmiss; - stats->tx_pause_xon += slave_stats.tx_pause_xon; - stats->rx_pause_xon += slave_stats.rx_pause_xon; - stats->tx_pause_xoff += slave_stats.tx_pause_xoff; - stats->rx_pause_xoff += slave_stats.rx_pause_xoff;for (j =0 ; j <RTE_ETHDEV_QUEUE_STAT_CNTRS ; j++) { stats->q_ipackets[j] += slave_stats.q_ipackets[j];
Signature · 1 line
2.1.4
PATCH v2 3/7 cxgbe: don't report deprecated statistics
In reply to Stephen HemmingerSome of the ethernet device statistics are marked deprecated and should not be reported.
--- drivers/net/cxgbe/cxgbe_ethdev.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/net/cxgbe/cxgbe_ethdev.c +3 -7
@@ -660,18 +660,14 @@ static void cxgbe_dev_stats_get(struct rte_eth_dev *eth_dev, ps.rx_ovflow2 + ps.rx_ovflow3 + ps.rx_trunc0 + ps.rx_trunc1 + ps.rx_trunc2 + ps.rx_trunc3; - eth_stats->ibadcrc = ps.rx_fcs_err; - eth_stats->ibadlen = ps.rx_jabber + ps.rx_too_long + ps.rx_runt; - eth_stats->ierrors = ps.rx_symbol_err + eth_stats->ibadcrc + - eth_stats->ibadlen + ps.rx_len_err + - eth_stats->imissed; - eth_stats->rx_pause_xon = ps.rx_pause; + eth_stats->ierrors = ps.rx_symbol_err + ps.rx_fcs_err + + ps.rx_jabber + ps.rx_too_long + ps.rx_runt + + ps.rx_len_err + eth_stats->imissed;/* TX Stats */ eth_stats->opackets = ps.tx_frames; eth_stats->obytes = ps.tx_octets; eth_stats->oerrors = ps.tx_error_frames; - eth_stats->tx_pause_xon = ps.tx_pause;for (i =0 ; i < pi->n_rx_qsets; i++) { struct sge_eth_rxq *rxq =
Signature · 1 line
2.1.4
PATCH v2 4/7 i40e: don't report deprecated statistics
In reply to Stephen HemmingerThe fields in ethernet statistics that are marked deprecated should not be filled in.
--- drivers/net/i40e/i40e_ethdev.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/net/i40e/i40e_ethdev.c +4 -5
@@ -2043,15 +2043,14 @@ i40e_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->oerrors = ns->eth.tx_errors + pf->main_vsi->eth_stats.tx_errors; stats->imcasts = pf->main_vsi->eth_stats.rx_multicast; - stats->fdirmatch = ns->fd_sb_match;/* Rx Errors */ - stats->ibadcrc = ns->crc_errors; - stats->ibadlen = ns->rx_length_errors + ns->rx_undersize + - ns->rx_oversize + ns->rx_fragments + ns->rx_jabber; stats->imissed = ns->eth.rx_discards + pf->main_vsi->eth_stats.rx_discards; - stats->ierrors = stats->ibadcrc + stats->ibadlen + stats->imissed; + stats->ierrors = ns->crc_errors + + ns->rx_length_errors + ns->rx_undersize + + ns->rx_oversize + ns->rx_fragments + ns->rx_jabber + + stats->imissed;PMD_DRV_LOG (DEBUG ,"***************** PF stats start *******************" );PMD_DRV_LOG (DEBUG ,"rx_bytes: %" PRIu64"" , ns->eth.rx_bytes);
Signature · 1 line
2.1.4
PATCH v2 5/7 e1000: don't report deprecated statistics
In reply to Stephen HemmingerThese fields are marked deprecated don't use them.
--- drivers/net/e1000/em_ethdev.c | 12 ++---------- drivers/net/e1000/igb_ethdev.c | 12 ++---------- 2 files changed, 4 insertions(+), 20 deletions(-)
drivers/net/e1000/em_ethdev.c +2 -10
@@ -911,11 +911,9 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)return ;/* Rx Errors */ - rte_stats->ibadcrc = stats->crcerrs; - rte_stats->ibadlen = stats->rlec + stats->ruc + stats->roc; rte_stats->imissed = stats->mpc; - rte_stats->ierrors = rte_stats->ibadcrc + - rte_stats->ibadlen + + rte_stats->ierrors = stats->crcerrs + + stats->rlec + stats->ruc + stats->roc + rte_stats->imissed + stats->rxerrc + stats->algnerrc + stats->cexterr;
@@ -926,12 +924,6 @@ eth_em_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats) rte_stats->opackets = stats->gptc; rte_stats->ibytes = stats->gorc; rte_stats->obytes = stats->gotc; - -/* XON/XOFF pause frames stats registers */ - rte_stats->tx_pause_xon = stats->xontxc; - rte_stats->rx_pause_xon = stats->xonrxc; - rte_stats->tx_pause_xoff = stats->xofftxc; - rte_stats->rx_pause_xoff = stats->xoffrxc; } static void
drivers/net/e1000/igb_ethdev.c +2 -10
@@ -1589,23 +1589,15 @@ eth_igb_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *rte_stats)return ;/* Rx Errors */ - rte_stats->ibadcrc = stats->crcerrs; - rte_stats->ibadlen = stats->rlec + stats->ruc + stats->roc; rte_stats->imissed = stats->mpc; - rte_stats->ierrors = rte_stats->ibadcrc + - rte_stats->ibadlen + + rte_stats->ierrors = stats->crcerrs + + stats->rlec + stats->ruc + stats->roc + rte_stats->imissed + stats->rxerrc + stats->algnerrc + stats->cexterr;/* Tx Errors */ rte_stats->oerrors = stats->ecol + stats->latecol; -/* XON/XOFF pause frames */ - rte_stats->tx_pause_xon = stats->xontxc; - rte_stats->rx_pause_xon = stats->xonrxc; - rte_stats->tx_pause_xoff = stats->xofftxc; - rte_stats->rx_pause_xoff = stats->xoffrxc; - rte_stats->ipackets = stats->gprc; rte_stats->opackets = stats->gptc; rte_stats->ibytes = stats->gorc;
Signature · 1 line
2.1.4
PATCH v2 6/7 test-pmd: remove references to deprecated statistics
In reply to Stephen HemmingerSome of the statistics are deprecated, so don't test them.
--- app/test-pmd/config.c | 22 ++-------------------- app/test-pmd/testpmd.c | 26 ++------------------------ app/test/test_pmd_perf.c | 7 ++----- 3 files changed, 6 insertions(+), 49 deletions(-)
app/test-pmd/config.c +2 -20
@@ -154,9 +154,7 @@ nic_stats_display(portid_t port_id)printf (" RX-packets: %-10" PRIu64" RX-missed: %-10" PRIu64" RX-bytes: " "%-" PRIu64"\n" , stats.ipackets, stats.imissed, stats.ibytes); -printf (" RX-badcrc: %-10" PRIu64" RX-badlen: %-10" PRIu64" RX-errors: " -"%-" PRIu64"\n" , - stats.ibadcrc, stats.ibadlen, stats.ierrors); +printf (" RX-errors: %-" PRIu64"\n" , stats.ierrors);printf (" RX-nombuf: %-10" PRIu64"\n" , stats.rx_nombuf); printf(" TX-packets: %-10"PRIu64" TX-errors: %-10"PRIu64" TX-bytes: "
@@ -167,9 +165,7 @@ nic_stats_display(portid_t port_id)printf (" RX-packets: %10" PRIu64" RX-errors: %10" PRIu64" RX-bytes: %10" PRIu64"\n" , stats.ipackets, stats.ierrors, stats.ibytes); -printf (" RX-badcrc: %10" PRIu64" RX-badlen: %10" PRIu64 -" RX-errors: %10" PRIu64"\n" , - stats.ibadcrc, stats.ibadlen, stats.ierrors); +printf (" RX-errors: %10" PRIu64"\n" , stats.ierrors);printf (" RX-nombuf: %10" PRIu64"\n" , stats.rx_nombuf); printf(" TX-packets: %10"PRIu64" TX-errors: %10"PRIu64
@@ -177,12 +173,6 @@ nic_stats_display(portid_t port_id) stats.opackets, stats.oerrors, stats.obytes); } -/* stats fdir */ -if (fdir_conf.mode !=RTE_FDIR_MODE_NONE ) -printf (" Fdirmiss: %-10" PRIu64" Fdirmatch: %-10" PRIu64"\n" , - stats.fdirmiss, - stats.fdirmatch); -if (port->rx_queue_stats_mapping_enabled) {printf ("\n" );for (i =0 ; i <RTE_ETHDEV_QUEUE_STAT_CNTRS ; i++) {
@@ -201,14 +191,6 @@ nic_stats_display(portid_t port_id) } } -/* Display statistics of XON/XOFF pause frames, if any. */ -if ((stats.tx_pause_xon | stats.rx_pause_xon | - stats.tx_pause_xoff | stats.rx_pause_xoff) >0 ) { -printf (" RX-XOFF: %-10" PRIu64" RX-XON: %-10" PRIu64"\n" , - stats.rx_pause_xoff, stats.rx_pause_xon); -printf (" TX-XOFF: %-10" PRIu64" TX-XON: %-10" PRIu64"\n" , - stats.tx_pause_xoff, stats.tx_pause_xon); - }printf (" %s############################%s\n" , nic_stats_border, nic_stats_border); }
app/test-pmd/testpmd.c +2 -24
@@ -751,9 +751,7 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)printf (" Bad-ipcsum: %-14" PRIu64" Bad-l4csum: %-14" PRIu64" \n" , port->rx_bad_ip_csum, port->rx_bad_l4_csum);if (((stats->ierrors - stats->imissed) + stats->rx_nombuf) >0 ) { -printf (" RX-badcrc: %-14" PRIu64" RX-badlen: %-14" PRIu64 -"RX-error: %-" PRIu64"\n" , - stats->ibadcrc, stats->ibadlen, stats->ierrors); +printf (" RX-error: %-" PRIu64"\n" , stats->ierrors);printf (" RX-nombufs: %-14" PRIu64"\n" , stats->rx_nombuf); }
@@ -772,9 +770,7 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)printf (" Bad-ipcsum:%14" PRIu64" Bad-l4csum:%14" PRIu64"\n" , port->rx_bad_ip_csum, port->rx_bad_l4_csum);if (((stats->ierrors - stats->imissed) + stats->rx_nombuf) >0 ) { -printf (" RX-badcrc: %14" PRIu64" RX-badlen: %14" PRIu64 -" RX-error:%" PRIu64"\n" , - stats->ibadcrc, stats->ibadlen, stats->ierrors); +printf (" RX-error:%" PRIu64"\n" , stats->ierrors);printf (" RX-nombufs: %14" PRIu64"\n" , stats->rx_nombuf); }
@@ -785,15 +781,6 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats) (uint64_t) (stats->opackets + port->tx_dropped)); } -/* Display statistics of XON/XOFF pause frames, if any. */ -if ((stats->tx_pause_xon | stats->rx_pause_xon | - stats->tx_pause_xoff | stats->rx_pause_xoff) >0 ) { -printf (" RX-XOFF: %-14" PRIu64" RX-XON: %-14" PRIu64"\n" , - stats->rx_pause_xoff, stats->rx_pause_xon); -printf (" TX-XOFF: %-14" PRIu64" TX-XON: %-14" PRIu64"\n" , - stats->tx_pause_xoff, stats->tx_pause_xon); - } -#ifdef RTE_TEST_PMD_RECORD_BURST_STATS if (port->rx_stream) pkt_burst_stats_display("RX",
@@ -802,11 +789,6 @@ fwd_port_stats_display(portid_t port_id, struct rte_eth_stats *stats)pkt_burst_stats_display ("TX" , &port->tx_stream->tx_burst_stats);#endif -/* stats fdir */ -if (fdir_conf.mode !=RTE_FDIR_MODE_NONE ) -printf (" Fdirmiss:%14" PRIu64" Fdirmatch:%14" PRIu64"\n" , - stats->fdirmiss, - stats->fdirmatch);if (port->rx_queue_stats_mapping_enabled) {printf ("\n" );
@@ -1150,10 +1132,6 @@ stop_packet_forwarding(void) port->stats.oerrors =0 ; stats.rx_nombuf -= port->stats.rx_nombuf; port->stats.rx_nombuf =0 ; - stats.fdirmatch -= port->stats.fdirmatch; - port->stats.rx_nombuf =0 ; - stats.fdirmiss -= port->stats.fdirmiss; - port->stats.rx_nombuf =0 ; total_recv += stats.ipackets; total_xmit += stats.opackets;
app/test/test_pmd_perf.c +2 -5
@@ -343,11 +343,8 @@ stats_display(uint8_t port_id)printf (" RX-packets: %-10" PRIu64" RX-missed: %-10" PRIu64" RX-bytes: " "%-" PRIu64"\n" , stats.ipackets, stats.imissed, stats.ibytes); -printf (" RX-badcrc: %-10" PRIu64" RX-badlen: %-10" PRIu64" RX-errors: " -"%-" PRIu64"\n" , - stats.ibadcrc, stats.ibadlen, stats.ierrors); -printf (" RX-nombuf: %-10" PRIu64"\n" , - stats.rx_nombuf); +printf (" RX-errors: %-10" PRIu64" RX-nombuf: %-10" PRIu64"\n" , + stats.ierrors, stats.rx_nombuf);printf (" TX-packets: %-10" PRIu64" TX-errors: %-10" PRIu64" TX-bytes: " "%-" PRIu64"\n" , stats.opackets, stats.oerrors, stats.obytes);
Signature · 1 line
2.1.4
PATCH v2 7/7 rte_ether: mark deprecated statistics with attribute
In reply to Stephen HemmingerUse deprecated attribute to highlight any use of fields that are marked as going away in the rte_ether device statistics.
--- lib/librte_eal/common/include/rte_common.h | 3 +++ lib/librte_ether/rte_ethdev.h | 16 ++++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-)
lib/librte_eal/common/include/rte_common.h +3 -0
@@ -69,6 +69,9 @@ typedef uint32_t unaligned_uint32_t;typedef uint16_t unaligned_uint16_t ;#endif +/******* Macro to mark functions and fields scheduled for removal *****/ +#define __rte_deprecated __attribute__((__deprecated__)) +/*********** Macros to eliminate unused variable warnings ********/ /**
lib/librte_ether/rte_ethdev.h +8 -8
@@ -198,25 +198,25 @@ struct rte_eth_stats {/**< Total of RX packets dropped by the HW, * because there are no available mbufs (i.e. RX queues are full). */ -uint64_t ibadcrc; + uint64_t ibadcrc __rte_deprecated;/**< Deprecated; Total of RX packets with CRC error. */ -uint64_t ibadlen; + uint64_t ibadlen __rte_deprecated;/**< Deprecated; Total of RX packets with bad length. */ uint64_t ierrors;/**< Total number of erroneous received packets. */ uint64_t oerrors;/**< Total number of failed transmitted packets. */ uint64_t imcasts;/**< Total number of multicast received packets. */ uint64_t rx_nombuf;/**< Total number of RX mbuf allocation failures. */ -uint64_t fdirmatch; + uint64_t fdirmatch __rte_deprecated;/**< Deprecated; Total number of RX packets matching a filter. */ -uint64_t fdirmiss; + uint64_t fdirmiss __rte_deprecated;/**< Deprecated; Total number of RX packets not matching any filter. */ -uint64_t tx_pause_xon; + uint64_t tx_pause_xon __rte_deprecated;/**< Deprecated; Total nb. of XON pause frame sent. */ -uint64_t rx_pause_xon; + uint64_t rx_pause_xon __rte_deprecated;/**< Deprecated; Total nb. of XON pause frame received. */ -uint64_t tx_pause_xoff; + uint64_t tx_pause_xoff __rte_deprecated;/**< Deprecated; Total nb. of XOFF pause frame sent. */ -uint64_t rx_pause_xoff; + uint64_t rx_pause_xoff __rte_deprecated;/**< Deprecated; Total nb. of XOFF pause frame received. */ uint64_t q_ipackets[RTE_ETHDEV_QUEUE_STAT_CNTRS ];/**< Total number of queue RX packets. */
Signature · 1 line
2.1.4
Re: [PATCH 7/7] rte_ether: mark deprecated statistics with attribute
2015-11-05 17:04, Stephen Hemminger:
Quoted 2 lines
Use deprecated attribute to highlight any use of fields that are marked as going away in the
rte_etherdevice statistics.
The example app ip_pipeline does not compile.
I will add a patch to fix it.
2015-11-05 17:04, Stephen Hemminger:
Quoted 4 lines
Several fields in ether statistics were tagged with comment that they were going to be deprecated, but comments don't cause compile warnings. Instead use Gcc attributes to force the issue.
Quoted 8 lines
Of course to do that, all the drivers and tests which are using those fields have to be fixed first.
The input multicast statistic was listed as deprecated, but I find it useful, and therefore the first patch is to revive it.
Stephen Hemminger (7):
ether: don't mark input multicast for deprecation
not applied
Quoted 6 lines
bond: don't sum deprecated statistics
cxgbe: don't report deprecated statistics
i40e: don't report deprecated statistics
e1000: don't report deprecated statistics
test-pmd: remove references to deprecated statistics
rte_ether: mark deprecated statistics with attribute
The rest is applied with an extra patch for ip_pipeline example. Thanks