2001-12-29 07:16:44

by Daniel Stodden

[permalink] [raw]
Subject: NETIF_F_(SG|FRAGLIST|HIGHDMA) docs anywhere?


hi.

software-only network device, currently implementing none of the
dev->features flags.

the driver transmits packets via pci dma to other processors residing on
a shared PCI bus segment. so i guess supporting at least scatter/gather
should give some performance improvements in order to get rid of
skb_linearize() on xmit? since transmission is done completely by the
local cpu, all of F_SG/FRAGLIST/HIGHDMA look relatively easy to
implemement to me.

my major problem is test cases and getting the picture behind these
structures. is there any documentation around on the
skb_shinfo(skb)->frags and skb_shinfo(skb)->frag_list stuff? i've spend
quite some time now trying to figure out exactly under which
circumstances which of both applies. not too successful i must admit :)

frag_list seems to be the list involved with keeping track of ip
fragmentation. so dev->hard_start_xmit() with frag_list set would only
happen on routers or when??

when is nr_frags>0? i've found some postings indicating sendfile(2) will
benefit here. is this the only case? need some test code..

any hint appreciated,
dns

--
___________________________________________________________________________
mailto:[email protected]


Attachments:
(No filename) (232.00 B)

2001-12-29 12:54:58

by Manfred Spraul

[permalink] [raw]
Subject: Re: NETIF_F_(SG|FRAGLIST|HIGHDMA) docs anywhere?

> my major problem is test cases and getting the picture behind these
> structures.

Check skb_copy_and_csum_dev, used by the 8139too and via-rhine
network drivers: that's a software-only implementation of the NETIF_F_
flags.

Note that the kernel never uses scatter-gather without hardware
checksumming: concurrent sendfile()+write() would create packets
with invalid checksums.

--
Manfred


2001-12-29 19:16:59

by Alexey Kuznetsov

[permalink] [raw]
Subject: Re: NETIF_F_(SG|FRAGLIST|HIGHDMA) docs anywhere?

Hello!

> so i guess supporting at least scatter/gather
> should give some performance improvements in order to get rid of
> skb_linearize() on xmit?

I beg pardon but before strating to fight problems, it is necessary
to force kernel to prepare something different of linear skbs. :-)

What's about checksumming? Do you plan to ignore it?


> since transmission is done completely by the
> local cpu, all of F_SG/FRAGLIST/HIGHDMA look relatively easy to
> implemement to me.=20

I see no connection between "cpu locality" and frgamtn hadling at all.


> frag_list seems to be the list involved with keeping track of ip
> fragmentation. so dev->hard_start_xmit() with frag_list set would only
> happen on routers or when??

In stock kernels: _never_. Packets are not defragmented by routers,
and netfilter linearizes everything in any case.

Anyway, if the driver is able to provide some facility, why not to do this?

> when is nr_frags>0? i've found some postings indicating sendfile(2) will
> benefit here. is this the only case?

Yes.

Which means that the task is not so sexy. :-)

Alexey