svn commit: r242739 - stable/9/sys/dev/ti
Adrian Chadd
adrian at freebsd.org
Thu Nov 8 04:53:21 UTC 2012
On 7 November 2012 18:38, YongHyeon PYUN <pyunyh at gmail.com> wrote:
> On Wed, Nov 07, 2012 at 06:15:30PM -0800, Adrian Chadd wrote:
>> So I am curious - did this give a real benefit?
>
> In 3.x/4.x days it surely have had helped a lot, I guess mainly
> because the CPU was not fast enough to saturate the link with
> software checksum(i.e. NFS over UDP).
Right.
> Generally I prefer correctness to performance and it seems there
> is no easy way to get full advantage of TCP/UDP checksum offloading
> of controller on fragmented IP packets on FreeBSD 8+. So I disabled
> it to reduce the chance of generating corrupted packets.
Right. The problem here is that if_transmit pushes the locking to the
driver, but there's no way to guarantee that the frames aren't
interleaved with other parallel invocations of if_transmit().
Since SMP in 3.x and 4.x didn't really support multiple CPUs in kernel
space, this wouldn't have been a problem. Ie, the network layer didn't
explicitly define the behaviour with concurrent kernel senders,
because that concept didn't exist yet.
>> If so, may I suggest we perhaps accelerate discussing if_transmit() of
>> multiple frames per call?
>
> Hmm, actually I'm still not a fan of if_transmit() at this moment.
> Honestly I don't have good queuing code in driver to handle queue
> full condition. Interactions with altq(9) is also one of my
> concern as well as packet reordering issue of drbr(9) interface.
>
Well, can you provide me with some embedded hardware that has this
particular NIC and multiple CPUs?
I'd like to tinker with this but the SMP systems I have contain em
NICs and I don't really feel up to hacking up this idea on the em(4)
driver. :-)
I have a vague idea of making if_transmit() as an interface be able to
send multiple frames at once - so the TCP/UDP code could generate all
the fragments and fire them off at once to the NIC. This should fix
your issue and begin allowing devices to take advantage of
multiple-dispatch rather than one if_transmit() call at a time.
We could create a device or interface flag that indicates whether the
driver can handle multiple mbufs chained via m_nextpkt through
if_transmit(), and then teach one or two drivers that particular
logic.
What do you think?
Adrian
More information about the freebsd-net
mailing list