Skip to content

Commit a8a43fd

Browse files
Shannon NelsonJeff Kirsher
authored andcommitted
ixgbe: ipsec offload stats
Add a simple statistic to count the ipsec offloads. Signed-off-by: Shannon Nelson <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 5925947 commit a8a43fd

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,10 +637,12 @@ struct ixgbe_adapter {
637637
int num_tx_queues;
638638
u16 tx_itr_setting;
639639
u16 tx_work_limit;
640+
u64 tx_ipsec;
640641

641642
/* Rx fast path data */
642643
int num_rx_queues;
643644
u16 rx_itr_setting;
645+
u64 rx_ipsec;
644646

645647
/* Port number used to identify VXLAN traffic */
646648
__be16 vxlan_port;

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,8 @@ static const struct ixgbe_stats ixgbe_gstrings_stats[] = {
115115
{"tx_hwtstamp_timeouts", IXGBE_STAT(tx_hwtstamp_timeouts)},
116116
{"tx_hwtstamp_skipped", IXGBE_STAT(tx_hwtstamp_skipped)},
117117
{"rx_hwtstamp_cleared", IXGBE_STAT(rx_hwtstamp_cleared)},
118+
{"tx_ipsec", IXGBE_STAT(tx_ipsec)},
119+
{"rx_ipsec", IXGBE_STAT(rx_ipsec)},
118120
#ifdef IXGBE_FCOE
119121
{"fcoe_bad_fccrc", IXGBE_STAT(stats.fccrc)},
120122
{"rx_fcoe_dropped", IXGBE_STAT(stats.fcoerpdc)},

drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -852,6 +852,8 @@ void ixgbe_ipsec_rx(struct ixgbe_ring *rx_ring,
852852
xo = xfrm_offload(skb);
853853
xo->flags = CRYPTO_DONE;
854854
xo->status = CRYPTO_SUCCESS;
855+
856+
adapter->rx_ipsec++;
855857
}
856858

857859
/**

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1171,7 +1171,7 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
11711171
struct ixgbe_adapter *adapter = q_vector->adapter;
11721172
struct ixgbe_tx_buffer *tx_buffer;
11731173
union ixgbe_adv_tx_desc *tx_desc;
1174-
unsigned int total_bytes = 0, total_packets = 0;
1174+
unsigned int total_bytes = 0, total_packets = 0, total_ipsec = 0;
11751175
unsigned int budget = q_vector->tx.work_limit;
11761176
unsigned int i = tx_ring->next_to_clean;
11771177

@@ -1202,6 +1202,8 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
12021202
/* update the statistics for this packet */
12031203
total_bytes += tx_buffer->bytecount;
12041204
total_packets += tx_buffer->gso_segs;
1205+
if (tx_buffer->tx_flags & IXGBE_TX_FLAGS_IPSEC)
1206+
total_ipsec++;
12051207

12061208
/* free the skb */
12071209
if (ring_is_xdp(tx_ring))
@@ -1264,6 +1266,7 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
12641266
u64_stats_update_end(&tx_ring->syncp);
12651267
q_vector->tx.total_bytes += total_bytes;
12661268
q_vector->tx.total_packets += total_packets;
1269+
adapter->tx_ipsec += total_ipsec;
12671270

12681271
if (check_for_tx_hang(tx_ring) && ixgbe_check_tx_hang(tx_ring)) {
12691272
/* schedule immediate reset if we believe we hung */

0 commit comments

Comments
 (0)