diff options
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_common.c | 7 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_main.c | 14 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_type.h | 3 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/i40evf/i40e_type.h | 3 |
5 files changed, 21 insertions, 7 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e.h b/drivers/net/ethernet/intel/i40e/i40e.h index 60f9a73303ba..817e179dc3f9 100644 --- a/drivers/net/ethernet/intel/i40e/i40e.h +++ b/drivers/net/ethernet/intel/i40e/i40e.h | |||
@@ -350,6 +350,7 @@ struct i40e_pf { | |||
350 | u32 rx_hwtstamp_cleared; | 350 | u32 rx_hwtstamp_cleared; |
351 | bool ptp_tx; | 351 | bool ptp_tx; |
352 | bool ptp_rx; | 352 | bool ptp_rx; |
353 | u16 rss_table_size; | ||
353 | }; | 354 | }; |
354 | 355 | ||
355 | struct i40e_mac_filter { | 356 | struct i40e_mac_filter { |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_common.c b/drivers/net/ethernet/intel/i40e/i40e_common.c index 6e65f19dd6e5..a51bba634718 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_common.c +++ b/drivers/net/ethernet/intel/i40e/i40e_common.c | |||
@@ -1839,7 +1839,6 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff, | |||
1839 | struct i40e_aqc_list_capabilities_element_resp *cap; | 1839 | struct i40e_aqc_list_capabilities_element_resp *cap; |
1840 | u32 number, logical_id, phys_id; | 1840 | u32 number, logical_id, phys_id; |
1841 | struct i40e_hw_capabilities *p; | 1841 | struct i40e_hw_capabilities *p; |
1842 | u32 reg_val; | ||
1843 | u32 i = 0; | 1842 | u32 i = 0; |
1844 | u16 id; | 1843 | u16 id; |
1845 | 1844 | ||
@@ -1910,11 +1909,7 @@ static void i40e_parse_discover_capabilities(struct i40e_hw *hw, void *buff, | |||
1910 | break; | 1909 | break; |
1911 | case I40E_DEV_FUNC_CAP_RSS: | 1910 | case I40E_DEV_FUNC_CAP_RSS: |
1912 | p->rss = true; | 1911 | p->rss = true; |
1913 | reg_val = rd32(hw, I40E_PFQF_CTL_0); | 1912 | p->rss_table_size = number; |
1914 | if (reg_val & I40E_PFQF_CTL_0_HASHLUTSIZE_MASK) | ||
1915 | p->rss_table_size = number; | ||
1916 | else | ||
1917 | p->rss_table_size = 128; | ||
1918 | p->rss_table_entry_width = logical_id; | 1913 | p->rss_table_entry_width = logical_id; |
1919 | break; | 1914 | break; |
1920 | case I40E_DEV_FUNC_CAP_RX_QUEUES: | 1915 | case I40E_DEV_FUNC_CAP_RX_QUEUES: |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c index ebbf37bc367e..34310bd116b2 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c | |||
@@ -6599,6 +6599,7 @@ static int i40e_config_rss(struct i40e_pf *pf) | |||
6599 | u32 lut = 0; | 6599 | u32 lut = 0; |
6600 | int i, j; | 6600 | int i, j; |
6601 | u64 hena; | 6601 | u64 hena; |
6602 | u32 reg_val; | ||
6602 | 6603 | ||
6603 | /* Fill out hash function seed */ | 6604 | /* Fill out hash function seed */ |
6604 | for (i = 0; i <= I40E_PFQF_HKEY_MAX_INDEX; i++) | 6605 | for (i = 0; i <= I40E_PFQF_HKEY_MAX_INDEX; i++) |
@@ -6611,8 +6612,19 @@ static int i40e_config_rss(struct i40e_pf *pf) | |||
6611 | wr32(hw, I40E_PFQF_HENA(0), (u32)hena); | 6612 | wr32(hw, I40E_PFQF_HENA(0), (u32)hena); |
6612 | wr32(hw, I40E_PFQF_HENA(1), (u32)(hena >> 32)); | 6613 | wr32(hw, I40E_PFQF_HENA(1), (u32)(hena >> 32)); |
6613 | 6614 | ||
6615 | /* Check capability and Set table size and register per hw expectation*/ | ||
6616 | reg_val = rd32(hw, I40E_PFQF_CTL_0); | ||
6617 | if (hw->func_caps.rss_table_size == 512) { | ||
6618 | reg_val |= I40E_PFQF_CTL_0_HASHLUTSIZE_512; | ||
6619 | pf->rss_table_size = 512; | ||
6620 | } else { | ||
6621 | pf->rss_table_size = 128; | ||
6622 | reg_val &= ~I40E_PFQF_CTL_0_HASHLUTSIZE_512; | ||
6623 | } | ||
6624 | wr32(hw, I40E_PFQF_CTL_0, reg_val); | ||
6625 | |||
6614 | /* Populate the LUT with max no. of queues in round robin fashion */ | 6626 | /* Populate the LUT with max no. of queues in round robin fashion */ |
6615 | for (i = 0, j = 0; i < pf->hw.func_caps.rss_table_size; i++, j++) { | 6627 | for (i = 0, j = 0; i < pf->rss_table_size; i++, j++) { |
6616 | 6628 | ||
6617 | /* The assumption is that lan qp count will be the highest | 6629 | /* The assumption is that lan qp count will be the highest |
6618 | * qp count for any PF VSI that needs RSS. | 6630 | * qp count for any PF VSI that needs RSS. |
diff --git a/drivers/net/ethernet/intel/i40e/i40e_type.h b/drivers/net/ethernet/intel/i40e/i40e_type.h index a688ab86f650..1c0d5a70b892 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_type.h +++ b/drivers/net/ethernet/intel/i40e/i40e_type.h | |||
@@ -1165,4 +1165,7 @@ enum i40e_reset_type { | |||
1165 | I40E_RESET_GLOBR = 2, | 1165 | I40E_RESET_GLOBR = 2, |
1166 | I40E_RESET_EMPR = 3, | 1166 | I40E_RESET_EMPR = 3, |
1167 | }; | 1167 | }; |
1168 | |||
1169 | /* RSS Hash Table Size */ | ||
1170 | #define I40E_PFQF_CTL_0_HASHLUTSIZE_512 0x00010000 | ||
1168 | #endif /* _I40E_TYPE_H_ */ | 1171 | #endif /* _I40E_TYPE_H_ */ |
diff --git a/drivers/net/ethernet/intel/i40evf/i40e_type.h b/drivers/net/ethernet/intel/i40evf/i40e_type.h index 4a2e48af2887..9c835786e8a1 100644 --- a/drivers/net/ethernet/intel/i40evf/i40e_type.h +++ b/drivers/net/ethernet/intel/i40evf/i40e_type.h | |||
@@ -1165,4 +1165,7 @@ enum i40e_reset_type { | |||
1165 | I40E_RESET_GLOBR = 2, | 1165 | I40E_RESET_GLOBR = 2, |
1166 | I40E_RESET_EMPR = 3, | 1166 | I40E_RESET_EMPR = 3, |
1167 | }; | 1167 | }; |
1168 | |||
1169 | /* RSS Hash Table Size */ | ||
1170 | #define I40E_PFQF_CTL_0_HASHLUTSIZE_512 0x00010000 | ||
1168 | #endif /* _I40E_TYPE_H_ */ | 1171 | #endif /* _I40E_TYPE_H_ */ |