Commit 8670f2a5 authored by Sriharsha Basavapatna's avatar Sriharsha Basavapatna Committed by David S. Miller

be2net: Support vxlan offload stats in the driver

This patch adds vxlan offload specific counters to ethtool stats. We
provide tx/rx queue counters to show the number of vxlan offload pkts
sent/received.
Signed-off-by: default avatarSriharsha Basavapatna <sriharsha.basavapatna@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 05cc5a39
...@@ -230,6 +230,7 @@ struct be_mcc_obj { ...@@ -230,6 +230,7 @@ struct be_mcc_obj {
struct be_tx_stats { struct be_tx_stats {
u64 tx_bytes; u64 tx_bytes;
u64 tx_pkts; u64 tx_pkts;
u64 tx_vxlan_offload_pkts;
u64 tx_reqs; u64 tx_reqs;
u64 tx_compl; u64 tx_compl;
ulong tx_jiffies; ulong tx_jiffies;
...@@ -277,6 +278,7 @@ struct be_rx_page_info { ...@@ -277,6 +278,7 @@ struct be_rx_page_info {
struct be_rx_stats { struct be_rx_stats {
u64 rx_bytes; u64 rx_bytes;
u64 rx_pkts; u64 rx_pkts;
u64 rx_vxlan_offload_pkts;
u32 rx_drops_no_skbs; /* skb allocation errors */ u32 rx_drops_no_skbs; /* skb allocation errors */
u32 rx_drops_no_frags; /* HW has no fetched frags */ u32 rx_drops_no_frags; /* HW has no fetched frags */
u32 rx_post_fail; /* page post alloc failures */ u32 rx_post_fail; /* page post alloc failures */
......
...@@ -138,6 +138,7 @@ static const struct be_ethtool_stat et_stats[] = { ...@@ -138,6 +138,7 @@ static const struct be_ethtool_stat et_stats[] = {
static const struct be_ethtool_stat et_rx_stats[] = { static const struct be_ethtool_stat et_rx_stats[] = {
{DRVSTAT_RX_INFO(rx_bytes)},/* If moving this member see above note */ {DRVSTAT_RX_INFO(rx_bytes)},/* If moving this member see above note */
{DRVSTAT_RX_INFO(rx_pkts)}, /* If moving this member see above note */ {DRVSTAT_RX_INFO(rx_pkts)}, /* If moving this member see above note */
{DRVSTAT_RX_INFO(rx_vxlan_offload_pkts)},
{DRVSTAT_RX_INFO(rx_compl)}, {DRVSTAT_RX_INFO(rx_compl)},
{DRVSTAT_RX_INFO(rx_compl_err)}, {DRVSTAT_RX_INFO(rx_compl_err)},
{DRVSTAT_RX_INFO(rx_mcast_pkts)}, {DRVSTAT_RX_INFO(rx_mcast_pkts)},
...@@ -190,6 +191,7 @@ static const struct be_ethtool_stat et_tx_stats[] = { ...@@ -190,6 +191,7 @@ static const struct be_ethtool_stat et_tx_stats[] = {
{DRVSTAT_TX_INFO(tx_internal_parity_err)}, {DRVSTAT_TX_INFO(tx_internal_parity_err)},
{DRVSTAT_TX_INFO(tx_bytes)}, {DRVSTAT_TX_INFO(tx_bytes)},
{DRVSTAT_TX_INFO(tx_pkts)}, {DRVSTAT_TX_INFO(tx_pkts)},
{DRVSTAT_TX_INFO(tx_vxlan_offload_pkts)},
/* Number of skbs queued for trasmission by the driver */ /* Number of skbs queued for trasmission by the driver */
{DRVSTAT_TX_INFO(tx_reqs)}, {DRVSTAT_TX_INFO(tx_reqs)},
/* Number of times the TX queue was stopped due to lack /* Number of times the TX queue was stopped due to lack
......
...@@ -677,11 +677,14 @@ void be_link_status_update(struct be_adapter *adapter, u8 link_status) ...@@ -677,11 +677,14 @@ void be_link_status_update(struct be_adapter *adapter, u8 link_status)
static void be_tx_stats_update(struct be_tx_obj *txo, struct sk_buff *skb) static void be_tx_stats_update(struct be_tx_obj *txo, struct sk_buff *skb)
{ {
struct be_tx_stats *stats = tx_stats(txo); struct be_tx_stats *stats = tx_stats(txo);
u64 tx_pkts = skb_shinfo(skb)->gso_segs ? : 1;
u64_stats_update_begin(&stats->sync); u64_stats_update_begin(&stats->sync);
stats->tx_reqs++; stats->tx_reqs++;
stats->tx_bytes += skb->len; stats->tx_bytes += skb->len;
stats->tx_pkts += (skb_shinfo(skb)->gso_segs ? : 1); stats->tx_pkts += tx_pkts;
if (skb->encapsulation && skb->ip_summed == CHECKSUM_PARTIAL)
stats->tx_vxlan_offload_pkts += tx_pkts;
u64_stats_update_end(&stats->sync); u64_stats_update_end(&stats->sync);
} }
...@@ -1957,6 +1960,8 @@ static void be_rx_stats_update(struct be_rx_obj *rxo, ...@@ -1957,6 +1960,8 @@ static void be_rx_stats_update(struct be_rx_obj *rxo,
stats->rx_compl++; stats->rx_compl++;
stats->rx_bytes += rxcp->pkt_size; stats->rx_bytes += rxcp->pkt_size;
stats->rx_pkts++; stats->rx_pkts++;
if (rxcp->tunneled)
stats->rx_vxlan_offload_pkts++;
if (rxcp->pkt_type == BE_MULTICAST_PACKET) if (rxcp->pkt_type == BE_MULTICAST_PACKET)
stats->rx_mcast_pkts++; stats->rx_mcast_pkts++;
if (rxcp->err) if (rxcp->err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment