iwlwifi: mvm: improve RSS configuration
Improve current RSS configuration: * Use netdev_rss_key instead of keeping a local copy. * Configure also UDP hashing to have UDP traffic spread across queues. * Do not direct RSS traffic to our fallback queue. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
This commit is contained in:
parent
013a67ea69
commit
854d773e4a
@ -65,6 +65,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#include <linux/vmalloc.h>
|
#include <linux/vmalloc.h>
|
||||||
#include <linux/ieee80211.h>
|
#include <linux/ieee80211.h>
|
||||||
|
#include <linux/netdevice.h>
|
||||||
|
|
||||||
#include "mvm.h"
|
#include "mvm.h"
|
||||||
#include "fw-dbg.h"
|
#include "fw-dbg.h"
|
||||||
@ -880,8 +881,10 @@ static ssize_t iwl_dbgfs_indirection_tbl_write(struct iwl_mvm *mvm,
|
|||||||
struct iwl_rss_config_cmd cmd = {
|
struct iwl_rss_config_cmd cmd = {
|
||||||
.flags = cpu_to_le32(IWL_RSS_ENABLE),
|
.flags = cpu_to_le32(IWL_RSS_ENABLE),
|
||||||
.hash_mask = IWL_RSS_HASH_TYPE_IPV4_TCP |
|
.hash_mask = IWL_RSS_HASH_TYPE_IPV4_TCP |
|
||||||
|
IWL_RSS_HASH_TYPE_IPV4_UDP |
|
||||||
IWL_RSS_HASH_TYPE_IPV4_PAYLOAD |
|
IWL_RSS_HASH_TYPE_IPV4_PAYLOAD |
|
||||||
IWL_RSS_HASH_TYPE_IPV6_TCP |
|
IWL_RSS_HASH_TYPE_IPV6_TCP |
|
||||||
|
IWL_RSS_HASH_TYPE_IPV6_UDP |
|
||||||
IWL_RSS_HASH_TYPE_IPV6_PAYLOAD,
|
IWL_RSS_HASH_TYPE_IPV6_PAYLOAD,
|
||||||
};
|
};
|
||||||
int ret, i, num_repeats, nbytes = count / 2;
|
int ret, i, num_repeats, nbytes = count / 2;
|
||||||
@ -905,7 +908,7 @@ static ssize_t iwl_dbgfs_indirection_tbl_write(struct iwl_mvm *mvm,
|
|||||||
memcpy(&cmd.indirection_table[i * nbytes], cmd.indirection_table,
|
memcpy(&cmd.indirection_table[i * nbytes], cmd.indirection_table,
|
||||||
ARRAY_SIZE(cmd.indirection_table) % nbytes);
|
ARRAY_SIZE(cmd.indirection_table) % nbytes);
|
||||||
|
|
||||||
memcpy(cmd.secret_key, mvm->secret_key, sizeof(cmd.secret_key));
|
netdev_rss_key_fill(cmd.secret_key, sizeof(cmd.secret_key));
|
||||||
|
|
||||||
mutex_lock(&mvm->mutex);
|
mutex_lock(&mvm->mutex);
|
||||||
ret = iwl_mvm_send_cmd_pdu(mvm, RSS_CONFIG_CMD, 0, sizeof(cmd), &cmd);
|
ret = iwl_mvm_send_cmd_pdu(mvm, RSS_CONFIG_CMD, 0, sizeof(cmd), &cmd);
|
||||||
|
@ -64,6 +64,7 @@
|
|||||||
*
|
*
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#include <net/mac80211.h>
|
#include <net/mac80211.h>
|
||||||
|
#include <linux/netdevice.h>
|
||||||
|
|
||||||
#include "iwl-trans.h"
|
#include "iwl-trans.h"
|
||||||
#include "iwl-op-mode.h"
|
#include "iwl-op-mode.h"
|
||||||
@ -114,14 +115,18 @@ static int iwl_send_rss_cfg_cmd(struct iwl_mvm *mvm)
|
|||||||
struct iwl_rss_config_cmd cmd = {
|
struct iwl_rss_config_cmd cmd = {
|
||||||
.flags = cpu_to_le32(IWL_RSS_ENABLE),
|
.flags = cpu_to_le32(IWL_RSS_ENABLE),
|
||||||
.hash_mask = IWL_RSS_HASH_TYPE_IPV4_TCP |
|
.hash_mask = IWL_RSS_HASH_TYPE_IPV4_TCP |
|
||||||
|
IWL_RSS_HASH_TYPE_IPV4_UDP |
|
||||||
IWL_RSS_HASH_TYPE_IPV4_PAYLOAD |
|
IWL_RSS_HASH_TYPE_IPV4_PAYLOAD |
|
||||||
IWL_RSS_HASH_TYPE_IPV6_TCP |
|
IWL_RSS_HASH_TYPE_IPV6_TCP |
|
||||||
|
IWL_RSS_HASH_TYPE_IPV6_UDP |
|
||||||
IWL_RSS_HASH_TYPE_IPV6_PAYLOAD,
|
IWL_RSS_HASH_TYPE_IPV6_PAYLOAD,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* Do not direct RSS traffic to Q 0 which is our fallback queue */
|
||||||
for (i = 0; i < ARRAY_SIZE(cmd.indirection_table); i++)
|
for (i = 0; i < ARRAY_SIZE(cmd.indirection_table); i++)
|
||||||
cmd.indirection_table[i] = i % mvm->trans->num_rx_queues;
|
cmd.indirection_table[i] =
|
||||||
memcpy(cmd.secret_key, mvm->secret_key, sizeof(cmd.secret_key));
|
1 + (i % (mvm->trans->num_rx_queues - 1));
|
||||||
|
netdev_rss_key_fill(cmd.secret_key, sizeof(cmd.secret_key));
|
||||||
|
|
||||||
return iwl_mvm_send_cmd_pdu(mvm, RSS_CONFIG_CMD, 0, sizeof(cmd), &cmd);
|
return iwl_mvm_send_cmd_pdu(mvm, RSS_CONFIG_CMD, 0, sizeof(cmd), &cmd);
|
||||||
}
|
}
|
||||||
|
@ -699,7 +699,6 @@ struct iwl_mvm {
|
|||||||
atomic_t pending_frames[IWL_MVM_STATION_COUNT];
|
atomic_t pending_frames[IWL_MVM_STATION_COUNT];
|
||||||
u32 tfd_drained[IWL_MVM_STATION_COUNT];
|
u32 tfd_drained[IWL_MVM_STATION_COUNT];
|
||||||
u8 rx_ba_sessions;
|
u8 rx_ba_sessions;
|
||||||
u32 secret_key[IWL_RSS_HASH_KEY_CNT];
|
|
||||||
|
|
||||||
/* configured by mac80211 */
|
/* configured by mac80211 */
|
||||||
u32 rts_threshold;
|
u32 rts_threshold;
|
||||||
|
@ -725,9 +725,6 @@ iwl_op_mode_mvm_start(struct iwl_trans *trans, const struct iwl_cfg *cfg,
|
|||||||
|
|
||||||
iwl_mvm_tof_init(mvm);
|
iwl_mvm_tof_init(mvm);
|
||||||
|
|
||||||
/* init RSS hash key */
|
|
||||||
get_random_bytes(mvm->secret_key, sizeof(mvm->secret_key));
|
|
||||||
|
|
||||||
return op_mode;
|
return op_mode;
|
||||||
|
|
||||||
out_unregister:
|
out_unregister:
|
||||||
|
Loading…
Reference in New Issue
Block a user