diff --git a/net/pspat/functions.c b/net/pspat/functions.c index 7e344311f4abb6..6885f0e87e4efb 100644 --- a/net/pspat/functions.c +++ b/net/pspat/functions.c @@ -401,6 +401,10 @@ pspat_do_arbiter(struct pspat *arb) q->pspat_batch_limit = pspat_arb_qdisc_batch; } + if (unlikely(skb->next)) { + printk("WARNING: skb->next was not NULL\n"); + skb->next = skb->prev = NULL; + } rc = q->enqueue(skb, q, &to_free) & NET_XMIT_MASK; if (unlikely(pspat_debug_xmit)) { printk("enq(%p,%p)-->%d\n", q, skb, rc); @@ -671,6 +675,10 @@ pspat_do_dispatcher(struct pspat_dispatcher *s) printk("PSPAT sender processed %d skbs\n", ndeq); } + if (pspat_dispatch_sleep_us) { + usleep_range(pspat_dispatch_sleep_us, pspat_dispatch_sleep_us); + } + return ndeq; } diff --git a/net/pspat/pspat.h b/net/pspat/pspat.h index 169578036a7731..d26e6974983570 100644 --- a/net/pspat/pspat.h +++ b/net/pspat/pspat.h @@ -95,6 +95,7 @@ extern u64 pspat_arb_loop_max_ns; extern u64 pspat_arb_loop_avg_reqs; extern uint32_t pspat_arb_qdisc_batch; extern uint32_t pspat_dispatch_batch; +extern uint32_t pspat_dispatch_sleep_us; extern struct pspat_stats *pspat_stats; struct pspat_stats { diff --git a/net/pspat/pspat_main.c b/net/pspat/pspat_main.c index 80184d37b2c224..238c502b2a753f 100644 --- a/net/pspat/pspat_main.c +++ b/net/pspat/pspat_main.c @@ -30,6 +30,7 @@ u64 pspat_rate __read_mostly = 40000000000; // 40Gb/s u64 pspat_arb_interval_ns __read_mostly = 1000; u32 pspat_arb_qdisc_batch __read_mostly = 512; u32 pspat_dispatch_batch __read_mostly = 256; +u32 pspat_dispatch_sleep_us __read_mostly = 0; u64 pspat_arb_tc_enq_drop = 0; u64 pspat_arb_backpressure_drop = 0; u64 pspat_arb_tc_deq = 0; @@ -166,6 +167,13 @@ static struct ctl_table pspat_static_ctl[] = { .data = &pspat_dispatch_batch, .proc_handler = &proc_dointvec, }, + { + .procname = "dispatch_sleep_us", + .maxlen = sizeof(u32), + .mode = 0644, + .data = &pspat_dispatch_sleep_us, + .proc_handler = &proc_dointvec, + }, { .procname = "rate", .maxlen = sizeof(u64), diff --git a/net/pspat/start.sh b/net/pspat/start.sh index 89c1d56322e4dd..7204357f0c9b4a 100755 --- a/net/pspat/start.sh +++ b/net/pspat/start.sh @@ -9,6 +9,7 @@ sudo sysctl net.pspat.single_txq=0 sudo sysctl net.pspat.mailbox_entries=512 sudo sysctl net.pspat.mailbox_line_size=128 sudo sysctl net.pspat.arb_qdisc_batch=1000 +sudo sysctl net.pspat.dispatch_batch=1000 sudo sysctl net.pspat.enable=1 sudo taskset -pc 7 $(pgrep pspat-arb)