From a9e9489f977d566f1e7b5d68a39f753d91008946 Mon Sep 17 00:00:00 2001 From: Bjarne von Horn Date: Fri, 4 Apr 2025 10:10:22 +0200 Subject: [PATCH] Fix RX descriptor writeback threshold to 1 If the igc adapter is not used for EtherCAT, the threshold is left to the original default, 4. Superseeds !147 --- devices/igc/igc-5.14-ethercat.h | 9 ++++++++- devices/igc/igc-5.15-ethercat.h | 9 ++++++++- devices/igc/igc-6.1-ethercat.h | 9 ++++++++- devices/igc/igc-6.4-ethercat.h | 9 ++++++++- devices/igc/igc-6.6-ethercat.h | 9 ++++++++- 5 files changed, 40 insertions(+), 5 deletions(-) diff --git a/devices/igc/igc-5.14-ethercat.h b/devices/igc/igc-5.14-ethercat.h index c41d6583..657921a0 100644 --- a/devices/igc/igc-5.14-ethercat.h +++ b/devices/igc/igc-5.14-ethercat.h @@ -366,7 +366,14 @@ extern char igc_driver_name[]; #define IGC_RX_HTHRESH 8 #define IGC_TX_PTHRESH 8 #define IGC_TX_HTHRESH 1 -#define IGC_RX_WTHRESH 4 +static inline int igc_get_rx_wthresh(struct igc_adapter *adapter) +{ + if (get_ecdev(adapter)) { + return 1; + } + return 4; +} +#define IGC_RX_WTHRESH igc_get_rx_wthresh(adapter) #define IGC_TX_WTHRESH 16 #define IGC_RX_DMA_ATTR \ diff --git a/devices/igc/igc-5.15-ethercat.h b/devices/igc/igc-5.15-ethercat.h index 1f7bd8d3..3d9d4905 100644 --- a/devices/igc/igc-5.15-ethercat.h +++ b/devices/igc/igc-5.15-ethercat.h @@ -380,7 +380,14 @@ extern char igc_driver_name[]; #define IGC_RX_HTHRESH 8 #define IGC_TX_PTHRESH 8 #define IGC_TX_HTHRESH 1 -#define IGC_RX_WTHRESH 4 +static inline int igc_get_rx_wthresh(struct igc_adapter *adapter) +{ + if (get_ecdev(adapter)) { + return 1; + } + return 4; +} +#define IGC_RX_WTHRESH igc_get_rx_wthresh(adapter) #define IGC_TX_WTHRESH 16 #define IGC_RX_DMA_ATTR \ diff --git a/devices/igc/igc-6.1-ethercat.h b/devices/igc/igc-6.1-ethercat.h index 13330ed5..dcf637d5 100644 --- a/devices/igc/igc-6.1-ethercat.h +++ b/devices/igc/igc-6.1-ethercat.h @@ -382,7 +382,14 @@ extern char igc_driver_name[]; #define IGC_RX_HTHRESH 8 #define IGC_TX_PTHRESH 8 #define IGC_TX_HTHRESH 1 -#define IGC_RX_WTHRESH 4 +static inline int igc_get_rx_wthresh(struct igc_adapter *adapter) +{ + if (get_ecdev(adapter)) { + return 1; + } + return 4; +} +#define IGC_RX_WTHRESH igc_get_rx_wthresh(adapter) #define IGC_TX_WTHRESH 16 #define IGC_RX_DMA_ATTR \ diff --git a/devices/igc/igc-6.4-ethercat.h b/devices/igc/igc-6.4-ethercat.h index 107ea63b..ef6bc259 100644 --- a/devices/igc/igc-6.4-ethercat.h +++ b/devices/igc/igc-6.4-ethercat.h @@ -421,7 +421,14 @@ static inline u32 igc_rss_type(const union igc_adv_rx_desc *rx_desc) #define IGC_RX_HTHRESH 8 #define IGC_TX_PTHRESH 8 #define IGC_TX_HTHRESH 1 -#define IGC_RX_WTHRESH 4 +static inline int igc_get_rx_wthresh(struct igc_adapter *adapter) +{ + if (get_ecdev(adapter)) { + return 1; + } + return 4; +} +#define IGC_RX_WTHRESH igc_get_rx_wthresh(adapter) #define IGC_TX_WTHRESH 16 #define IGC_RX_DMA_ATTR \ diff --git a/devices/igc/igc-6.6-ethercat.h b/devices/igc/igc-6.6-ethercat.h index 8131a05d..23d29c5f 100644 --- a/devices/igc/igc-6.6-ethercat.h +++ b/devices/igc/igc-6.6-ethercat.h @@ -435,7 +435,14 @@ static inline u32 igc_rss_type(const union igc_adv_rx_desc *rx_desc) #define IGC_RX_HTHRESH 8 #define IGC_TX_PTHRESH 8 #define IGC_TX_HTHRESH 1 -#define IGC_RX_WTHRESH 4 +static inline int igc_get_rx_wthresh(struct igc_adapter *adapter) +{ + if (get_ecdev(adapter)) { + return 1; + } + return 4; +} +#define IGC_RX_WTHRESH igc_get_rx_wthresh(adapter) #define IGC_TX_WTHRESH 16 #define IGC_RX_DMA_ATTR \