All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: Ben Greear <greearb@candelatech.com>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	"ath10k@lists.infradead.org" <ath10k@lists.infradead.org>
Subject: Re: [RFTv2 3/5] ath10k: rework peer accounting
Date: Fri, 11 Apr 2014 09:31:56 +0300	[thread overview]
Message-ID: <87mwfsfkbn.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <CA+BoTQ=c+dTcK_diBKi6VJVgUkyBv21bDkRf+9GvGyhhqqMuNQ@mail.gmail.com> (Michal Kazior's message of "Thu, 10 Apr 2014 09:11:13 +0200")

Michal Kazior <michal.kazior@tieto.com> writes:

> On 10 April 2014 08:59, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> Michal Kazior <michal.kazior@tieto.com> writes:
>>
>>> It was troublesome to iterate over peers and
>>> perform sleepable calls. This will be necessary
>>> for some upcomming changes to tx flushing.
>>>
>>> Make peer allocation and initial setup
>>> protected by both ar->conf_mutex and
>>> ar->data_lock. This way it's possible to iterate
>>> over peers with conf_mutex and call sleepable
>>> functions.
>>>
>>> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
>>
>> First comments, but I need to read this much more carefully still:
>>
>>> --- a/drivers/net/wireless/ath/ath10k/core.h
>>> +++ b/drivers/net/wireless/ath/ath10k/core.h
>>> @@ -199,9 +199,14 @@ struct ath10k_dfs_stats {
>>>  #define ATH10K_MAX_NUM_PEER_IDS (1 << 11) /* htt rx_desc limit */
>>>
>>>  struct ath10k_peer {
>>> +     /* protected by conf_mutex + data_lock */
>>>       struct list_head list;
>>
>> This really needs a lot more documentation. And besides, don't we
>> actually want to protect struct ath10k::peers, not this?
>
> Parts of the structure needs to be locked differently.
>
> I suppose we can say we just protect everything with data_lock except
> `struct list_head list` which needs to be write-protected by both
> conf_mutex and data_lock. But then again, addr and vdev_id don't need
> any locking as they are immutable (and set before adding to the list).

I guess this depends from the point of view. In my opinion struct
ath10k::peers is the actual list and that's why the main documentation
needs to be above struct ath10k::peers field. And I would guess that's
there most people check there for documentation first.

But if we have special rules within struct ath10k_peer (excluding the
list field), we can document that within struct ath10k_peer.

-- 
Kalle Valo

_______________________________________________
ath10k mailing list
ath10k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath10k

WARNING: multiple messages have this Message-ID (diff)
From: Kalle Valo <kvalo@qca.qualcomm.com>
To: Michal Kazior <michal.kazior@tieto.com>
Cc: "ath10k@lists.infradead.org" <ath10k@lists.infradead.org>,
	Ben Greear <greearb@candelatech.com>,
	linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: [RFTv2 3/5] ath10k: rework peer accounting
Date: Fri, 11 Apr 2014 09:31:56 +0300	[thread overview]
Message-ID: <87mwfsfkbn.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <CA+BoTQ=c+dTcK_diBKi6VJVgUkyBv21bDkRf+9GvGyhhqqMuNQ@mail.gmail.com> (Michal Kazior's message of "Thu, 10 Apr 2014 09:11:13 +0200")

Michal Kazior <michal.kazior@tieto.com> writes:

> On 10 April 2014 08:59, Kalle Valo <kvalo@qca.qualcomm.com> wrote:
>> Michal Kazior <michal.kazior@tieto.com> writes:
>>
>>> It was troublesome to iterate over peers and
>>> perform sleepable calls. This will be necessary
>>> for some upcomming changes to tx flushing.
>>>
>>> Make peer allocation and initial setup
>>> protected by both ar->conf_mutex and
>>> ar->data_lock. This way it's possible to iterate
>>> over peers with conf_mutex and call sleepable
>>> functions.
>>>
>>> Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
>>
>> First comments, but I need to read this much more carefully still:
>>
>>> --- a/drivers/net/wireless/ath/ath10k/core.h
>>> +++ b/drivers/net/wireless/ath/ath10k/core.h
>>> @@ -199,9 +199,14 @@ struct ath10k_dfs_stats {
>>>  #define ATH10K_MAX_NUM_PEER_IDS (1 << 11) /* htt rx_desc limit */
>>>
>>>  struct ath10k_peer {
>>> +     /* protected by conf_mutex + data_lock */
>>>       struct list_head list;
>>
>> This really needs a lot more documentation. And besides, don't we
>> actually want to protect struct ath10k::peers, not this?
>
> Parts of the structure needs to be locked differently.
>
> I suppose we can say we just protect everything with data_lock except
> `struct list_head list` which needs to be write-protected by both
> conf_mutex and data_lock. But then again, addr and vdev_id don't need
> any locking as they are immutable (and set before adding to the list).

I guess this depends from the point of view. In my opinion struct
ath10k::peers is the actual list and that's why the main documentation
needs to be above struct ath10k::peers field. And I would guess that's
there most people check there for documentation first.

But if we have special rules within struct ath10k_peer (excluding the
list field), we can document that within struct ath10k_peer.

-- 
Kalle Valo

  parent reply	other threads:[~2014-04-11  6:32 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-04 11:37 [RFT 0/4] ath10k: fix flushing and tx stalls Michal Kazior
2014-04-04 11:37 ` Michal Kazior
2014-04-04 11:37 ` [RFT 1/4] ath10k: fix wmi-htc tx credit starvation Michal Kazior
2014-04-04 11:37   ` Michal Kazior
2014-04-04 11:37 ` [RFT 2/4] ath10k: rework peer accounting Michal Kazior
2014-04-04 11:37   ` Michal Kazior
2014-04-04 11:37 ` [RFT 3/4] ath10k: wait for mgmt tx when flushing too Michal Kazior
2014-04-04 11:37   ` Michal Kazior
2014-04-04 11:37 ` [RFT 4/4] ath10k: improve tx flushing Michal Kazior
2014-04-04 11:37   ` Michal Kazior
2014-04-08  6:58   ` Kalle Valo
2014-04-08  6:58     ` Kalle Valo
2014-04-04 14:49 ` [RFT 0/4] ath10k: fix flushing and tx stalls Ben Greear
2014-04-04 14:49   ` Ben Greear
2014-04-04 18:31   ` Dave Taht
2014-04-04 18:31     ` Dave Taht
2014-04-07  9:06   ` Michal Kazior
2014-04-07  9:06     ` Michal Kazior
2014-04-07  0:30 ` Ben Greear
2014-04-07  0:30   ` Ben Greear
2014-04-07  1:05   ` Ben Greear
2014-04-07  1:05     ` Ben Greear
2014-04-07  9:11   ` Michal Kazior
2014-04-07  9:11     ` Michal Kazior
2014-04-08  2:31     ` Ben Greear
2014-04-08  2:31       ` Ben Greear
2014-04-08  5:51       ` Michal Kazior
2014-04-08  5:51         ` Michal Kazior
2014-04-08 16:02         ` Ben Greear
2014-04-08 16:02           ` Ben Greear
2014-04-09  6:25           ` Michal Kazior
2014-04-09  6:25             ` Michal Kazior
2014-04-09 17:34             ` Ben Greear
2014-04-09 17:34               ` Ben Greear
2014-04-09 19:29               ` Ben Greear
2014-04-09 19:29                 ` Ben Greear
2014-04-10  3:45               ` Kalle Valo
2014-04-10  3:45                 ` Kalle Valo
2014-04-09 10:48 ` [RFTv2 0/5] ath10k: " Michal Kazior
2014-04-09 10:48   ` Michal Kazior
2014-04-09 10:48   ` [RFTv2 1/5] ath10k: always request htc tx replenishment Michal Kazior
2014-04-09 10:48     ` Michal Kazior
2014-04-09 10:48   ` [RFTv2 2/5] ath10k: fix wmi-htc tx credit starvation Michal Kazior
2014-04-09 10:48     ` Michal Kazior
2015-01-29  1:32     ` YanBo
2015-01-29  1:32       ` YanBo
2015-01-29  7:57       ` Michal Kazior
2015-01-29  7:57         ` Michal Kazior
2015-01-29 16:50         ` Ben Greear
2015-01-29 16:50           ` Ben Greear
2015-02-04 10:57         ` Matti Laakso
     [not found]         ` <54D1FA8F.6030804@elisanet.fi>
2015-02-04 11:27           ` Michal Kazior
2014-04-09 10:48   ` [RFTv2 3/5] ath10k: rework peer accounting Michal Kazior
2014-04-09 10:48     ` Michal Kazior
2014-04-10  6:50     ` Kalle Valo
2014-04-10  6:50       ` Kalle Valo
2014-04-10  6:56       ` Michal Kazior
2014-04-10  6:56         ` Michal Kazior
2014-04-10  6:59     ` Kalle Valo
2014-04-10  6:59       ` Kalle Valo
2014-04-10  7:11       ` Michal Kazior
2014-04-10  7:11         ` Michal Kazior
2014-04-10  7:18         ` Kalle Valo
2014-04-10  7:18           ` Kalle Valo
2014-04-10  7:43           ` Michal Kazior
2014-04-10  7:43             ` Michal Kazior
2014-04-11  6:22             ` Kalle Valo
2014-04-11  6:22               ` Kalle Valo
2014-04-11  6:31         ` Kalle Valo [this message]
2014-04-11  6:31           ` Kalle Valo
2014-04-11  4:59     ` Ben Greear
2014-04-11  4:59       ` Ben Greear
2014-04-09 10:48   ` [RFTv2 4/5] ath10k: wait for mgmt tx when flushing too Michal Kazior
2014-04-09 10:48     ` Michal Kazior
2014-05-13 20:09     ` Ben Greear
2014-05-15  7:24       ` Michal Kazior
2014-05-15 10:26         ` Kalle Valo
2014-05-15 13:05         ` Ben Greear
2014-04-09 10:48   ` [RFTv2 5/5] ath10k: improve tx flushing Michal Kazior
2014-04-09 10:48     ` Michal Kazior
2014-04-09 21:46   ` [RFTv2 0/5] ath10k: ath10k: fix flushing and tx stalls Ben Greear
2014-04-09 21:46     ` Ben Greear
2014-04-09 23:58     ` Ben Greear
2014-04-09 23:58       ` Ben Greear
2014-04-10  5:10       ` Michal Kazior
2014-04-10  5:10         ` Michal Kazior
2014-04-10  5:26         ` Ben Greear
2014-04-10  5:26           ` Ben Greear
2014-04-10  8:50           ` Michal Kazior
2014-04-10  8:50             ` Michal Kazior

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=87mwfsfkbn.fsf@kamboji.qca.qualcomm.com \
    --to=kvalo@qca.qualcomm.com \
    --cc=ath10k@lists.infradead.org \
    --cc=greearb@candelatech.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=michal.kazior@tieto.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.