Skip to contentSkip to conversation

igb: add per-packet timestamping

PATCH Applied Jeff Kirsher 2 participants 2 messages Mar 26, 2010 – Mar 31, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 igb: add per-packet timestamping

From: Nick Nunley <[email protected]>

This patch adds support for per-packet timestamping for the 82580 adapter. The rx timestamp code is also pulled out of the inlined rx hotpath and instead moved to a seperate function.

This version adds a comment explaining the per-packet timestamping code added to igb_hwtstamp_ioctl().

---

 drivers/net/igb/e1000_82575.h |    2 ++
 drivers/net/igb/igb.h         |    2 ++
 drivers/net/igb/igb_main.c    |   45 ++++++++++++++++++++++++++++++++++-------
 3 files changed, 41 insertions(+), 8 deletions(-)
drivers/net/igb/e1000_82575.h +2 -0
index c1cad8a..cbd1e12 100644
@@ -53,6 +53,7 @@ extern void igb_rx_fifo_flush_82575(struct e1000_hw *hw);
 #define E1000_SRRCTL_DESCTYPE_ADV_ONEBUF                0x02000000
 #define E1000_SRRCTL_DESCTYPE_HDR_SPLIT_ALWAYS          0x0A000000
 #define E1000_SRRCTL_DROP_EN                            0x80000000
+#define E1000_SRRCTL_TIMESTAMP                          0x40000000
 
 #define E1000_MRQC_ENABLE_RSS_4Q            0x00000002
 #define E1000_MRQC_ENABLE_VMDQ              0x00000003
@@ -109,6 +110,7 @@ union e1000_adv_rx_desc {
 #define E1000_RXDADV_HDRBUFLEN_MASK      0x7FE0
 #define E1000_RXDADV_HDRBUFLEN_SHIFT     5
 #define E1000_RXDADV_STAT_TS             0x10000 /* Pkt was time stamped */
+#define E1000_RXDADV_STAT_TSIP           0x08000 /* timestamp in packet */
 
 /* Transmit Descriptor - Advanced */
 union e1000_adv_tx_desc {
drivers/net/igb/igb.h +2 -0
index a177570..4f69b6d 100644
@@ -107,6 +107,7 @@ struct vf_data_storage {
 #define MAXIMUM_ETHERNET_VLAN_SIZE 1522
 
 /* Supported Rx Buffer Sizes */
+#define IGB_RXBUFFER_64    64     /* Used for packet split */
 #define IGB_RXBUFFER_128   128    /* Used for packet split */
 #define IGB_RXBUFFER_1024  1024
 #define IGB_RXBUFFER_2048  2048
@@ -324,6 +325,7 @@ struct igb_adapter {
 
 #define IGB_82576_TSYNC_SHIFT 19
 #define IGB_82580_TSYNC_SHIFT 24
+#define IGB_TS_HDR_LEN        16
 enum e1000_state_t {
 	__IGB_TESTING,
 	__IGB_RESETTING,
drivers/net/igb/igb_main.c +37 -8

88 lines not on this page · raw message

maintainer Applied
#1 lore raw

From: Jeff Kirsher <[email protected]>
Date: Fri, 26 Mar 2010 14:36:47 -0700

Quoted 11 lines

From: Nick Nunley <[email protected]>

This patch adds support for per-packet timestamping for the 82580 adapter. The rx timestamp code is also pulled out of the inlined rx hotpath and instead moved to a seperate function.

This version adds a comment explaining the per-packet timestamping code added to igb_hwtstamp_ioctl().

Applied.