Intel 10Gb

Alexander Sack pisymbol at gmail.com
Fri May 14 16:13:43 UTC 2010


On Fri, May 14, 2010 at 11:41 AM, Andrew Gallatin <gallatin at cs.duke.edu> wrote:
> Alexander Sack wrote:
>> On Fri, May 14, 2010 at 10:07 AM, Andrew Gallatin <gallatin at cs.duke.edu>
>> wrote:
>>> Alexander Sack wrote:
>>> <...>
>>>>> Using this driver/firmware combo, we can receive minimal packets at
>>>>> line rate (14.8Mpps) to userspace.  You can even access this using a
>>>>> libpcap interface.  The trick is that the fast paths are OS-bypass,
>>>>> and don't suffer from OS overheads, like lock contention.  See
>>>>> http://www.myri.com/scs/SNF/doc/index.html for details.
>>>> But your timestamps will be atrocious at 10G speeds.  Myricom doesn't
>>>> timestamp packets AFAIK.  If you want reliable timestamps you need to
>>>> look at companies like Endace, Napatech, etc.
>>> I see your old help ticket in our system.  Yes, our timestamping
>>> is not as good as a dedicated capture card with a GPS reference,
>>> but it is good enough for most people.
>>
>> I was told btw that it doesn't timestamp at ALL.  I am assuming NOW
>> that is incorrect.
>
> I think you might have misunderstood how we do timestamping.
> I definately don't understand it, and I work there ;)

No problem.  :)

> I do know that there is NIC component of it (eg, it is not 100%
> done in the host).  I also realize that it is not is good as
> something that is 1PPS GPS based.

I need to grab your docs and start reading it again.  I would like to
support data capture using the Myricom card.  I somehow missed this.
I had thought the timestamps were software generated only.

>
>> Define *most* people.
>
> I may have a skewed view of the market, but it seems like
> some people care deeply about accurate timestamps, and
> others (mostly doing deep packet inspection) care only
> within a few milliseconds, or even seconds.

In our case Andrew, the folks who are doing deep packet inspection
REQUIRE reasonable time stamps to correlate events and do generate
reasonable stats.

But I hear you, if you are just looking to see the packet data, then
timestamp accuracy isn't your top priority.

>> Question for Jack or Drew, what DOES FreeBSD have to do to support
>> DCA?  I thought DCA was something you just enable on the NIC chipset
>> and if the system is IOATDMA aware, it just works.  Is that not right
>> (assuming cache tags are correct and accessible)?  i.e. I thought this
>> was hardware black magic than anything specific the OS has to do.
>
> IOATDMA and DCA are sort of unfairly joined for two reasons: The DCA
> control stuff is implemented as part of the IOATDMA PCIe device, and
> IOATDMA is a great usage model for DCA, since you'd want the DMAs
> that it does to be prefetched.
>
> To use DCA you need:
>
> - A DCA driver to talk to the IOATDMA/DCA pcie device, and obtain the tag
>        table
> - An interface that a client device (eg, NIC driver) can use to obtain
>        either the tag table, or at least the correct tag for the CPU
>        that the interrupt handler is bound to.  The basic support in
>        a NIC driver boils down to something like:
>
> nic_interrupt_handler()
> {
>  if (sc->dca.enabled && (curcpu != sc->dca.last_cpu)) {
>     sc->dca.last_cpu = curcpu;
>     tag = dca_get_tag(curcpu);
>     WRITE_REG(sc, DCA_TAG, tag);
>  }
> }

Drew, at least in the Intel documentation, it seems the NIC uses the
LAPIC id to tell the PCIe TLPs where to put inbound NIC I/O (in the
TLP the DCA info is stored) to the appropriate core's cache.  i.e. the
heuristic you gave above is more granular than what I think Intel
does.  I could be wrong, maybe Jack can chime in and correct me.  But
it seems with Intel chipsets it is a per queue parameter which allows
you to bind a core cache's to a queue via DCA.  The added piece to
this for at least bpf(4) consumers is to have bpf(4) subscribe to
these queues AND to allow an interface for libpcap applications to
know where what queue is on what core and THEN bind to it.

I think that is the general idea....I think!  :)

-aps


More information about the freebsd-performance mailing list