diff mbox

ath10k: Use TX cksum offload only for CHECKSUM_PARTIAL

Message ID 1422441092-29243-1-git-send-email-helmut.schaa@googlemail.com (mailing list archive)
State Accepted
Headers show

Commit Message

Helmut Schaa Jan. 28, 2015, 10:31 a.m. UTC
Otherwise ath10k will just checksum everything even if it did not
go through the TCP/IP stack (for example bridged frames). In the worst
case this could mean recreating the checksum for incorrect data.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
---
 drivers/net/wireless/ath/ath10k/htt_tx.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Kalle Valo Jan. 28, 2015, 11:07 a.m. UTC | #1
Helmut Schaa <helmut.schaa@googlemail.com> writes:

> Otherwise ath10k will just checksum everything even if it did not
> go through the TCP/IP stack (for example bridged frames). In the worst
> case this could mean recreating the checksum for incorrect data.
>
> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>

In the future, please also CC linux-wireless. We get good review
comments that way.
Helmut Schaa Jan. 28, 2015, 11:52 a.m. UTC | #2
On Wed, Jan 28, 2015 at 12:07 PM, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
> Helmut Schaa <helmut.schaa@googlemail.com> writes:
>
>> Otherwise ath10k will just checksum everything even if it did not
>> go through the TCP/IP stack (for example bridged frames). In the worst
>> case this could mean recreating the checksum for incorrect data.
>>
>> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
>
> In the future, please also CC linux-wireless. We get good review
> comments that way.

Ok, will do next time :)
Helmut
Kalle Valo Feb. 4, 2015, 7:19 a.m. UTC | #3
Helmut Schaa <helmut.schaa@googlemail.com> writes:

> Otherwise ath10k will just checksum everything even if it did not
> go through the TCP/IP stack (for example bridged frames). In the worst
> case this could mean recreating the checksum for incorrect data.
>
> Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>

Thanks, applied to ath.git.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index a1bda41..e142502 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -534,8 +534,10 @@  int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu)
 
 	flags1 |= SM((u16)vdev_id, HTT_DATA_TX_DESC_FLAGS1_VDEV_ID);
 	flags1 |= SM((u16)tid, HTT_DATA_TX_DESC_FLAGS1_EXT_TID);
-	flags1 |= HTT_DATA_TX_DESC_FLAGS1_CKSUM_L3_OFFLOAD;
-	flags1 |= HTT_DATA_TX_DESC_FLAGS1_CKSUM_L4_OFFLOAD;
+	if (msdu->ip_summed == CHECKSUM_PARTIAL) {
+		flags1 |= HTT_DATA_TX_DESC_FLAGS1_CKSUM_L3_OFFLOAD;
+		flags1 |= HTT_DATA_TX_DESC_FLAGS1_CKSUM_L4_OFFLOAD;
+	}
 
 	/* Prevent firmware from sending up tx inspection requests. There's
 	 * nothing ath10k can do with frames requested for inspection so force