DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: deco33000 Jog <deco33000@yandex.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] DPDK - TX from lcore in packet distributor configuration
Date: Wed, 21 Jan 2015 16:30:40 +0000	[thread overview]
Message-ID: <20150121163040.GA11720@bricha3-MOBL3> (raw)
In-Reply-To: <2523541421848850@web15h.yandex.ru>

On Wed, Jan 21, 2015 at 03:00:50PM +0100, deco33000 Jog wrote:
> Hello,
> 
> -- PROBLEM
> I have a AF_PACKET socket which is in promiscuous mode to get all the NIC traffic and let my apps do the whole stuff.
> 
> So I have one receiver and need to communicate the packet to different threads/processes (lcore) so that they can process the rest of the packet (tcp/udp...)
> 
> -- QUESTION
> I read about the packet distributor architecture which seems to answer that need.
> http://dpdk.org/doc/guides/prog_guide/packet_distrib_lib.html
> 
> BUT i fear that it be slow at resending the packet to the distributor which may already be overloaded by inputs from the net. Why pass back the answer to the distributor if the lcore could send to the wire directly ?
> 
> My problem is going back to the distributor after the packet processing. i would a direct send to the tx ring.
> 
> Is it possible ? How ?  By passing the TX pointer to the lcore ?

If you sent up the NIC so that it has multiple queues for each thread you can
have each worker send directly to the NIC. Without multiple queues, they could
still send directly, they will just have to use locking or some other access
mechanism to mediate access to the common TX queue.
The other problem with this approach is that sending packets individually is
almost always slower than sending them in bursts. To mitigate against this,
you could look to buffer packets inside the workers before transmitting them
back out, but that could lead to packets being sent out of order - not sure if
that is a problem for you or not.

The reason the distributor sample app sends the packets back to the distributor
after worker processing is to overcome these limitations. There is no additional
cross-core round trip involved in sending a packet back to the distributor along
with the request, and having the distributor re-gather the packets ensures ordering
within flows/tags is maintained. Thereafter packets can be burst-sent out an
ethernet port.

Out of interest, given you are using the AF_PACKET driver, what rate of packets
per second are you looking at? 

/Bruce

  reply	other threads:[~2015-01-21 16:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 14:00 deco33000 Jog
2015-01-21 16:30 ` Bruce Richardson [this message]
     [not found]   ` <3621191421867764@web4m.yandex.ru>
2015-01-21 19:25     ` deco33000 Jog

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=20150121163040.GA11720@bricha3-MOBL3 \
    --to=bruce.richardson@intel.com \
    --cc=deco33000@yandex.com \
    --cc=dev@dpdk.org \
    /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).