Skip to content

Commit 897ddc2

Browse files
Intiyaz Bashadavem330
authored andcommitted
liquidio: Enhanced ethtool stats
1. Added red_drops stats. Inbound packets dropped by RED, buffer exhaustion 2. Included fcs_err, jabber_err, l2_err and frame_err errors under rx_errors 3. Included fifo_err, dmac_drop, red_drops, fw_err_pko, fw_err_link and fw_err_drop under rx_dropped 4. Included max_collision_fail, max_deferral_fail, total_collisions, fw_err_pko, fw_err_link, fw_err_drop and fw_err_pki under tx_dropped 5. Counting dma mapping errors 6. Added some firmware stats description and removed for some Signed-off-by: Intiyaz Basha <[email protected]> Acked-by: Derek Chickles <[email protected]> Acked-by: Satanand Burla <[email protected]> Signed-off-by: Felix Manlunas <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ef53e9e commit 897ddc2

File tree

4 files changed

+86
-49
lines changed

4 files changed

+86
-49
lines changed

drivers/net/ethernet/cavium/liquidio/lio_ethtool.c

Lines changed: 33 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,9 @@ static const char oct_stats_strings[][ETH_GSTRING_LEN] = {
9696
"tx_packets",
9797
"rx_bytes",
9898
"tx_bytes",
99-
"rx_errors", /*jabber_err+l2_err+frame_err */
100-
"tx_errors", /*fw_err_pko+fw_err_link+fw_err_drop */
101-
"rx_dropped", /*st->fromwire.total_rcvd - st->fromwire.fw_total_rcvd +
102-
*st->fromwire.dmac_drop + st->fromwire.fw_err_drop
103-
*/
99+
"rx_errors",
100+
"tx_errors",
101+
"rx_dropped",
104102
"tx_dropped",
105103

106104
"tx_total_sent",
@@ -119,7 +117,7 @@ static const char oct_stats_strings[][ETH_GSTRING_LEN] = {
119117
"mac_tx_total_bytes",
120118
"mac_tx_mcast_pkts",
121119
"mac_tx_bcast_pkts",
122-
"mac_tx_ctl_packets", /*oct->link_stats.fromhost.ctl_sent */
120+
"mac_tx_ctl_packets",
123121
"mac_tx_total_collisions",
124122
"mac_tx_one_collision",
125123
"mac_tx_multi_collison",
@@ -170,17 +168,17 @@ static const char oct_vf_stats_strings[][ETH_GSTRING_LEN] = {
170168
"tx_packets",
171169
"rx_bytes",
172170
"tx_bytes",
173-
"rx_errors", /* jabber_err + l2_err+frame_err */
174-
"tx_errors", /* fw_err_pko + fw_err_link+fw_err_drop */
175-
"rx_dropped", /* total_rcvd - fw_total_rcvd + dmac_drop + fw_err_drop */
171+
"rx_errors",
172+
"tx_errors",
173+
"rx_dropped",
176174
"tx_dropped",
177175
"link_state_changes",
178176
};
179177

180178
/* statistics of host tx queue */
181179
static const char oct_iq_stats_strings[][ETH_GSTRING_LEN] = {
182-
"packets", /*oct->instr_queue[iq_no]->stats.tx_done*/
183-
"bytes", /*oct->instr_queue[iq_no]->stats.tx_tot_bytes*/
180+
"packets",
181+
"bytes",
184182
"dropped",
185183
"iq_busy",
186184
"sgentry_sent",
@@ -197,13 +195,9 @@ static const char oct_iq_stats_strings[][ETH_GSTRING_LEN] = {
197195

198196
/* statistics of host rx queue */
199197
static const char oct_droq_stats_strings[][ETH_GSTRING_LEN] = {
200-
"packets", /*oct->droq[oq_no]->stats.rx_pkts_received */
201-
"bytes", /*oct->droq[oq_no]->stats.rx_bytes_received */
202-
"dropped", /*oct->droq[oq_no]->stats.rx_dropped+
203-
*oct->droq[oq_no]->stats.dropped_nodispatch+
204-
*oct->droq[oq_no]->stats.dropped_toomany+
205-
*oct->droq[oq_no]->stats.dropped_nomem
206-
*/
198+
"packets",
199+
"bytes",
200+
"dropped",
207201
"dropped_nomem",
208202
"dropped_toomany",
209203
"fw_dropped",
@@ -1080,16 +1074,33 @@ lio_get_ethtool_stats(struct net_device *netdev,
10801074
data[i++] = CVM_CAST64(netstats->rx_bytes);
10811075
/*sum of oct->instr_queue[iq_no]->stats.tx_tot_bytes */
10821076
data[i++] = CVM_CAST64(netstats->tx_bytes);
1083-
data[i++] = CVM_CAST64(netstats->rx_errors);
1077+
data[i++] = CVM_CAST64(netstats->rx_errors +
1078+
oct_dev->link_stats.fromwire.fcs_err +
1079+
oct_dev->link_stats.fromwire.jabber_err +
1080+
oct_dev->link_stats.fromwire.l2_err +
1081+
oct_dev->link_stats.fromwire.frame_err);
10841082
data[i++] = CVM_CAST64(netstats->tx_errors);
10851083
/*sum of oct->droq[oq_no]->stats->rx_dropped +
10861084
*oct->droq[oq_no]->stats->dropped_nodispatch +
10871085
*oct->droq[oq_no]->stats->dropped_toomany +
10881086
*oct->droq[oq_no]->stats->dropped_nomem
10891087
*/
1090-
data[i++] = CVM_CAST64(netstats->rx_dropped);
1088+
data[i++] = CVM_CAST64(netstats->rx_dropped +
1089+
oct_dev->link_stats.fromwire.fifo_err +
1090+
oct_dev->link_stats.fromwire.dmac_drop +
1091+
oct_dev->link_stats.fromwire.red_drops +
1092+
oct_dev->link_stats.fromwire.fw_err_pko +
1093+
oct_dev->link_stats.fromwire.fw_err_link +
1094+
oct_dev->link_stats.fromwire.fw_err_drop);
10911095
/*sum of oct->instr_queue[iq_no]->stats.tx_dropped */
1092-
data[i++] = CVM_CAST64(netstats->tx_dropped);
1096+
data[i++] = CVM_CAST64(netstats->tx_dropped +
1097+
oct_dev->link_stats.fromhost.max_collision_fail +
1098+
oct_dev->link_stats.fromhost.max_deferral_fail +
1099+
oct_dev->link_stats.fromhost.total_collisions +
1100+
oct_dev->link_stats.fromhost.fw_err_pko +
1101+
oct_dev->link_stats.fromhost.fw_err_link +
1102+
oct_dev->link_stats.fromhost.fw_err_drop +
1103+
oct_dev->link_stats.fromhost.fw_err_pki);
10931104

10941105
/* firmware tx stats */
10951106
/*per_core_stats[cvmx_get_core_num()].link_stats[mdata->from_ifidx].
@@ -1798,6 +1809,7 @@ octnet_nic_stats_callback(struct octeon_device *oct_dev,
17981809
rstats->jabber_err = rsp_rstats->jabber_err;
17991810
rstats->l2_err = rsp_rstats->l2_err;
18001811
rstats->frame_err = rsp_rstats->frame_err;
1812+
rstats->red_drops = rsp_rstats->red_drops;
18011813

18021814
/* RX firmware stats */
18031815
rstats->fw_total_rcvd = rsp_rstats->fw_total_rcvd;

drivers/net/ethernet/cavium/liquidio/lio_main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2585,6 +2585,7 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)
25852585
if (dma_mapping_error(&oct->pci_dev->dev, dptr)) {
25862586
dev_err(&oct->pci_dev->dev, "%s DMA mapping error 1\n",
25872587
__func__);
2588+
stats->tx_dmamap_fail++;
25882589
return NETDEV_TX_BUSY;
25892590
}
25902591

@@ -2624,6 +2625,7 @@ static int liquidio_xmit(struct sk_buff *skb, struct net_device *netdev)
26242625
if (dma_mapping_error(&oct->pci_dev->dev, g->sg[0].ptr[0])) {
26252626
dev_err(&oct->pci_dev->dev, "%s DMA mapping error 2\n",
26262627
__func__);
2628+
stats->tx_dmamap_fail++;
26272629
return NETDEV_TX_BUSY;
26282630
}
26292631
add_sg_size(&g->sg[0], (skb->len - skb->data_len), 0);

drivers/net/ethernet/cavium/liquidio/liquidio_common.h

Lines changed: 49 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -779,18 +779,24 @@ struct liquidio_if_cfg_info {
779779
/** Stats for each NIC port in RX direction. */
780780
struct nic_rx_stats {
781781
/* link-level stats */
782-
u64 total_rcvd;
783-
u64 bytes_rcvd;
784-
u64 total_bcst;
785-
u64 total_mcst;
786-
u64 runts;
787-
u64 ctl_rcvd;
788-
u64 fifo_err; /* Accounts for over/under-run of buffers */
789-
u64 dmac_drop;
790-
u64 fcs_err;
791-
u64 jabber_err;
792-
u64 l2_err;
793-
u64 frame_err;
782+
u64 total_rcvd; /* Received packets */
783+
u64 bytes_rcvd; /* Octets of received packets */
784+
u64 total_bcst; /* Number of non-dropped L2 broadcast packets */
785+
u64 total_mcst; /* Number of non-dropped L2 multicast packets */
786+
u64 runts; /* Packets shorter than allowed */
787+
u64 ctl_rcvd; /* Received PAUSE packets */
788+
u64 fifo_err; /* Packets dropped due to RX FIFO full */
789+
u64 dmac_drop; /* Packets dropped by the DMAC filter */
790+
u64 fcs_err; /* Sum of fragment, overrun, and FCS errors */
791+
u64 jabber_err; /* Packets larger than allowed */
792+
u64 l2_err; /* Sum of DMA, parity, PCAM access, no memory,
793+
* buffer overflow, malformed L2 header or
794+
* length, oversize errors
795+
**/
796+
u64 frame_err; /* Sum of IPv4 and L4 checksum errors */
797+
u64 red_drops; /* Packets dropped by RED due to buffer
798+
* exhaustion
799+
**/
794800

795801
/* firmware stats */
796802
u64 fw_total_rcvd;
@@ -806,30 +812,47 @@ struct nic_rx_stats {
806812
u64 fw_lro_pkts; /* Number of packets that are LROed */
807813
u64 fw_lro_octs; /* Number of octets that are LROed */
808814
u64 fw_total_lro; /* Number of LRO packets formed */
809-
u64 fw_lro_aborts; /* Number of times lRO of packet aborted */
815+
u64 fw_lro_aborts; /* Number of times LRO of packet aborted */
810816
u64 fw_lro_aborts_port;
811817
u64 fw_lro_aborts_seq;
812818
u64 fw_lro_aborts_tsval;
813-
u64 fw_lro_aborts_timer;
819+
u64 fw_lro_aborts_timer; /* Timer setting error */
814820
/* intrmod: packet forward rate */
815821
u64 fwd_rate;
816822
};
817823

818824
/** Stats for each NIC port in RX direction. */
819825
struct nic_tx_stats {
820826
/* link-level stats */
821-
u64 total_pkts_sent;
822-
u64 total_bytes_sent;
823-
u64 mcast_pkts_sent;
824-
u64 bcast_pkts_sent;
825-
u64 ctl_sent;
826-
u64 one_collision_sent; /* Packets sent after one collision*/
827-
u64 multi_collision_sent; /* Packets sent after multiple collision*/
828-
u64 max_collision_fail; /* Packets not sent due to max collisions */
829-
u64 max_deferral_fail; /* Packets not sent due to max deferrals */
830-
u64 fifo_err; /* Accounts for over/under-run of buffers */
831-
u64 runts;
832-
u64 total_collisions; /* Total number of collisions detected */
827+
u64 total_pkts_sent; /* Total frames sent on the interface */
828+
u64 total_bytes_sent; /* Total octets sent on the interface */
829+
u64 mcast_pkts_sent; /* Packets sent to the multicast DMAC */
830+
u64 bcast_pkts_sent; /* Packets sent to a broadcast DMAC */
831+
u64 ctl_sent; /* Control/PAUSE packets sent */
832+
u64 one_collision_sent; /* Packets sent that experienced a
833+
* single collision before successful
834+
* transmission
835+
**/
836+
u64 multi_collision_sent; /* Packets sent that experienced
837+
* multiple collisions before successful
838+
* transmission
839+
**/
840+
u64 max_collision_fail; /* Packets dropped due to excessive
841+
* collisions
842+
**/
843+
u64 max_deferral_fail; /* Packets not sent due to max
844+
* deferrals
845+
**/
846+
u64 fifo_err; /* Packets sent that experienced a
847+
* transmit underflow and were
848+
* truncated
849+
**/
850+
u64 runts; /* Packets sent with an octet count
851+
* lessthan 64
852+
**/
853+
u64 total_collisions; /* Packets dropped due to excessive
854+
* collisions
855+
**/
833856

834857
/* firmware stats */
835858
u64 fw_total_sent;

drivers/net/ethernet/cavium/liquidio/octeon_iq.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ struct oct_iq_stats {
6262
u64 tx_tot_bytes;/**< Total count of bytes sento to network. */
6363
u64 tx_gso; /* count of tso */
6464
u64 tx_vxlan; /* tunnel */
65-
u64 tx_dmamap_fail;
66-
u64 tx_restart;
65+
u64 tx_dmamap_fail; /* Number of times dma mapping failed */
66+
u64 tx_restart; /* Number of times this queue restarted */
6767
};
6868

6969
#define OCT_IQ_STATS_SIZE (sizeof(struct oct_iq_stats))

0 commit comments

Comments
 (0)