Commit 0792df68 authored by Johannes Berg's avatar Johannes Berg Committed by Luca Coelho
Browse files

iwlwifi: mvm: support Bz TX checksum offload



Support TX checksum offload for Bz devices, where we have full
checksum offload (NETIF_F_HW_CSUM) and the hardware doesn't
need to parse the IP headers or anything.

Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20211219132536.c0f44c98b36d.I75a688f3ac80cbe824c459ece4bb67843b9fce76@changeid


Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent c3f40c3e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -252,7 +252,7 @@ static const struct iwl_ht_params iwl_22000_ht_params = {
	.dccm2_len = IWL_22000_DCCM2_LEN,				\
	.smem_offset = IWL_22000_SMEM_OFFSET,				\
	.smem_len = IWL_22000_SMEM_LEN,					\
	.features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM,		\
	.features = IWL_TX_CSUM_NETIF_FLAGS_BZ | NETIF_F_RXCSUM,	\
	.apmg_not_supported = true,					\
	.trans.mq_rx_supported = true,					\
	.vht_mu_mimo_supported = true,					\
+11 −0
Original line number Diff line number Diff line
@@ -177,6 +177,17 @@ enum iwl_tx_offload_assist_flags_pos {
#define IWL_TX_CMD_OFFLD_MH_MASK	0x1f
#define IWL_TX_CMD_OFFLD_IP_HDR_MASK	0x3f

enum iwl_tx_offload_assist_bz {
	IWL_TX_CMD_OFFLD_BZ_RESULT_OFFS		= 0x000003ff,
	IWL_TX_CMD_OFFLD_BZ_START_OFFS		= 0x001ff800,
	IWL_TX_CMD_OFFLD_BZ_MH_LEN		= 0x07c00000,
	IWL_TX_CMD_OFFLD_BZ_MH_PAD		= 0x08000000,
	IWL_TX_CMD_OFFLD_BZ_AMSDU		= 0x10000000,
	IWL_TX_CMD_OFFLD_BZ_ZERO2ONES		= 0x20000000,
	IWL_TX_CMD_OFFLD_BZ_ENABLE_CSUM		= 0x40000000,
	IWL_TX_CMD_OFFLD_BZ_PARTIAL_CSUM	= 0x80000000,
};

/* TODO: complete documentation for try_cnt and btkill_cnt */
/**
 * struct iwl_tx_cmd - TX command struct to FW
+4 −1
Original line number Diff line number Diff line
@@ -84,7 +84,10 @@ enum iwl_nvm_type {
#define IWL_DEFAULT_MAX_TX_POWER 22
#define IWL_TX_CSUM_NETIF_FLAGS (NETIF_F_IPV6_CSUM | NETIF_F_IP_CSUM |\
				 NETIF_F_TSO | NETIF_F_TSO6)
#define IWL_CSUM_NETIF_FLAGS_MASK (IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM)
#define IWL_TX_CSUM_NETIF_FLAGS_BZ (NETIF_F_HW_CSUM | NETIF_F_TSO | NETIF_F_TSO6)
#define IWL_CSUM_NETIF_FLAGS_MASK (IWL_TX_CSUM_NETIF_FLAGS | \
				   IWL_TX_CSUM_NETIF_FLAGS_BZ | \
				   NETIF_F_RXCSUM)

/* Antenna presence definitions */
#define	ANT_NONE	0x0
+4 −0
Original line number Diff line number Diff line
@@ -5523,6 +5523,10 @@ static bool iwl_mvm_mac_can_aggregate(struct ieee80211_hw *hw,
{
	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);

	if (mvm->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_BZ)
		return iwl_mvm_tx_csum_bz(mvm, head, true) ==
		       iwl_mvm_tx_csum_bz(mvm, skb, true);

	/* For now don't aggregate IPv6 in AMSDU */
	if (skb->protocol != htons(ETH_P_IP))
		return false;
+1 −0
Original line number Diff line number Diff line
@@ -1518,6 +1518,7 @@ void iwl_mvm_mac_itxq_xmit(struct ieee80211_hw *hw, struct ieee80211_txq *txq);
unsigned int iwl_mvm_max_amsdu_size(struct iwl_mvm *mvm,
				    struct ieee80211_sta *sta,
				    unsigned int tid);
u32 iwl_mvm_tx_csum_bz(struct iwl_mvm *mvm, struct sk_buff *skb, bool amsdu);

#ifdef CONFIG_IWLWIFI_DEBUG
const char *iwl_mvm_get_tx_fail_reason(u32 status);
Loading