diff options
author | Edward Cree <ecree@solarflare.com> | 2016-11-03 18:12:58 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-11-09 13:59:17 -0500 |
commit | b718c88a62c9adf24d8d1a06902f06f0149efac7 (patch) | |
tree | 474dc599b36e80d9433129460ad29785381f1a8e | |
parent | a33a4c73810589f80b8a37477e1b28b4c1d61913 (diff) |
sfc: report 4-tuple UDP hashing to ethtool, if it's enabled
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/sfc/ef10.c | 6 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/ethtool.c | 12 | ||||
-rw-r--r-- | drivers/net/ethernet/sfc/net_driver.h | 2 |
3 files changed, 14 insertions, 6 deletions
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index 9f6d7690bc0a..e61807e6d47b 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c | |||
@@ -2319,8 +2319,10 @@ static void efx_ef10_set_rss_flags(struct efx_nic *efx, u32 context) | |||
2319 | flags |= RSS_MODE_HASH_PORTS << MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV4_RSS_MODE_LBN; | 2319 | flags |= RSS_MODE_HASH_PORTS << MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV4_RSS_MODE_LBN; |
2320 | flags |= RSS_MODE_HASH_PORTS << MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV6_RSS_MODE_LBN; | 2320 | flags |= RSS_MODE_HASH_PORTS << MC_CMD_RSS_CONTEXT_GET_FLAGS_OUT_UDP_IPV6_RSS_MODE_LBN; |
2321 | MCDI_SET_DWORD(inbuf, RSS_CONTEXT_SET_FLAGS_IN_FLAGS, flags); | 2321 | MCDI_SET_DWORD(inbuf, RSS_CONTEXT_SET_FLAGS_IN_FLAGS, flags); |
2322 | efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_SET_FLAGS, inbuf, sizeof(inbuf), | 2322 | if (!efx_mcdi_rpc(efx, MC_CMD_RSS_CONTEXT_SET_FLAGS, inbuf, sizeof(inbuf), |
2323 | NULL, 0, NULL); | 2323 | NULL, 0, NULL)) |
2324 | /* Succeeded, so UDP 4-tuple is now enabled */ | ||
2325 | efx->rx_hash_udp_4tuple = true; | ||
2324 | } | 2326 | } |
2325 | 2327 | ||
2326 | static int efx_ef10_alloc_rss_context(struct efx_nic *efx, u32 *context, | 2328 | static int efx_ef10_alloc_rss_context(struct efx_nic *efx, u32 *context, |
diff --git a/drivers/net/ethernet/sfc/ethtool.c b/drivers/net/ethernet/sfc/ethtool.c index 445ccdb6bc67..bf126f935ade 100644 --- a/drivers/net/ethernet/sfc/ethtool.c +++ b/drivers/net/ethernet/sfc/ethtool.c | |||
@@ -968,20 +968,24 @@ efx_ethtool_get_rxnfc(struct net_device *net_dev, | |||
968 | 968 | ||
969 | info->data = 0; | 969 | info->data = 0; |
970 | switch (info->flow_type) { | 970 | switch (info->flow_type) { |
971 | case UDP_V4_FLOW: | ||
972 | if (efx->rx_hash_udp_4tuple) | ||
973 | /* fall through */ | ||
971 | case TCP_V4_FLOW: | 974 | case TCP_V4_FLOW: |
972 | info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; | 975 | info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; |
973 | /* fall through */ | 976 | /* fall through */ |
974 | case UDP_V4_FLOW: | ||
975 | case SCTP_V4_FLOW: | 977 | case SCTP_V4_FLOW: |
976 | case AH_ESP_V4_FLOW: | 978 | case AH_ESP_V4_FLOW: |
977 | case IPV4_FLOW: | 979 | case IPV4_FLOW: |
978 | info->data |= RXH_IP_SRC | RXH_IP_DST; | 980 | info->data |= RXH_IP_SRC | RXH_IP_DST; |
979 | min_revision = EFX_REV_FALCON_B0; | 981 | min_revision = EFX_REV_FALCON_B0; |
980 | break; | 982 | break; |
983 | case UDP_V6_FLOW: | ||
984 | if (efx->rx_hash_udp_4tuple) | ||
985 | /* fall through */ | ||
981 | case TCP_V6_FLOW: | 986 | case TCP_V6_FLOW: |
982 | info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; | 987 | info->data |= RXH_L4_B_0_1 | RXH_L4_B_2_3; |
983 | /* fall through */ | 988 | /* fall through */ |
984 | case UDP_V6_FLOW: | ||
985 | case SCTP_V6_FLOW: | 989 | case SCTP_V6_FLOW: |
986 | case AH_ESP_V6_FLOW: | 990 | case AH_ESP_V6_FLOW: |
987 | case IPV6_FLOW: | 991 | case IPV6_FLOW: |
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index 99d8c82124bb..fec51c4b2607 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h | |||
@@ -853,6 +853,7 @@ struct vfdi_status; | |||
853 | * @rx_hash_key: Toeplitz hash key for RSS | 853 | * @rx_hash_key: Toeplitz hash key for RSS |
854 | * @rx_indir_table: Indirection table for RSS | 854 | * @rx_indir_table: Indirection table for RSS |
855 | * @rx_scatter: Scatter mode enabled for receives | 855 | * @rx_scatter: Scatter mode enabled for receives |
856 | * @rx_hash_udp_4tuple: UDP 4-tuple hashing enabled | ||
856 | * @int_error_count: Number of internal errors seen recently | 857 | * @int_error_count: Number of internal errors seen recently |
857 | * @int_error_expire: Time at which error count will be expired | 858 | * @int_error_expire: Time at which error count will be expired |
858 | * @irq_soft_enabled: Are IRQs soft-enabled? If not, IRQ handler will | 859 | * @irq_soft_enabled: Are IRQs soft-enabled? If not, IRQ handler will |
@@ -990,6 +991,7 @@ struct efx_nic { | |||
990 | u8 rx_hash_key[40]; | 991 | u8 rx_hash_key[40]; |
991 | u32 rx_indir_table[128]; | 992 | u32 rx_indir_table[128]; |
992 | bool rx_scatter; | 993 | bool rx_scatter; |
994 | bool rx_hash_udp_4tuple; | ||
993 | 995 | ||
994 | unsigned int_error_count; | 996 | unsigned int_error_count; |
995 | unsigned long int_error_expire; | 997 | unsigned long int_error_expire; |