Displaying 5 results from an estimated 5 matches for "dly_skb_cb".
2004 Mar 18
6
[PATCH] packet delay scheduler
...er adds a fixed delay to all packets.
+ Similar to NISTnet and BSD Dummynet.
+
+ It uses byte fifo underneath similar to TBF */
+struct dly_sched_data {
+ u32 latency;
+ u32 limit;
+ struct timer_list timer;
+ struct Qdisc *qdisc;
+};
+
+/* Time stamp put into socket buffer control block */
+struct dly_skb_cb {
+ psched_time_t queuetime;
+};
+
+/* Enqueue packets with underlying discipline (fifo)
+ * but mark them with current time first.
+ */
+static int dly_enqueue(struct sk_buff *skb, struct Qdisc *sch)
+{
+ struct dly_sched_data *q = (struct dly_sched_data *)sch->data;
+ struct dly_skb_cb *cb = (...
2004 Jun 17
1
[PATCH] (4/4) add loss option to network delay scheduler
...b/net/sched/sch_delay.c
--- a/net/sched/sch_delay.c 2004-06-17 15:26:51 -07:00
+++ b/net/sched/sch_delay.c 2004-06-17 15:26:51 -07:00
@@ -40,6 +40,7 @@
struct dly_sched_data {
u32 latency;
u32 limit;
+ u32 loss;
struct timer_list timer;
struct Qdisc *qdisc;
};
@@ -58,6 +59,12 @@
struct dly_skb_cb *cb = (struct dly_skb_cb *)skb->cb;
int ret;
+ /* Random packet drop 0 => none, ~0 => all */
+ if (q->loss >= net_random()) {
+ sch->stats.drops++;
+ return 0; /* lie about loss so TCP doesn''t know */
+ }
+
PSCHED_GET_TIME(cb->queuetime);
/* Queue to underl...
2004 Jun 17
1
[PATCH] (2/4) delay scheduler - retry if requeue fails
...04,10 @@
static struct sk_buff *dly_dequeue(struct Qdisc *sch)
{
struct dly_sched_data *q = (struct dly_sched_data *)sch->data;
- struct sk_buff *skb = q->qdisc->dequeue(q->qdisc);
+ struct sk_buff *skb;
+ retry:
+ skb = q->qdisc->dequeue(q->qdisc);
if (skb) {
struct dly_skb_cb *cb = (struct dly_skb_cb *)skb->cb;
psched_time_t now;
@@ -120,6 +122,12 @@
return skb;
}
+ if (q->qdisc->ops->requeue(skb, q->qdisc) != NET_XMIT_SUCCESS) {
+ sch->q.qlen--;
+ sch->stats.drops++;
+ goto retry;
+ }
+
if (!netif_queue_stopped(sch->dev))...
2004 Jun 17
2
[PATCH] (3/4) delay scheduler race with device stopped
...apply to both 2.6 and 2.4
Signed-off-by: Stephen Hemminger <shemminger@osdl.org>
diff -Nru a/net/sched/sch_delay.c b/net/sched/sch_delay.c
--- a/net/sched/sch_delay.c 2004-06-17 15:21:49 -07:00
+++ b/net/sched/sch_delay.c 2004-06-17 15:21:49 -07:00
@@ -111,7 +111,7 @@
if (skb) {
struct dly_skb_cb *cb = (struct dly_skb_cb *)skb->cb;
psched_time_t now;
- long diff;
+ long diff, delay;
PSCHED_GET_TIME(now);
diff = q->latency - PSCHED_TDIFF(now, cb->queuetime);
@@ -128,13 +128,10 @@
goto retry;
}
- if (!netif_queue_stopped(sch->dev)) {
- long delay = PSCHED_...
2004 Jul 01
20
[PATCH 2.6] update to network emulation QOS scheduler
...xed delay to all packets.
- Similar to NISTnet and BSD Dummynet.
-
- It uses byte fifo underneath similar to TBF */
-struct dly_sched_data {
- u32 latency;
- u32 limit;
- u32 loss;
- struct timer_list timer;
- struct Qdisc *qdisc;
-};
-
-/* Time stamp put into socket buffer control block */
-struct dly_skb_cb {
- psched_time_t queuetime;
-};
-
-/* Enqueue packets with underlying discipline (fifo)
- * but mark them with current time first.
- */
-static int dly_enqueue(struct sk_buff *skb, struct Qdisc *sch)
-{
- struct dly_sched_data *q = (struct dly_sched_data *)sch->data;
- struct dly_skb_cb *cb = (...