Linux wireless drivers development
 help / color / mirror / Atom feed
From: Luca Coelho <luca@coelho.fi>
To: kvalo@codeaurora.org
Cc: linux-wireless@vger.kernel.org,
	Luca Coelho <luciano.coelho@intel.com>,
	stable@vger.kernel.org
Subject: [PATCH 06/10] iwlwifi: mvm: use IWL_HCMD_NOCOPY for MCAST_FILTER_CMD
Date: Fri,  8 Sep 2017 12:12:52 +0300	[thread overview]
Message-ID: <20170908091256.25279-7-luca@coelho.fi> (raw)
In-Reply-To: <20170908091256.25279-1-luca@coelho.fi>

From: Luca Coelho <luciano.coelho@intel.com>

The MCAST_FILTER_CMD can get quite large when we have many mcast
addresses to set (we support up to 255).  So the command should be
send as NOCOPY to prevent a warning caused by too-long commands:

WARNING: CPU: 0 PID: 9700 at /root/iwlwifi/stack-dev/drivers/net/wireless/intel/iwlwifi/pcie/tx.c:1550 iwl_pcie_enqueue_hcmd+0x8c7/0xb40 [iwlwifi]
Command MCAST_FILTER_CMD (0x1d0) is too large (328 bytes)

This fixes: https://bugzilla.kernel.org/show_bug.cgi?id=196743

Cc: stable@vger.kernel.org
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 3a6ce4222ff5..635db63f972e 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -1546,6 +1546,11 @@ static void iwl_mvm_mc_iface_iterator(void *_data, u8 *mac,
 	struct iwl_mvm_mc_iter_data *data = _data;
 	struct iwl_mvm *mvm = data->mvm;
 	struct iwl_mcast_filter_cmd *cmd = mvm->mcast_filter_cmd;
+	struct iwl_host_cmd hcmd = {
+		.id = MCAST_FILTER_CMD,
+		.flags = CMD_ASYNC,
+		.dataflags[0] = IWL_HCMD_DFL_NOCOPY,
+	};
 	int ret, len;
 
 	/* if we don't have free ports, mcast frames will be dropped */
@@ -1560,7 +1565,10 @@ static void iwl_mvm_mc_iface_iterator(void *_data, u8 *mac,
 	memcpy(cmd->bssid, vif->bss_conf.bssid, ETH_ALEN);
 	len = roundup(sizeof(*cmd) + cmd->count * ETH_ALEN, 4);
 
-	ret = iwl_mvm_send_cmd_pdu(mvm, MCAST_FILTER_CMD, CMD_ASYNC, len, cmd);
+	hcmd.len[0] = len;
+	hcmd.data[0] = cmd;
+
+	ret = iwl_mvm_send_cmd(mvm, &hcmd);
 	if (ret)
 		IWL_ERR(mvm, "mcast filter cmd error. ret=%d\n", ret);
 }
-- 
2.14.1

  parent reply	other threads:[~2017-09-08  9:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-08  9:12 [PATCH 00/10] iwlwifi: fixes intended for 4.14 2017-09-08 Luca Coelho
2017-09-08  9:12 ` [PATCH 01/10] iwlwifi: mvm: fix wowlan resume failed to load INIT ucode Luca Coelho
2017-09-08  9:12 ` [PATCH 02/10] iwlwifi: mvm: Flush non STA TX queues Luca Coelho
2017-09-08  9:12 ` [PATCH 03/10] iwlwifi: mvm: send all non-bufferable frames on the probe queue Luca Coelho
2017-09-08  9:12 ` [PATCH 04/10] iwlwifi: mvm: change state when queueing agg start work Luca Coelho
2017-09-08  9:12 ` [PATCH 05/10] iwlwifi: mvm: wake the correct mac80211 queue Luca Coelho
2017-09-08  9:12 ` Luca Coelho [this message]
2017-09-08  9:12 ` [PATCH 07/10] iwlwifi: mvm: handle FIF_ALLMULTI when setting multicast addresses Luca Coelho
2017-09-08  9:12 ` [PATCH 08/10] iwlwifi: mvm: initialize status in iwl_mvm_add_int_sta_common() Luca Coelho
2017-09-08  9:12 ` [PATCH 09/10] iwlwifi: mvm: set status before calling iwl_mvm_send_cmd_status() Luca Coelho
2017-09-08  9:12 ` [PATCH 10/10] iwlwifi: mvm: fix reorder buffer for 9000 devices Luca Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170908091256.25279-7-luca@coelho.fi \
    --to=luca@coelho.fi \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox