Netdev List
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Ronny Meeus <ronny.meeus@gmail.com>
Cc: netdev <netdev@vger.kernel.org>
Subject: Re: Question: How to configure the Ethernet receive buffer allocation (was: (no subject)).
Date: Sat, 13 Oct 2012 10:58:18 +0200	[thread overview]
Message-ID: <1350118698.21172.13737.camel@edumazet-glaptop> (raw)
In-Reply-To: <CAMJ=MEd89zzLhxt7FYOVCbh5OzW+8jAsx38uV53zCodXvVtfMQ@mail.gmail.com>

On Sat, 2012-10-13 at 10:39 +0200, Ronny Meeus wrote:
> Hello
> 
> I have an application that needs to handle a massive amount of
> Ethernet packets coming from an FPGA on a dedicated Ethernet link.
> I use a raw Ethernet socket for this. By increasing the receive buffer
> of the socket, I'm able to capture all the packets and process them in
> the application. Since this processing can take some time I have
> increased the receive buffer to 500Mb. The size of the packets is
> 1000bytes so I'm able to capture 500k packets.
> 
> What I observe is that the kernel allocates buffers from the
> slaballoctor for these packets but it takes buffers of 4k while in
> fact the packet is only 1k (This means 2G of kernel memory  is being
> used).
> Is it possible to fine-tune this or is that an alternative for this?
> 
> I already investigated the PACKET_RX_RING solution. This has the
> advantage that the buffers can be 1k but  I do not want to consume
> 500Mb of virtual memory in my application which is running on MIPS in
> 32 bit mode where I only have 2G available in user space.
> 

Need some information 

- Kernel version
- Driver used
- MTU of the link  (default MTU is 1500)

  reply	other threads:[~2012-10-13  8:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-13  8:39 Question: How to configure the Ethernet receive buffer allocation (was: (no subject)) Ronny Meeus
2012-10-13  8:58 ` Eric Dumazet [this message]
2012-10-13  9:10   ` Ronny Meeus
2012-10-13 10:14     ` Ronny Meeus
2012-10-13 10:29       ` Eric Dumazet
2012-10-13 11:18         ` Ronny Meeus

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=1350118698.21172.13737.camel@edumazet-glaptop \
    --to=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=ronny.meeus@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