[Intel-wired-lan] [PATCH net v4 2/4] iavf: Don't lock rtnl_lock twice in reset
Wesierski, DawidX
dawidx.wesierski at intel.com
Mon Apr 24 12:27:08 UTC 2023
>From: Intel-wired-lan intel-wired-lan-bounces at osuosl.org<mailto:intel-wired-lan-bounces at osuosl.org> On Behalf Of Jacob Keller
>Sent: piątek, 21 kwietnia 2023 21:38
>To: intel-wired-lan at osuosl.org<mailto:intel-wired-lan at osuosl.org>
>Subject: Re: [Intel-wired-lan] [PATCH net v4 2/4] iavf: Don't lock rtnl_lock twice in reset
>
>
>
>On 4/20/2023 6:08 AM, Kamil Maziarz wrote:
>>
>> +/**
>> + * iavf_delayed_set_interrupt_capability - schedule the update of the
>> +netdev
>> + * @work: pointer to work_struct containing our data **/ static void
>> +iavf_delayed_set_interrupt_capability(struct work_struct *work) {
>> + struct iavf_adapter *adapter = container_of(work, struct iavf_adapter,
>> + set_interrupt_capability);
>> + int pairs = adapter->num_active_queues;
>> +
>> + if (rtnl_trylock()) {
>> + netif_set_real_num_rx_queues(adapter->netdev, pairs);
>> + netif_set_real_num_tx_queues(adapter->netdev, pairs);
>> + rtnl_unlock();
>> + } else {
>> + queue_work(adapter->wq, &adapter->set_interrupt_capability);
>> + }
>> +}
>> +
>
>This function still requeues itself instead of just rtnl_lock(). I'd at least like a justification as to why.
>_____
This function schedules itself in case it is impossible to update the netdev at a particular time.
This scenario could occur when multiple operations require the rtnl_lock simultaneously.
By implementing it this way, the function seems to introduce unnecessary operations during
testing with operations requiring reset in quick sucession. However, my thought process was to
make it more error-proof in normal use cases.
Do you think this information should be included inside the comment or commit message?
>Intel-wired-lan mailing list
>Intel-wired-lan at osuosl.org<mailto:Intel-wired-lan at osuosl.org>
>https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
>
---------------------------------------------------------------------
Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.
Spolka oswiadcza, ze posiada status duzego przedsiebiorcy w rozumieniu ustawy z dnia 8 marca 2013 r. o przeciwdzialaniu nadmiernym opoznieniom w transakcjach handlowych.
Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by others is strictly prohibited.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osuosl.org/pipermail/intel-wired-lan/attachments/20230424/293b59d0/attachment-0001.html>
More information about the Intel-wired-lan
mailing list