mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kuznet@ms2.inr.ac.ru
To: kambo@home.COM
Cc: linux-kernel@vger.kernel.org
Subject: Re: CONFIG_PACKET_MMAP help
Date: Fri, 20 Apr 2001 20:03:28 +0400 (MSK DST)	[thread overview]
Message-ID: <200104201603.UAA00975@ms2.inr.ac.ru> (raw)
In-Reply-To: <10336.010418@home.com> from "kambo@home.COM" at Apr 19, 1 04:15:05 am

Hello!

> 1. for tp_frame_size, I dont want to truncate any data on ethernet, I
> need 1514 bytes, is this the best way to do it and not waste space?

To select small snapsize (obtained from later experiments),
to set PACKET_COPY_THRESH to read larger packets via recvmsg().

> 2. what is tp_block_nr for?  I dont understand it, I just set it to 1
> and make tp_block_size big enough for all the frames I need, so its
> just one contiguous space, all I need is about a megabyte I think.

Kernel has problems with allocating large chunks of memory.
If you see problems with allocating large chuns, split them
to less ones.

> while(1) {
>    if (tp->status == 0) poll() for pollin on the socket  /* is there a
>    race here? */

No. poll returns, when new frame appears.


> 4. what does the copy threshold setsockopt tuning accomplish? doesnt it always
> have to copy anyway, to the mmaped area?

see anser to question 1. It has a sense when size of chunk is small enough.
Small packets are copied to ring, large ones (which are truncated) are queued
to socket to be received via recvmsg().

Alexey

      parent reply	other threads:[~2001-04-20 16:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-18 12:04 kambo
2001-04-19  4:41 ` Edgar Toernig
2001-04-20 16:03 ` kuznet [this message]

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=200104201603.UAA00975@ms2.inr.ac.ru \
    --to=kuznet@ms2.inr.ac.ru \
    --cc=kambo@home.COM \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®