OSDN Git Service

igc: Remove ethertype filter in PTP code
authorAndre Guedes <andre.guedes@intel.com>
Tue, 7 Apr 2020 21:07:08 +0000 (14:07 -0700)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tue, 19 May 2020 22:35:42 +0000 (15:35 -0700)
The driver only supports hardware timestamping for all incoming
traffic (HWTSTAMP_FILTER_ALL) which is enabled via Rx Time Sync
Control (TSYNCRXCTL) register already. Therefore, the ethertype
filter set in in igc_ptp_set_timestamp_mode() is useless so this
patch removes it.

Signed-off-by: Andre Guedes <andre.guedes@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/igc/igc.h
drivers/net/ethernet/intel/igc/igc_defines.h
drivers/net/ethernet/intel/igc/igc_ptp.c

index 5f1e1d3..e4169fe 100644 (file)
@@ -26,7 +26,7 @@ void igc_set_ethtool_ops(struct net_device *);
 #define MAX_Q_VECTORS                  8
 #define MAX_STD_JUMBO_FRAME_SIZE       9216
 
-#define MAX_ETYPE_FILTER               (4 - 1)
+#define MAX_ETYPE_FILTER               4
 #define IGC_RETA_SIZE                  128
 
 struct igc_tx_queue_stats {
index f1bb541..6909826 100644 (file)
 
 #define IGC_TSICR_INTERRUPTS   IGC_TSICR_TXTS
 
-/* PTP Queue Filter */
-#define IGC_ETQF_1588          BIT(30)
-
 #define IGC_FTQF_VF_BP         0x00008000
 #define IGC_FTQF_1588_TIME_STAMP       0x08000000
 #define IGC_FTQF_MASK                  0xF0000000
index 1bf0163..0d746f8 100644 (file)
@@ -305,7 +305,6 @@ static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,
        struct igc_hw *hw = &adapter->hw;
        u32 tsync_rx_cfg = 0;
        bool is_l4 = false;
-       bool is_l2 = false;
        u32 regval;
 
        /* reserved for future extensions */
@@ -346,7 +345,6 @@ static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,
        case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
                tsync_rx_ctl |= IGC_TSYNCRXCTL_TYPE_EVENT_V2;
                config->rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
-               is_l2 = true;
                is_l4 = true;
                break;
        case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
@@ -370,7 +368,6 @@ static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,
                tsync_rx_ctl |= IGC_TSYNCRXCTL_TYPE_ALL;
                tsync_rx_ctl |= IGC_TSYNCRXCTL_RXSYNSIG;
                config->rx_filter = HWTSTAMP_FILTER_ALL;
-               is_l2 = true;
                is_l4 = true;
 
                if (hw->mac.type == igc_i225) {
@@ -405,15 +402,6 @@ static int igc_ptp_set_timestamp_mode(struct igc_adapter *adapter,
        /* define which PTP packets are time stamped */
        wr32(IGC_TSYNCRXCFG, tsync_rx_cfg);
 
-       /* define ethertype filter for timestamped packets */
-       if (is_l2)
-               wr32(IGC_ETQF(3),
-                    (IGC_ETQF_FILTER_ENABLE | /* enable filter */
-                    IGC_ETQF_1588 | /* enable timestamping */
-                    ETH_P_1588)); /* 1588 eth protocol type */
-       else
-               wr32(IGC_ETQF(3), 0);
-
        /* L4 Queue Filter[3]: filter by destination port and protocol */
        if (is_l4) {
                u32 ftqf = (IPPROTO_UDP /* UDP */