From: Martin Kaiser <lists@kaiser.cx>
To: Michael Straube <straube.linux@gmail.com>
Cc: Phillip Potter <phil@philpotter.co.uk>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Larry Finger <Larry.Finger@lwfinger.net>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/5] staging: r8188eu: use helper to check for broadcast address
Date: Fri, 22 Oct 2021 11:21:10 +0200 [thread overview]
Message-ID: <20211022092110.d2mcmf2qe2jtkld4@viti.kaiser.cx> (raw)
In-Reply-To: <f5657f12-e20e-5cd9-e872-32e294741e88@gmail.com>
Thus wrote Michael Straube (straube.linux@gmail.com):
> > > + !is_broadcast_ether_addr(GetAddr1Ptr(pframe)))
> Hi Martin,
> I'm not an expert regarding alignment. Is GetAddr1Ptr(pframe) always
> __aligned(2) as required by is_broadcast_ether_addr?
Hi Michael,
thanks for spotting this. To be honest, I didn't look at this in much
detail when I wrote the patch.
I suppose the pframe comes from recvbuf2recvframe().
precvframe = rtw_alloc_recvframe(pfree_recv_queue);
with
struct __queue *pfree_recv_queue = &precvpriv->free_recv_queue;
This should be initialised in _rtw_init_recv_priv().
rtw_init_queue(&precvpriv->free_recv_queue);
...
precvpriv->precv_frame_buf = (u8 *)N_BYTE_ALIGMENT((size_t)(precvpriv->pallocated_frame_buf), RXFRAME_ALIGN_SZ);
precvframe = (struct recv_frame *)precvpriv->precv_frame_buf;
and the frames are added to the free_recv_queue.
RXFRAME_ALIGN_SZ is 1<<8.
So pframe should be 256-byte aligned.
GetAddr1Ptr adds 4 to the start of pframe.
I guess we're safe here.
> > > @@ -841,7 +840,7 @@ void odm_RSSIMonitorCheck(struct odm_dm_struct *pDM_Odm)
> > > psta = pDM_Odm->pODM_StaInfo[i];
> > > if (IS_STA_VALID(psta) &&
> > > (psta->state & WIFI_ASOC_STATE) &&
> > > - memcmp(psta->hwaddr, bcast_addr, ETH_ALEN) &&
> > > + !is_broadcast_ether_addr(psta->hwaddr) &&
> Perhaps we should add __aligned(2) to the hwaddr variable in struct
> sta_info to be safe?
> u8 hwaddr[ETH_ALEN] __aligned(2);
Hmm, some of those arrays in other parts of the kernel have
__aligned(2), others don't...
Can anyone else give some guidance?
Thanks,
Martin
next prev parent reply other threads:[~2021-10-22 9:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-20 19:53 [PATCH 1/5] staging: r8188eu: remove unused dm_priv components Martin Kaiser
2021-10-20 19:53 ` [PATCH 2/5] staging: r8188eu: odm_rate_adapt Type is constant Martin Kaiser
2021-10-20 21:06 ` Phillip Potter
2021-10-21 10:18 ` Michael Straube
2021-10-20 19:53 ` [PATCH 3/5] staging: r8188eu: use helper to check for broadcast address Martin Kaiser
2021-10-20 21:07 ` Phillip Potter
2021-10-21 10:12 ` Michael Straube
2021-10-22 9:21 ` Martin Kaiser [this message]
2021-11-02 14:59 ` Dan Carpenter
2021-10-20 19:54 ` [PATCH 4/5] staging: r8188eu: use helper to set " Martin Kaiser
2021-10-20 21:08 ` Phillip Potter
2021-10-21 10:20 ` Michael Straube
2021-10-20 19:54 ` [PATCH 5/5] staging: r8188eu: remove unused defines and enums Martin Kaiser
2021-10-20 21:10 ` Phillip Potter
2021-10-21 10:21 ` Michael Straube
2021-10-20 21:05 ` [PATCH 1/5] staging: r8188eu: remove unused dm_priv components Phillip Potter
2021-10-21 10:17 ` Michael Straube
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=20211022092110.d2mcmf2qe2jtkld4@viti.kaiser.cx \
--to=lists@kaiser.cx \
--cc=Larry.Finger@lwfinger.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=phil@philpotter.co.uk \
--cc=straube.linux@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®