netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <zbr@ioremap.net>
To: "Lovich, Vitali" <vlovich@qualcomm.com>
Cc: Johann Baudy <johaahn@gmail.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: [PATCH] Packet socket: mmapped IO: PACKET_TX_RING
Date: Thu, 6 Nov 2008 22:40:32 +0300	[thread overview]
Message-ID: <20081106194032.GB31673@ioremap.net> (raw)
In-Reply-To: <FCC0EC655BD1AE408C047268D1F5DF4C3BA60FA8@NASANEXMB10.na.qualcomm.com>

Hi Vitali.

On Thu, Nov 06, 2008 at 10:49:36AM -0800, Lovich, Vitali (vlovich@qualcomm.com) wrote:
> > What if skb was queued in hardware or qdisk and userspace rewrites
> > mapped page placed in fraglist?
> Can you please clarify what you mean?  Are you talking about the user changing the status field after the skb was queued?  Or are you saying that the user may ask the kernel to resize the ring buffer while the skb is queued?
> 
> In the first case, I don't think we don't really care - the user is breaking their side of the contract, but we'll still have a valid address since the page pointer should still be valid.
> 
> In the second case, the behaviour is undefined because the hardware would use those page pointers for its scatter-gather which would, best case, cause the skb to fail (kernel oops is more likely I think).  We can add this to the documentation, but in the end there's nothing we can really do outside of copying data from the ring buffer into the skb, which defeats the point of doing this.

I'm not sure that it is allowed to fail even for root. System could
sleep and not permit the resize until all skbs are freed though.

> > It is not allowed to store something in cb block which is intended to
> > live while skb is processed on different layers. In this particular
> > case
> > qdisk engine will overwrite skb's cb.
> > 
> That's what I figured - however, I was wondering if we even need to go through the qdisc engine.  Couldn't we just bypass it and send out packets directly through the card (i.e. dev_hard_start_xmit) similar to how pktgen does this?  I haven't looked at the documentation (I'm not actually sure with which to start), but are there any caveats that need to be considered (e.g. must be called outside of an interrupt, can't be interruptible, etc.)
> 
> The reason I'm thinking we'd want to bypass the qdisc engine is that the idea is that you would use this method only if you want the most performance possible, so why is packet scheduling even needed?  The approach I'm thinking is that if the tx-ring buffer is implemented, we can even get rid of the in-kernel pktgen and port it over to user-space as an example of how to utilize the tx-ring buffer.

I can not say if it is good or bad idea, it is not my project :)
But existing packet socket does not bypass qdisc, so users may expect
the same from the new interface. Overall idea of storing something in cb
and expect it to live there between layers is very subtle: what if
tomorrow we will gen new layer between driver and qdisc? Or if we will
start updating cb in the driver itself when it owns skb?

-- 
	Evgeniy Polyakov

  reply	other threads:[~2008-11-06 19:40 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-31 10:58 [PATCH] Packet socket: mmapped IO: PACKET_TX_RING Johann Baudy
2008-10-31 17:07 ` Lovich, Vitali
2008-10-31 18:24   ` Lovich, Vitali
2008-11-04 22:45     ` Johann Baudy
2008-11-06  0:47       ` Lovich, Vitali
2008-11-06  8:03         ` Evgeniy Polyakov
2008-11-06 18:49           ` Lovich, Vitali
2008-11-06 19:40             ` Evgeniy Polyakov [this message]
2008-11-06 19:53               ` Lovich, Vitali
2008-11-07 16:36                 ` Johann Baudy
2008-11-07 17:19                   ` Lovich, Vitali
2008-11-10 20:29                     ` Lovich, Vitali
2008-11-11  0:29                       ` Lovich, Vitali
     [not found]                         ` <7e0dd21a0811110656yff651afp8ff0f9928b79f545@mail.gmail.com>
2008-11-11 14:59                           ` Johann Baudy
2008-11-11 19:05                             ` Lovich, Vitali
2008-11-11 12:10                       ` Johann Baudy
2008-11-11 17:44                         ` Lovich, Vitali
2008-11-11 18:08                           ` Johann Baudy
2008-11-11 18:19                             ` Lovich, Vitali
2008-11-11 18:59                               ` Johann Baudy
2008-11-11 19:10                                 ` Lovich, Vitali
2008-11-12 12:09                                   ` Johann Baudy
2008-11-12 17:12                                     ` Lovich, Vitali
2008-11-11 11:43                     ` Johann Baudy
2008-11-11 17:38                       ` Lovich, Vitali
2008-11-11 17:50                         ` Johann Baudy
2008-11-11 18:14                           ` Lovich, Vitali
2008-11-11 18:50                             ` Evgeniy Polyakov
2008-11-11 19:19                               ` Johann Baudy
2008-11-11 19:29                                 ` Evgeniy Polyakov
2008-11-12 13:43                                   ` Johann Baudy
2008-11-12 13:58                                     ` Evgeniy Polyakov
2008-11-12 17:07                                       ` Lovich, Vitali
2008-11-12 17:41                                         ` Evgeniy Polyakov
2008-11-12 17:59                                           ` Lovich, Vitali
2008-11-12 18:11                                             ` Evgeniy Polyakov
2008-11-12 19:05                                               ` Lovich, Vitali
2008-11-12 19:14                                                 ` Evgeniy Polyakov
2008-11-12 21:23                                                   ` Lovich, Vitali
2008-11-12 21:46                                                     ` Evgeniy Polyakov
2008-11-12 22:33                                                       ` Lovich, Vitali
2008-11-18 18:49                                                       ` Johann Baudy
2008-11-18 19:10                                                         ` Evgeniy Polyakov
2008-11-18 19:46                                                         ` Lovich, Vitali
2008-11-07 17:28                 ` Evgeniy Polyakov
2008-11-07 20:22                   ` David Miller
2008-10-31 20:28   ` Evgeniy Polyakov
2008-11-04 22:33   ` Johann Baudy
2008-11-05  1:50     ` Lovich, Vitali
  -- strict thread matches above, loose matches on Subject: below --
2008-11-12 13:19 Johann Baudy
2008-11-05 15:16 Johann Baudy
2008-11-05 17:49 ` Lovich, Vitali
2008-11-05 10:55 Johann Baudy
2008-11-05 11:02 ` Patrick McHardy
2008-11-05 17:32 ` Lovich, Vitali
2008-10-30 13:00 Johann Baudy
2008-10-30 18:21 ` Lovich, Vitali
2008-10-27  9:33 Johann Baudy
2008-10-28 22:44 ` David Miller

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=20081106194032.GB31673@ioremap.net \
    --to=zbr@ioremap.net \
    --cc=johaahn@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=vlovich@qualcomm.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;
as well as URLs for NNTP newsgroup(s).