2023-06-05 20:16:57

by Ben Greear

[permalink] [raw]
Subject: iwlwifi query on iwl_mvm_skb_prepare_status

I think the two memsets below access the same memory since skb_info
contains a union? So maybe only one is needed?

static void iwl_mvm_skb_prepare_status(struct sk_buff *skb,
struct iwl_device_tx_cmd *cmd)
{
struct ieee80211_tx_info *skb_info = IEEE80211_SKB_CB(skb);

memset(&skb_info->status, 0, sizeof(skb_info->status));
memset(skb_info->driver_data, 0, sizeof(skb_info->driver_data));

skb_info->driver_data[1] = cmd;
}

Thanks,
Ben

--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com



2023-06-05 21:14:18

by Ben Greear

[permalink] [raw]
Subject: Re: iwlwifi query on iwl_mvm_skb_prepare_status

On 6/5/23 13:04, Ben Greear wrote:
> I think the two memsets below access the same memory since skb_info
> contains a union?  So maybe only one is needed?
>
> static void iwl_mvm_skb_prepare_status(struct sk_buff *skb,
>                        struct iwl_device_tx_cmd *cmd)
> {
>     struct ieee80211_tx_info *skb_info = IEEE80211_SKB_CB(skb);
>
>     memset(&skb_info->status, 0, sizeof(skb_info->status));
>     memset(skb_info->driver_data, 0, sizeof(skb_info->driver_data));
>
>     skb_info->driver_data[1] = cmd;
> }

Also, maybe that driver_data[1] assigment is not helpful? From what I can tell,
mvm is putting the iwl_device_tx_cmd pointer at driver_data[3], by way of some cb offsets.

Are these notes below valid for mvm?

/* skb->cb usage for mvm
*
* driver_data[0]: unused
* driver_data[1]: holds pointer to struct iwl_device_tx_cmd (un-used???)
* driver_data[2]: cb + cb_data_offs, points to mac header page.
* driver_data[3]: dev_cmd_offs: cb + cb_data_offs + sizeof(void*), holds pointer to struct iwl_device_tx_cmd.
* driver_data[4]: unused.
*/

>
> Thanks,
> Ben
>