i40e/i40evf: Add stats to count Tunnel ATR hits
authorAnjali Singhai Jain <anjali.singhai@intel.com>
Fri, 17 Apr 2015 00:06:01 +0000 (20:06 -0400)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Thu, 28 May 2015 10:38:00 +0000 (03:38 -0700)
Add a 3rd dynamic filter counter to track Tunneled ATR hits separately.
Ethtool port stat "fdir_atr_tunnel_match"

Change-ID: Idd978b6db2a462b5722397cd2ffd04ef055f8655
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Tested-by: Jim Young <james.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e.h
drivers/net/ethernet/intel/i40e/i40e_ethtool.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40e/i40e_txrx.c
drivers/net/ethernet/intel/i40e/i40e_type.h
drivers/net/ethernet/intel/i40evf/i40e_type.h

index 33c35d3b7420fa9ae545aea4ebd5160036914718..0bfa5a05fab1f4fd3b87bcad5a1510f4307b345b 100644 (file)
@@ -182,6 +182,7 @@ struct i40e_lump_tracking {
 enum i40e_fd_stat_idx {
        I40E_FD_STAT_ATR,
        I40E_FD_STAT_SB,
+       I40E_FD_STAT_ATR_TUNNEL,
        I40E_FD_STAT_PF_COUNT
 };
 #define I40E_FD_STAT_PF_IDX(pf_id) ((pf_id) * I40E_FD_STAT_PF_COUNT)
@@ -189,6 +190,8 @@ enum i40e_fd_stat_idx {
                        (I40E_FD_STAT_PF_IDX(pf_id) + I40E_FD_STAT_ATR)
 #define I40E_FD_SB_STAT_IDX(pf_id)  \
                        (I40E_FD_STAT_PF_IDX(pf_id) + I40E_FD_STAT_SB)
+#define I40E_FD_ATR_TUNNEL_STAT_IDX(pf_id) \
+                       (I40E_FD_STAT_PF_IDX(pf_id) + I40E_FD_STAT_ATR_TUNNEL)
 
 struct i40e_fdir_filter {
        struct hlist_node fdir_node;
index e77b6bddd90e9c06d9296c229411aafc165251e8..c568c901453e04b385500ae357889ac4aa2019a6 100644 (file)
@@ -147,6 +147,7 @@ static struct i40e_stats i40e_gstrings_stats[] = {
        I40E_PF_STAT("rx_hwtstamp_cleared", rx_hwtstamp_cleared),
        I40E_PF_STAT("fdir_flush_cnt", fd_flush_cnt),
        I40E_PF_STAT("fdir_atr_match", stats.fd_atr_match),
+       I40E_PF_STAT("fdir_atr_tunnel_match", stats.fd_atr_tunnel_match),
        I40E_PF_STAT("fdir_sb_match", stats.fd_sb_match),
 
        /* LPI stats */
index f1a8c4c1e3895e386edd6c8b7851e6c139f06581..e70a616bb658cbc05b5f6622dee613ea5a3890c5 100644 (file)
@@ -1102,6 +1102,10 @@ static void i40e_update_pf_stats(struct i40e_pf *pf)
        i40e_stat_update32(hw, I40E_GLQF_PCNT(pf->fd_sb_cnt_idx),
                           pf->stat_offsets_loaded,
                           &osd->fd_sb_match, &nsd->fd_sb_match);
+       i40e_stat_update32(hw,
+                     I40E_GLQF_PCNT(I40E_FD_ATR_TUNNEL_STAT_IDX(pf->hw.pf_id)),
+                     pf->stat_offsets_loaded,
+                     &osd->fd_atr_tunnel_match, &nsd->fd_atr_tunnel_match);
 
        val = rd32(hw, I40E_PRTPM_EEE_STAT);
        nsd->tx_lpi_status =
index 8565495b86805b9c3efdcfffde78a1549addcfba..fc4ec82caf1f8cd1321f088d24c3cd2c25d8306f 100644 (file)
@@ -2033,9 +2033,16 @@ static void i40e_atr(struct i40e_ring *tx_ring, struct sk_buff *skb,
                     I40E_TXD_FLTR_QW1_FD_STATUS_SHIFT;
 
        dtype_cmd |= I40E_TXD_FLTR_QW1_CNT_ENA_MASK;
-       dtype_cmd |=
-               ((u32)pf->fd_atr_cnt_idx << I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT) &
-               I40E_TXD_FLTR_QW1_CNTINDEX_MASK;
+       if (!(tx_flags & I40E_TX_FLAGS_VXLAN_TUNNEL))
+               dtype_cmd |=
+                       ((u32)I40E_FD_ATR_STAT_IDX(pf->hw.pf_id) <<
+                       I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT) &
+                       I40E_TXD_FLTR_QW1_CNTINDEX_MASK;
+       else
+               dtype_cmd |=
+                       ((u32)I40E_FD_ATR_TUNNEL_STAT_IDX(pf->hw.pf_id) <<
+                       I40E_TXD_FLTR_QW1_CNTINDEX_SHIFT) &
+                       I40E_TXD_FLTR_QW1_CNTINDEX_MASK;
 
        fdir_desc->qindex_flex_ptype_vsi = cpu_to_le32(flex_ptype);
        fdir_desc->rsvd = cpu_to_le32(0);
index 568e855da0f3e16b29a81702766070974dd3da91..9a5a75b1e2bc053b50bec13adde2fd3aa4848595 100644 (file)
@@ -1133,6 +1133,7 @@ struct i40e_hw_port_stats {
        /* flow director stats */
        u64 fd_atr_match;
        u64 fd_sb_match;
+       u64 fd_atr_tunnel_match;
        /* EEE LPI */
        u32 tx_lpi_status;
        u32 rx_lpi_status;
index ec9d83a9337944f20f934cf6217467ee61ec7303..c463ec41579c708ffbe606ea0b31ca0485ea4c58 100644 (file)
@@ -1108,6 +1108,7 @@ struct i40e_hw_port_stats {
        /* flow director stats */
        u64 fd_atr_match;
        u64 fd_sb_match;
+       u64 fd_atr_tunnel_match;
        /* EEE LPI */
        u32 tx_lpi_status;
        u32 rx_lpi_status;