Thread (13 messages) 13 messages, 6 authors, 2011-01-17

Re: [PATCH] net_sched: factorize qdisc stats handling

flat view

From: Stephen Hemminger <hidden>
Date: 2011-01-09 17:57:37

On Sat, 08 Jan 2011 10:26:29 +0100
Eric Dumazet [off-list ref] wrote:
quoted hunk ↗ jump to hunk
+static inline void bstats_update(struct gnet_stats_basic_packed *bstats,
+				 struct sk_buff *skb)
+{
+	bstats->bytes += qdisc_pkt_len(skb);
+	bstats->packets += skb_is_gso(skb) ? skb_shinfo(skb)->gso_segs : 1;
+}
+
+static inline void qdisc_bstats_update(struct Qdisc *sch, struct sk_buff *skb)
 {
-	sch->bstats.bytes += len;
-	sch->bstats.packets++;
+	bstats_update(&sch->bstats, skb);
 }
Minor nit. I prefer to show that skb is not modified.

static inline void bstats_update(struct gnet_stats_basic_packed *bstats,
				 const struct sk_buff *skb)

static inline void qdisc_bstats_update(struct Qdisc *sch, const struct sk_buff *skb)

-- 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help