mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Vladimir Oltean <olteanv@gmail.com>, David Miller <davem@davemloft.net>
Cc: Vivien Didelot <vivien.didelot@gmail.com>,
	Andrew Lunn <andrew@lunn.ch>, netdev <netdev@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 0/2] Improvements to the DSA deferred xmit
Date: Fri, 3 Jan 2020 12:10:44 -0800	[thread overview]
Message-ID: <4866462c-9e2b-ed7c-03a9-a2e81decf0c7@gmail.com> (raw)
In-Reply-To: <CA+h21horyGwqBTyBSVDRSSOSAPr_3i1dvz40=qKQMD_Nddtk3Q@mail.gmail.com>

On 1/2/20 2:47 PM, Vladimir Oltean wrote:
> Hi David,
> 
> On Thu, 2 Jan 2020 at 23:49, David Miller <davem@davemloft.net> wrote:
>>
>> Two comments about this patch series, I think it needs more work:
>>
> 
> Thanks for looking at this series.
> 
>> 1) This adds the thread and the xmit queue but not code that actually
>>    uses it.  You really have to provide the support code in the driver
>>    at the same time you add the new facitlity so we can actually see
>>    how it'll be used.
>>
> 
> There is no API change here. There was, and still is, a single caller
> of dsa_defer_xmit in the kernel, from net/dsa/tag_sja1105.c:
> 
>     if (unlikely(sja1105_is_link_local(skb)))
>         return dsa_defer_xmit(skb, netdev);
> 
> The whole difference is that what used to be a schedule_work() in that
> function is now a kthread_queue_work() call.
> 
>> 2) Patch #1 talks about a tradeoff.  Replacing the CB initialization of
>>    the field skb_get().  But this skb_get() is an atomic operation and
>>    thus much more expensive for users of the deferred xmit scheme.
>>
> 
> Ok, I'll admit I hadn't considered the exact penalty introduced by
> skb_get, but I think it is a matter of proportions.
> Worst case I expect no more than 64 packets per second to be
> transmitted using the deferred xmit mechanism: there are 4 switch
> ports, PTP runs with a sync interval of 1/8 seconds, and the STP hello
> timer is 2 seconds. So, not a lot of traffic.
> On the other hand, clearing the deferred_xmit bool from the skb->cb is
> something that everybody else (including this driver for "normal"
> traffic) needs to do at line rate, just for the above 64 packets per
> second (in the worst case) to be possible.

I sincerely think your transmit path is so radically different that your
sja1105 driver should simply be absorbing all of this logic and the core
DSA framework should be free of any deferred transmit logic. Can you
consider doing that before the merge window ends?
-- 
Florian

  reply	other threads:[~2020-01-03 20:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-27  1:42 Vladimir Oltean
2019-12-27  1:42 ` [PATCH net-next 1/2] net: dsa: Remove deferred_xmit from dsa_skb_cb Vladimir Oltean
2019-12-27  1:42 ` [PATCH net-next 2/2] net: dsa: Create a kernel thread for each port's deferred xmit work Vladimir Oltean
2020-01-02 21:49 ` [PATCH net-next 0/2] Improvements to the DSA deferred xmit David Miller
2020-01-02 22:47   ` Vladimir Oltean
2020-01-03 20:10     ` Florian Fainelli [this message]
2020-01-04  2:44       ` Richard Cochran

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=4866462c-9e2b-ed7c-03a9-a2e81decf0c7@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@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®