From: Kalle Valo <kvalo@kernel.org>
To: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
Cc: <ath11k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] ath11k: Add support for dynamic vlan
Date: Mon, 17 Jan 2022 14:33:10 +0200 [thread overview]
Message-ID: <87bl0asfsp.fsf@kernel.org> (raw)
In-Reply-To: <1641786090-10232-1-git-send-email-quic_seevalam@quicinc.com> (Seevalamuthu Mariappan's message of "Mon, 10 Jan 2022 09:11:30 +0530")
Seevalamuthu Mariappan <quic_seevalam@quicinc.com> writes:
> Advertise AP-VLAN interface type for vlan support in driver.
> Metadata information in dp_tx is added to notify firmware
> that multicast/broadcast packets are encrypted in software.
>
> Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01073-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
[...]
> --- a/drivers/net/wireless/ath/ath11k/dp_tx.c
> +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
> @@ -78,6 +78,44 @@ enum hal_encrypt_type ath11k_dp_tx_get_encrypt_type(u32 cipher)
> }
> }
>
> +#define HTT_META_DATA_ALIGNMENT 0x8
> +
> +static int ath11k_dp_metadata_align_skb(struct sk_buff *skb, u8 align_len)
> +{
> + if (unlikely(skb_cow_head(skb, align_len)))
> + return -ENOMEM;
> +
> + skb_push(skb, align_len);
> + memset(skb->data, 0, align_len);
> + return 0;
> +}
[...]
> @@ -211,15 +250,42 @@ int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif,
> goto fail_remove_idr;
> }
>
> + /* Add metadata for sw encrypted vlan group traffic */
> + if (!test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags) &&
> + !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) &&
> + !info->control.hw_key &&
> + ieee80211_has_protected(hdr->frame_control)) {
> + /* HW requirement is that metadata should always point to a
> + * 8-byte aligned address. So we add alignment pad to start of
> + * buffer. HTT Metadata should be ensured to be multiple of 8-bytes
> + * to get 8-byte aligned start address along with align_pad added
> + */
> + align_pad = ((unsigned long)skb->data) & (HTT_META_DATA_ALIGNMENT - 1);
> + ret = ath11k_dp_metadata_align_skb(skb, align_pad);
> + if (unlikely(ret))
> + goto fail_remove_idr;
If you push the skb like that shouldn't you also reserve the room for it
in struct ieee80211_hw::extra_tx_headroom?
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
--
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k
WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@kernel.org>
To: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
Cc: <ath11k@lists.infradead.org>, <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] ath11k: Add support for dynamic vlan
Date: Mon, 17 Jan 2022 14:33:10 +0200 [thread overview]
Message-ID: <87bl0asfsp.fsf@kernel.org> (raw)
In-Reply-To: <1641786090-10232-1-git-send-email-quic_seevalam@quicinc.com> (Seevalamuthu Mariappan's message of "Mon, 10 Jan 2022 09:11:30 +0530")
Seevalamuthu Mariappan <quic_seevalam@quicinc.com> writes:
> Advertise AP-VLAN interface type for vlan support in driver.
> Metadata information in dp_tx is added to notify firmware
> that multicast/broadcast packets are encrypted in software.
>
> Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01073-QCAHKSWPL_SILICONZ-1
>
> Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
[...]
> --- a/drivers/net/wireless/ath/ath11k/dp_tx.c
> +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
> @@ -78,6 +78,44 @@ enum hal_encrypt_type ath11k_dp_tx_get_encrypt_type(u32 cipher)
> }
> }
>
> +#define HTT_META_DATA_ALIGNMENT 0x8
> +
> +static int ath11k_dp_metadata_align_skb(struct sk_buff *skb, u8 align_len)
> +{
> + if (unlikely(skb_cow_head(skb, align_len)))
> + return -ENOMEM;
> +
> + skb_push(skb, align_len);
> + memset(skb->data, 0, align_len);
> + return 0;
> +}
[...]
> @@ -211,15 +250,42 @@ int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif,
> goto fail_remove_idr;
> }
>
> + /* Add metadata for sw encrypted vlan group traffic */
> + if (!test_bit(ATH11K_FLAG_HW_CRYPTO_DISABLED, &ar->ab->dev_flags) &&
> + !(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) &&
> + !info->control.hw_key &&
> + ieee80211_has_protected(hdr->frame_control)) {
> + /* HW requirement is that metadata should always point to a
> + * 8-byte aligned address. So we add alignment pad to start of
> + * buffer. HTT Metadata should be ensured to be multiple of 8-bytes
> + * to get 8-byte aligned start address along with align_pad added
> + */
> + align_pad = ((unsigned long)skb->data) & (HTT_META_DATA_ALIGNMENT - 1);
> + ret = ath11k_dp_metadata_align_skb(skb, align_pad);
> + if (unlikely(ret))
> + goto fail_remove_idr;
If you push the skb like that shouldn't you also reserve the room for it
in struct ieee80211_hw::extra_tx_headroom?
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
next prev parent reply other threads:[~2022-01-17 12:33 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 3:41 [PATCH] ath11k: Add support for dynamic vlan Seevalamuthu Mariappan
2022-01-10 3:41 ` Seevalamuthu Mariappan
2022-01-17 12:33 ` Kalle Valo [this message]
2022-01-17 12:33 ` Kalle Valo
2022-02-08 5:30 ` Seevalamuthu M (QUIC)
2022-02-08 5:30 ` Seevalamuthu M (QUIC)
2022-05-06 11:55 ` Seevalamuthu M (QUIC)
2022-05-06 11:55 ` Seevalamuthu M (QUIC)
2022-06-03 8:30 ` Kalle Valo
2022-06-03 8:30 ` Kalle Valo
2022-06-03 8:34 ` Kalle Valo
2022-06-03 8:34 ` Kalle Valo
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=87bl0asfsp.fsf@kernel.org \
--to=kvalo@kernel.org \
--cc=ath11k@lists.infradead.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_seevalam@quicinc.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.