Discussion:
adding new descriptor format to the if_wm driver
(too old to reply)
Vlad Balan
2012-07-05 21:37:45 UTC
Permalink
Dear all,

As part of my hardware timestamping project I am implementing
timestamping support in the Intel Gigabit ethernet driver (if_wm - the
Wiseman driver). The chipset that I am working with is Intel 82576,
whose documentation is available at:
ftp://ftp.pku.edu.cn/open/net/Intel-NIC/doc/OpenSDM_82576-DS-2p0.pdf

The current if_wm driver uses an older descriptor format which is
referred in the newer documentation as a "legacy" format. In order to
use the timestamping capability of the card to full extent, I would
need to replace these descriptors with a newer format, whose status
bits instruct the card whether for transmitted packets the send time
should be recorded and indicate whether a received packet's arrival
time has been recorded. While doing the change itself should not be
very hard, I am a bit afraid that I might break some of the
functionality of the driver in the process.

I was wondering whether anyone with experience in testing networking
drivers could assist me in testing my changes. My code is available on
SourceForge and the timestamp-specific parts can be easily disabled in
order to test just the new descriptors. I plan to do the
implementation of the new descriptor-managing code in the following
two weeks, after which the complete testing could start.

Regards,
Vlad

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Ignatios Souvatzis
2012-07-06 06:44:41 UTC
Permalink
Hi,
Post by Vlad Balan
The current if_wm driver uses an older descriptor format which is
referred in the newer documentation as a "legacy" format.
Say, are there older chips currently supported by if_wm that don't
understand the new descriptor format? If yes, we'd have to rename
either the driver with the old format, or the new one, when
integrating....

Regards,
-is

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Masanobu SAITOH
2012-07-06 07:21:43 UTC
Permalink
Hello, all.
Post by Ignatios Souvatzis
Hi,
Post by Vlad Balan
The current if_wm driver uses an older descriptor format which is
referred in the newer documentation as a "legacy" format.
Say, are there older chips currently supported by if_wm that don't
understand the new descriptor format? If yes, we'd have to rename
either the driver with the old format, or the new one, when
integrating....
Regards,
-is
If Vlad's change supports both older and newer descriptor format,
it's valuable to test it.

Vlad, offcourse I have 82576 card and many older cards, so I can
help you.
--
-----------------------------------------------
SAITOH Masanobu (***@execsw.org
***@netbsd.org)



--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
David Young
2012-07-06 21:38:50 UTC
Permalink
Post by Ignatios Souvatzis
Hi,
Post by Vlad Balan
The current if_wm driver uses an older descriptor format which is
referred in the newer documentation as a "legacy" format.
Say, are there older chips currently supported by if_wm that don't
understand the new descriptor format? If yes, we'd have to rename
either the driver with the old format, or the new one, when
integrating....
I hope that we can share most of the code.

What do the new and old descriptors look like, Vlad?

Dave
--
David Young
***@pobox.com Urbana, IL (217) 721-9981

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
SAITOH Masanobu
2012-07-07 16:06:30 UTC
Permalink
Post by David Young
Post by Ignatios Souvatzis
Hi,
Post by Vlad Balan
The current if_wm driver uses an older descriptor format which is
referred in the newer documentation as a "legacy" format.
Say, are there older chips currently supported by if_wm that don't
understand the new descriptor format? If yes, we'd have to rename
either the driver with the old format, or the new one, when
integrating....
I hope that we can share most of the code.
What do the new and old descriptors look like, Vlad?
Dave
Vlad? How do I get your code on SourceForge? Could you show the URL
or something?
--
-----------------------------------------------
SAITOH Masanobu (***@execsw.org
***@netbsd.org)



--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Vlad Balan
2012-07-07 18:06:06 UTC
Permalink
Dear all,

The descriptors for the new version and the legacy version are pretty similar in functionality, however the bit formats are rather different. Of course the new descriptors bring in new features, however some of those are not needed if we want a driver implementation that functions similarly to the current one. Such features include splitting the header and the payload into separate buffers, for example.

We should keep a single code base, since this is the only change between the old cards and the new cards.

To Saitoh, the URL for my code is:
http://netbsd-soc.cvs.sourceforge.net/viewvc/netbsd-soc/kerntimestamp/

The only files that one needs to graft into the kernel source to test the new descriptors are in sys/dev/pci/if_wm*. If you disable the WM_TIMESTAMPING flag, the timestamping dependencies are removed and you can test just the new descriptor code. So far I only have the header definitions for the descriptors, but I will let you know when I have running code.

Regards,
Vlad
Post by SAITOH Masanobu
Post by David Young
Post by Ignatios Souvatzis
Hi,
Post by Vlad Balan
The current if_wm driver uses an older descriptor format which is
referred in the newer documentation as a "legacy" format.
Say, are there older chips currently supported by if_wm that don't
understand the new descriptor format? If yes, we'd have to rename
either the driver with the old format, or the new one, when
integrating....
I hope that we can share most of the code.
What do the new and old descriptors look like, Vlad?
Dave
Vlad? How do I get your code on SourceForge? Could you show the URL
or something?
--
-----------------------------------------------
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
SAITOH Masanobu
2012-07-08 02:06:44 UTC
Permalink
 Hello, Vlad.
Post by Vlad Balan
http://netbsd-soc.cvs.sourceforge.net/viewvc/netbsd-soc/kerntimestamp/
The only files that one needs to graft into the kernel source to test the new descriptors are in sys/dev/pci/if_wm*. If you disable the WM_TIMESTAMPING flag, the timestamping dependencies are removed and you can test just the new descriptor code. So far I only have the header definitions for the descriptors, but I will let you know when I have running code.
Regards,
Vlad
Thank you, but I can't see sys/dev/pci/if_wm.c...
It seems the directory is empty...
--
-----------------------------------------------
SAITOH Masanobu (***@execsw.org
***@netbsd.org)

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Vlad Balan
2012-07-08 19:12:04 UTC
Permalink
Dear all,

Here is an update on the current status of my project, the parts that
are working and the things that I am still to implement:

The list of the currently implemented features is as follows:

I have enabled hardware timestamps in the Intel 82576 driver; timestamps
are saved as mtags associated with the packet; in ip_output (and
ip6_output) we check for the timestamping socket options and pass them
as cmsg data to the app

I have added support for the different timestamping ioctl options in
the 82576 driver.

I have developed a general framework for timestamping in
net/net_tstamp.h, which serves in
making the connection between the driver and the socket output.

I have modified timestamping.c (the Linux timestamping check application)
into a timestamping_rx.c that does not include the tx part (we do not
support yet the snd_err queue);
I have checked that this app gets the timestamps from the driver -
therefore the whole path from driver to user level has been checked
and is working

Here is what is still open and where I have encountered problems:

The Intel 82576 driver needs to be modified in order to use a newer
version of the transmit and receive packet descriptors (the current
ones are legacy descriptors); The new tx descriptors provide a bit for
requesting that the hardware records a timestamp for the current
packet. The new rx descriptor provides a status bit identifying the
packet which was timestamped (from all the packets that arrived during
an interrupt). Redoing the descriptors in the drivers is a bit of an
involved task, so I expect it to take my about two weeks until I have
the whole thing working; Additionally, perhaps one of the driver
maintainers should check my code as well when all is done to make sure
that it does not break any functionality.

The ioctl call for 82576 is called but gets mangled data in the data
pointer; I have to debug to see why the structure is not passed
correctly - I will debug the call stack; meanwhile I ignore the
received structure and set the parameters to default values when the
function is called.

I still have to implement two socket ioctl's that allow for
obtaining the last timestamp for a given socket (these are additional
to the cmsg structures).

For SO_TIMESTAMPING, I have to modify the format of the option from
a single bit (as it is now) to an int with flags.

There is a small inconsistency between the NetBSD socket options and
the Linux socket options. In Linux SO_TIMESTAMP (the option constant)
and the SCM_TIMESTAMP (the cmsg type) are identical, while in the
NetBSD they are not. The timestamping.c code used SO_TIMESTAMP where
it should use SCM_TIMESTAMPING. I have changed this to the correct
version in timestamping_rx.c. In any case, this is a problem that we
should be aware of.

I have not implemented yet the return with cmsg messages for
timestamps of transmitted packets - this was the mechanism with the
error queue that was discussed over the message list.

For Saitoh and other that want to look at the device driver code, I
have just uploaded that code as well.

Regards,
Vlad
Post by SAITOH Masanobu
 Hello, Vlad.
Post by Vlad Balan
http://netbsd-soc.cvs.sourceforge.net/viewvc/netbsd-soc/kerntimestamp/
The only files that one needs to graft into the kernel source to test the new descriptors are in sys/dev/pci/if_wm*. If you disable the WM_TIMESTAMPING flag, the timestamping dependencies are removed and you can test just the new descriptor code. So far I only have the header definitions for the descriptors, but I will let you know when I have running code.
Regards,
Vlad
Thank you, but I can't see sys/dev/pci/if_wm.c...
It seems the directory is empty...
--
-----------------------------------------------
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...