Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: "Sriram R (QUIC)" <quic_srirrama@quicinc.com>,
	"linux-wireless@vger.kernel.org" <linux-wireless@vger.kernel.org>
Cc: "vkthiagu@gmail.com" <vkthiagu@gmail.com>,
	Aaron Komisar <akomisar@maxlinear.com>,
	"Jeff Johnson (QUIC)" <quic_jjohnson@quicinc.com>,
	Jouni Malinen <j@w1.fi>
Subject: Re: [RFC] mac80211: prepare sta handling for MLO support
Date: Mon, 28 Mar 2022 11:26:32 +0200	[thread overview]
Message-ID: <644dd3e9fdb893245e4a31d681cb534f5197e968.camel@sipsolutions.net> (raw)
In-Reply-To: <SN6PR02MB433497C4F6E9BD97294488C5F71D9@SN6PR02MB4334.namprd02.prod.outlook.com>

Hi,

> 
> Sure, the contents of the link sta (link_sta_info or
> ieee80211_link_sta) needs to be definitely revisited.
> This RFC was to mainly conclude on the approach of splitting the
> sta_info, ieee80211_sta structs
> and how we access the link sta related info within them. I'll relook
> into the contents and add any
> link related info to link structs in next version and we can review
> that part again if any more info
> requires to be moved.

OK, that's fair.

> > > +     lsinfo = kzalloc(sizeof(*lsinfo), gfp);
> > > +     if (!lsinfo)
> > > +             goto free;
> > > +
> > > +     lsta = kzalloc(sizeof(*lsta), gfp);
> > > +     if (!lsta)
> > > +             goto free;
> > 
> > I did start wondering if we wouldn't want to move struct
> > link_sta_info to
> > mac80211.h as well, though I'm not sure what else we'd have to move,
> > and not
> > have to allocate all of these separately?
> I didn’t get this point correctly, Do you mean to merge link_sta_info
> and ieee80211_link_sta structs
> so as to avoid these two allocs?

Yes, kind of, I meant different things later as my thinking evolved over
the course of writing the email :)

> > Though if we follow them through pointers, we can still allocate
> > them in the
> > same memory chunk (just add the sizes).
> Do you mean something like,
> lsinfo = kzalloc(sizeof(*lsinfo) + sizeof(*lsta), gfp);
> lsta = (u8 *)lsinfo + sizeof(*lsinfo);
> 
> This seems fine I guess and helps to do away with the second
> kzalloc(). Can we go with this?

Need to be careful with alignment there, but otherwise yes?

> > Not sure we need to optimise anything here though.
> > 
> > Or maybe in addition or instead we should allocate an *array* of
> > links?
> > But of course only however many we actually need, regardless of
> > which ones
> > are actually active.
> The array of link pointers are already allocated as part of struct
> ieee80211_sta and struct sta_info, right?
> Did I misunderstood?

Correct. I meant that we should probably know how many links we need up
front, so we could allocate

	n_links * (sizeof(*lsinfo) + sizeof(*lsta))

kind of.

But then again that might be more complicated?


We might be allocating a lot of these - so maybe it'd be worthwile to
get a kmem cache? But we can also do that later.


> This 'deflink' approach looks very neat, Thanks. I'll update in next
> version.

:)

> > 
> Yes, this change would be part of MLO support changes.

Makes sense, so let's just update the commit message for now.

> 

Thanks,
johannes

  reply	other threads:[~2022-03-28  9:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25  7:48 [RFC] mac80211: prepare sta handling for MLO support Sriram R
2022-03-25 12:56 ` Johannes Berg
2022-03-28  8:45   ` Sriram R (QUIC)
2022-03-28  9:26     ` Johannes Berg [this message]
2022-03-29 11:58       ` Sriram R (QUIC)
2022-03-30  9:10 ` [mac80211] 96e8c9671b: BUG:sleeping_function_called_from_invalid_context_at_include/linux/sched/mm.h kernel test robot

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=644dd3e9fdb893245e4a31d681cb534f5197e968.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=akomisar@maxlinear.com \
    --cc=j@w1.fi \
    --cc=linux-wireless@vger.kernel.org \
    --cc=quic_jjohnson@quicinc.com \
    --cc=quic_srirrama@quicinc.com \
    --cc=vkthiagu@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