Commit 137d56d3 authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

debugging of timing loss when high load of background traffic

parent b85b5490
......@@ -4,9 +4,9 @@ wr-nic-objs := module.o device.o nic-core.o endpoint.o ethtool.o \
pps.o timestamp.o dmtd.o
# accept WRN_DEBUG from the environment. It turns pr_debug() into printk.
ifdef WRN_DEBUG
#ifdef WRN_DEBUG
ccflags-y += -DDEBUG
endif
#endif
ccflags-y += -I$(src)/../wr_pstats
......
......@@ -160,6 +160,18 @@ static void __wrn_tx_desc(struct wrn_ep *ep, int desc,
&tx->tx1);
}
inline char* decode_frame(uint8_t byte)
{
if (byte == 0x00)
return "SYNC";
if (byte == 0x08)
return "FOLLOW-UP";
if (byte == 0x0b)
return "ANNOUNCE";
if (byte == 0x09)
return "DELAY_RESP";
return "unknown";
}
static int wrn_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
......@@ -171,6 +183,7 @@ static int wrn_start_xmit(struct sk_buff *skb, struct net_device *dev)
int id;
int do_stamp = 0;
void *data; /* FIXME: move data and len to __wrn_tx_desc */
uint8_t *dbg_ptr;
unsigned len;
if (unlikely(skb->len > WRN_MTU)) {
......@@ -210,6 +223,11 @@ static int wrn_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* This both copies the data to the descriptr and fires tx */
__wrn_tx_desc(ep, desc, data, len, id, do_stamp);
if(do_stamp) {
dbg_ptr = (uint8_t*)data;
pr_debug("GD: tx %s id: %d, len: %d\n", decode_frame(dbg_ptr[14]),
id, len);
}
/* We are done, this is trivial maiintainance*/
ep->stats.tx_packets++;
......
......@@ -47,6 +47,7 @@ void wrn_tstamp_find_skb(struct wrn_dev *wrn, int desc)
ts.tv_sec = (s32)utc & 0x7fffffff;
ts.tv_nsec = wrn->ts_buf[i].ts * NSEC_PER_TICK;
pr_debug("GD: tx ts %d.%d\n", ts.tv_sec, ts.tv_nsec);
if (! (wrn->ts_buf[i].valid & TS_INVALID))
{
hwts = skb_hwtstamps(skb);
......@@ -90,6 +91,8 @@ static int record_tstamp(struct wrn_dev *wrn, u32 tsval, u32 idreg, u32 r2)
ts.tv_sec = (s32)utc & 0x7fffffff;
ts.tv_nsec = (tsval & 0xfffffff) * NSEC_PER_TICK;
pr_debug("GD: %s txts (id:%d, v:%d) %d.%d\n", __func__,
frame_id, !ts_incorrect, ts.tv_sec, ts.tv_nsec);
/* Provide the timestamp for the userland only if we're 100% sure about its correctness */
if (!ts_incorrect)
......@@ -111,7 +114,7 @@ static int record_tstamp(struct wrn_dev *wrn, u32 tsval, u32 idreg, u32 r2)
pr_debug("%s: ENOMEM\n", __func__);
return -ENOMEM;
}
pr_debug("%s: save to slot %i\n", __func__, i);
pr_debug("%s: GD save id: %d to slot %i\n", __func__, frame_id, i);
wrn->ts_buf[i].ts = tsval;
wrn->ts_buf[i].port_id = port_id;
wrn->ts_buf[i].frame_id = frame_id;
......
ppsi @ aafbc027
Subproject commit 466051b2048854036b83ca96be1e332f9098dac3
Subproject commit aafbc0276233d56c59590840e98f989add07a0fd
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment