public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Anderson <sean.anderson@linux.dev>
To: Eric Dumazet <edumazet@google.com>
Cc: "David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>,
	netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, Michal Simek <michal.simek@amd.com>,
	Heng Qi <hengqi@linux.alibaba.com>
Subject: Re: [PATCH net-next 2/2] net: xilinx: axienet: Enable adaptive IRQ coalescing with DIM
Date: Thu, 5 Sep 2024 10:27:41 -0400	[thread overview]
Message-ID: <9f74395f-55f6-46f3-8a84-bbf033e0f2d9@linux.dev> (raw)
In-Reply-To: <CANn89iJki26SoevkdvcFO8HBCDbXR4-0nyZ55fFb2B66Pk63qA@mail.gmail.com>

On 9/4/24 13:04, Eric Dumazet wrote:
> On Tue, Sep 3, 2024 at 9:25 PM Sean Anderson <sean.anderson@linux.dev> wrote:
>>
> 
>> +
>> +/**
>> + * axienet_rx_dim_work() - Adjust RX DIM settings
>> + * @work: The work struct
>> + */
>> +static void axienet_rx_dim_work(struct work_struct *work)
>> +{
>> +       struct axienet_local *lp =
>> +               container_of(work, struct axienet_local, rx_dim.work);
>> +
>> +       rtnl_lock();
> 
> Why do you need rtnl ?

To protect against concurrent modification in axienet_ethtools_set_coalesce.

> This is very dangerous, because cancel_work_sync(&lp->rx_dim.work)
> might deadlock.

Ah, you're right. So maybe I should add a separate mutex for this.

--Sean

>> +       axienet_dim_coalesce_rx(lp);
>> +       axienet_update_coalesce_rx(lp);
>> +       rtnl_unlock();
>> +
>> +       lp->rx_dim.state = DIM_START_MEASURE;
>> +}
>>


  reply	other threads:[~2024-09-05 14:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-03 19:25 [PATCH net-next 0/2] net: xilinx: axienet: Enable adaptive IRQ coalescing with DIM Sean Anderson
2024-09-03 19:25 ` [PATCH net-next 1/2] net: xilinx: axienet: Support adjusting coalesce settings while running Sean Anderson
2024-09-03 19:25 ` [PATCH net-next 2/2] net: xilinx: axienet: Enable adaptive IRQ coalescing with DIM Sean Anderson
2024-09-04 17:04   ` Eric Dumazet
2024-09-05 14:27     ` Sean Anderson [this message]
2024-09-04 16:35 ` [PATCH net-next 0/2] " Simon Horman
2024-09-05 14:27   ` Sean Anderson
2024-09-06  7:03     ` Simon Horman

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=9f74395f-55f6-46f3-8a84-bbf033e0f2d9@linux.dev \
    --to=sean.anderson@linux.dev \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hengqi@linux.alibaba.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=radhey.shyam.pandey@amd.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