Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Aug 2015 11:10:12 +0300
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        Yonghyeon PYUN <pyunyh@gmail.com>
Cc:        Rick Macklem <rmacklem@uoguelph.ca>, Hans Petter Selasky <hps@selasky.org>, FreeBSD stable <freebsd-stable@freebsd.org>, FreeBSD Net <freebsd-net@freebsd.org>, Slawa Olhovchenkov <slw@zxy.spb.ru>, Christopher Forgeron <csforgeron@gmail.com>, Daniel Braniss <danny@cs.huji.ac.il>
Subject:   Re: ix(intel) vs mlxen(mellanox) 10Gb performance
Message-ID:  <20150820081012.GY75813@glebius.int.ru>
In-Reply-To: <20150820023024.GB996@michelle.fasterthan.com>
References:  <1D52028A-B39F-4F9B-BD38-CB1D73BF5D56@cs.huji.ac.il> <9D8B0503-E8FA-43CA-88F0-01F184F84D9B@cs.huji.ac.il> <1721122651.24481798.1439902381663.JavaMail.zimbra@uoguelph.ca> <55D333D6.5040102@selasky.org> <1325951625.25292515.1439934848268.JavaMail.zimbra@uoguelph.ca> <55D429A4.3010407@selasky.org> <20150819074212.GB964@michelle.fasterthan.com> <55D43615.1030401@selasky.org> <2013503980.25726607.1439989235806.JavaMail.zimbra@uoguelph.ca> <20150820023024.GB996@michelle.fasterthan.com>

next in thread | previous in thread | raw e-mail | index | archive | help
  Yonghyeon,

On Thu, Aug 20, 2015 at 11:30:24AM +0900, Yonghyeon PYUN wrote:
Y> > > >> Maybe it can be controlled by some kind of flag, if all the three TSO
Y> > > >> limits should include the TCP/IP/ethernet headers too. I'm pretty sure
Y> > > >> we want both versions.
Y> > > >>
Y> > > >
Y> > > > Hmm, I'm afraid it's already complex.  Drivers have to tell almost
Y> > > > the same information to both bus_dma(9) and network stack.
Y> > > 
Y> > > Don't forget that not all drivers in the tree set the TSO limits before
Y> > > if_attach(), so possibly the subtraction of one TSO fragment needs to go
Y> > > into ip_output() ....
Y> > > 
Y> > Ok, I realized that some drivers may not know the answers before ether_ifattach(),
Y> > due to the way they are configured/written (I saw the use of if_hw_tsomax_update()
Y> > in the patch).
Y> 
Y> I was not able to find an interface that configures TSO parameters
Y> after if_t conversion.  I'm under the impression
Y> if_hw_tsomax_update() is not designed to use this way.  Probably we
Y> need a better one?(CCed to Gleb).

Yes. In the projects/ifnet all the TSO stuff is configured differently.

I'd really appreciate if other developers look there and review it,
try it, give some input.

Here is a snippet from net/if.h in projects/ifnet:

/*
 * Structure describing TSO properties of an interface.  Known both to ifnet
 * layer and TCP.  Most interfaces point to a static tsomax in ifdriver  
 * definition.  However, vlan(4) and lagg(4) require a dynamic tsomax.
 */
struct iftsomax {
        uint32_t tsomax_bytes;    /* TSO total burst length limit in bytes */ 
        uint32_t tsomax_segcount; /* TSO maximum segment count */
        uint32_t tsomax_segsize;  /* TSO maximum segment size in bytes */
};

Now closer to your original question. I haven't yet converted lagg(4), so
haven't yet worked on if_hw_tsomax_update(). I am convinced that it shouldn't
be needed for a regular driver (save lagg(4).

A proper driver should first study its hardware and only then call if_attach().
Correct me if am wrong, please.

Also, I suppose, that a piece of hardware can't change its TSO maximums at
runtime, so I don't see reason for changing them at runtime (save lagg(4)).

-- 
Totus tuus, Glebius.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150820081012.GY75813>