public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@mandrakesoft.com>
To: harish.vasudeva@amd.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: Info on ScatterGather
Date: Thu, 15 Nov 2001 14:52:21 -0500	[thread overview]
Message-ID: <3BF41CF5.A88DC57E@mandrakesoft.com> (raw)
In-Reply-To: <CB35231B9D59D311B18600508B0EDF2F0197A319@caexmta9.amd.com>

harish.vasudeva@amd.com wrote:
> 
> Hi All,
> 
>  I believe in the 2.4.x kernel LAN drivers can ask for scattered buffers on transmit. Is that what the NETIF_F_SG parm talks about?
> 
>  Also, on the receive side, is buffer chaining possible? ie, if the device gives us 2 buffers (for a single frame), can the driver send those 2 buffers directly to the OS or should the driver combine it into a single buffer before calling netif_rx ()


You need to fix your word wrap.

For transmit, NETIF_F_SG asks for scattered buffers, yes.  BUT.  You
need one of NETIF_F_HW_CSUM or NETIF_F_IP_CSUM along with it.  Otherwise
NETIF_F_SG is useless.  NETIF_F_HW_CSUM is for hardware that can
checksum a region of data. NETIF_F_IP_CSUM is for lesser hardware that
can only perform IP checksum on a pre-specified region of data.  
NETIF_F_IP_CSUM doesn't support IPv6 checksums for example, while
NETIF_F_HW_CSUM supports any protocol checksum.

For receive, you enable IP checksumming in a NIC-specific manner.  See
the long comment at the beginning of include/linux/skbuff.h.  If you
have lesser hardware that simply verifies the checksum, then you set
skb->ip_summed = CHECKSUM_UNNECESSARY, and value of skb->csum is
undefined.  If you have good network hardware, that supports checksum of
any region, then set skb->ip_summed = CHECKSUM_HW, and store the value
of the checksum in skb->csum.

Buffer chaining on Rx is possible.  Most people do not bother to
implement it, though, and instead ensure that the NIC always delivers
one packet in one buffer.  You have two options for Rx buffer chaining: 
store in skb_shinfo(skb)->frag_list, or skb_shinfo(skb)->frags array.
-- 
Jeff Garzik      | Only so many songs can be sung
Building 1024    | with two lips, two lungs, and one tongue.
MandrakeSoft     |         - nomeansno


      reply	other threads:[~2001-11-15 19:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-15 19:24 Info on ScatterGather harish.vasudeva
2001-11-15 19:52 ` Jeff Garzik [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=3BF41CF5.A88DC57E@mandrakesoft.com \
    --to=jgarzik@mandrakesoft.com \
    --cc=harish.vasudeva@amd.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