aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf.h2
-rw-r--r--drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c23
2 files changed, 18 insertions, 7 deletions
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
index dbdf39bddd4c..fc0af9a3bb35 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf.h
@@ -74,6 +74,8 @@ struct ixgbevf_ring {
74 u64 total_bytes; 74 u64 total_bytes;
75 u64 total_packets; 75 u64 total_packets;
76 struct u64_stats_sync syncp; 76 struct u64_stats_sync syncp;
77 u64 hw_csum_rx_error;
78 u64 hw_csum_rx_good;
77 79
78 u16 head; 80 u16 head;
79 u16 tail; 81 u16 tail;
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index a52b14e6fa3a..f267c003a1bc 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -295,12 +295,11 @@ static void ixgbevf_receive_skb(struct ixgbevf_q_vector *q_vector,
295 295
296/** 296/**
297 * ixgbevf_rx_checksum - indicate in skb if hw indicated a good cksum 297 * ixgbevf_rx_checksum - indicate in skb if hw indicated a good cksum
298 * @adapter: address of board private structure 298 * @ring: pointer to Rx descriptor ring structure
299 * @status_err: hardware indication of status of receive 299 * @status_err: hardware indication of status of receive
300 * @skb: skb currently being received and modified 300 * @skb: skb currently being received and modified
301 **/ 301 **/
302static inline void ixgbevf_rx_checksum(struct ixgbevf_adapter *adapter, 302static inline void ixgbevf_rx_checksum(struct ixgbevf_ring *ring,
303 struct ixgbevf_ring *ring,
304 u32 status_err, struct sk_buff *skb) 303 u32 status_err, struct sk_buff *skb)
305{ 304{
306 skb_checksum_none_assert(skb); 305 skb_checksum_none_assert(skb);
@@ -312,7 +311,7 @@ static inline void ixgbevf_rx_checksum(struct ixgbevf_adapter *adapter,
312 /* if IP and error */ 311 /* if IP and error */
313 if ((status_err & IXGBE_RXD_STAT_IPCS) && 312 if ((status_err & IXGBE_RXD_STAT_IPCS) &&
314 (status_err & IXGBE_RXDADV_ERR_IPE)) { 313 (status_err & IXGBE_RXDADV_ERR_IPE)) {
315 adapter->hw_csum_rx_error++; 314 ring->hw_csum_rx_error++;
316 return; 315 return;
317 } 316 }
318 317
@@ -320,13 +319,13 @@ static inline void ixgbevf_rx_checksum(struct ixgbevf_adapter *adapter,
320 return; 319 return;
321 320
322 if (status_err & IXGBE_RXDADV_ERR_TCPE) { 321 if (status_err & IXGBE_RXDADV_ERR_TCPE) {
323 adapter->hw_csum_rx_error++; 322 ring->hw_csum_rx_error++;
324 return; 323 return;
325 } 324 }
326 325
327 /* It must be a TCP or UDP packet with a valid checksum */ 326 /* It must be a TCP or UDP packet with a valid checksum */
328 skb->ip_summed = CHECKSUM_UNNECESSARY; 327 skb->ip_summed = CHECKSUM_UNNECESSARY;
329 adapter->hw_csum_rx_good++; 328 ring->hw_csum_rx_good++;
330} 329}
331 330
332/** 331/**
@@ -462,7 +461,7 @@ static bool ixgbevf_clean_rx_irq(struct ixgbevf_q_vector *q_vector,
462 goto next_desc; 461 goto next_desc;
463 } 462 }
464 463
465 ixgbevf_rx_checksum(adapter, rx_ring, staterr, skb); 464 ixgbevf_rx_checksum(rx_ring, staterr, skb);
466 465
467 /* probably a little skewed due to removing CRC */ 466 /* probably a little skewed due to removing CRC */
468 total_rx_bytes += skb->len; 467 total_rx_bytes += skb->len;
@@ -2094,6 +2093,7 @@ out:
2094void ixgbevf_update_stats(struct ixgbevf_adapter *adapter) 2093void ixgbevf_update_stats(struct ixgbevf_adapter *adapter)
2095{ 2094{
2096 struct ixgbe_hw *hw = &adapter->hw; 2095 struct ixgbe_hw *hw = &adapter->hw;
2096 int i;
2097 2097
2098 UPDATE_VF_COUNTER_32bit(IXGBE_VFGPRC, adapter->stats.last_vfgprc, 2098 UPDATE_VF_COUNTER_32bit(IXGBE_VFGPRC, adapter->stats.last_vfgprc,
2099 adapter->stats.vfgprc); 2099 adapter->stats.vfgprc);
@@ -2107,6 +2107,15 @@ void ixgbevf_update_stats(struct ixgbevf_adapter *adapter)
2107 adapter->stats.vfgotc); 2107 adapter->stats.vfgotc);
2108 UPDATE_VF_COUNTER_32bit(IXGBE_VFMPRC, adapter->stats.last_vfmprc, 2108 UPDATE_VF_COUNTER_32bit(IXGBE_VFMPRC, adapter->stats.last_vfmprc,
2109 adapter->stats.vfmprc); 2109 adapter->stats.vfmprc);
2110
2111 for (i = 0; i < adapter->num_rx_queues; i++) {
2112 adapter->hw_csum_rx_error +=
2113 adapter->rx_ring[i].hw_csum_rx_error;
2114 adapter->hw_csum_rx_good +=
2115 adapter->rx_ring[i].hw_csum_rx_good;
2116 adapter->rx_ring[i].hw_csum_rx_error = 0;
2117 adapter->rx_ring[i].hw_csum_rx_good = 0;
2118 }
2110} 2119}
2111 2120
2112/** 2121/**