9front - general discussion about 9front
 help / color / mirror / Atom feed
From: cinap_lenrek@felloff.net
To: 9front@9front.org
Subject: Re: [9front] [patch] ethervgbe: add rx checksum offloading
Date: Thu, 08 Dec 2022 02:41:53 +0100	[thread overview]
Message-ID: <5F8CD36108E8E2775841BE403EB18383@felloff.net> (raw)
In-Reply-To: <CAFSF3XOTKWz8J0bwN9y_ae48WKbX3qZkC=nwq7TSfhRJjcBMtQ@mail.gmail.com>

sorry, but yes. we have a fast-path where we skip checking the ip header
cheksum if the Block has the flag that says it was already checked
by hardware:

	if((bp->flag & Bipck) == 0 && ipcsum(&h->vihl)) {
		netlog(f, Logip, "%V -> %V: bad ip header checksum\n", h->src, h->dst);
		goto drop;

i cannot say if this is really worth it tho. i have no measured it. and
the ip *HEADER* is not very big and the code in ipcsum() has a fast-path
in itself handling the common fixed header size case.

i would say the complexity of this is very low. all the ethernet driver
needs todo is set a flag on the Block to say hw already calculated the
ip header checksum.

also, we do not memcpy every packet. thats what Block's and Block lists
are about. the ip fragments are stored as lists of packets (with all the
headers) without touching them until it becomes really neccessary.
the Block's are directly filled by hardware dma in the common ethernet

maybe you ment when the payload gets passed to userspace? in that case,
yes, when data is tranferred between userspace and kernel memory it gets
copied. but within the kernel, qio/blocks are avoiding doing that.


      reply	other threads:[~2022-12-08  1:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11 16:13 Arne Meyer
2022-11-11 17:01 ` hiro
2022-11-11 17:35   ` Arne Meyer
2022-11-19 20:09     ` Arne Meyer
2022-11-19 21:36       ` ori
2022-11-20 12:44         ` hiro
2022-12-07 19:12           ` hiro
2022-12-08  1:41             ` cinap_lenrek [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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5F8CD36108E8E2775841BE403EB18383@felloff.net \
    --to=cinap_lenrek@felloff.net \
    --cc=9front@9front.org \


* 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).