Skip to contentSkip to conversation

: pkt_sched: Add qdisc_tx_is_noop() helper and use in IPV6.

PATCH In review David Miller 2 participants 2 messages Jul 3, 2008 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

David Miller

author maintainer
#0 lore raw

PATCH 14/39 : pkt_sched: Add qdisc_tx_is_noop() helper and use in IPV6.

This indicates if the NOOP scheduler is what is active for TX on a given device.

---
 include/net/sch_generic.h |    8 ++++++++
 net/ipv6/addrconf.c       |    5 ++---
 2 files changed, 10 insertions(+), 3 deletions(-)
include/net/sch_generic.h +8 -0
index 9f5e644..bfb05a7 100644
@@ -212,6 +212,14 @@ static inline bool qdisc_tx_changing(struct net_device *dev)
 	return (txq->qdisc != txq->qdisc_sleeping);
 }
 
+/* Is the device using the noop qdisc?  */
+static inline bool qdisc_tx_is_noop(struct net_device *dev)
+{
+	struct netdev_queue *txq = &dev->tx_queue;
+
+	return (txq->qdisc == &noop_qdisc);
+}
+
 static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
 				       struct sk_buff_head *list)
 {
net/ipv6/addrconf.c +2 -3
index e6acb89..6dd8c63 100644
@@ -224,10 +224,9 @@ const struct in6_addr in6addr_linklocal_allnodes = IN6ADDR_LINKLOCAL_ALLNODES_IN
 const struct in6_addr in6addr_linklocal_allrouters = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT;
 
 /* Check if a valid qdisc is available */
-static inline int addrconf_qdisc_ok(struct net_device *dev)
+static inline bool addrconf_qdisc_ok(struct net_device *dev)
 {
-	struct netdev_queue *txq = &dev->tx_queue;
-	return (txq->qdisc != &noop_qdisc);
+	return !qdisc_tx_is_noop(dev);
 }
 
 /* Check if a route is valid prefix route */
Signature · 1 line
1.5.6

A message that is not in the archive (sent off-list or not yet received): 20080703.000349.266937189.davem-fT/PcQaiUtIeIZ0/[email protected]

#2 lore raw
Quoted 15 lines · On Thu, 03 Jul 2008 00:03:49 -0700 (PDT) David Miller…

This indicates if the NOOP scheduler is what is active for TX on a given device.

---
 include/net/sch_generic.h |    8 ++++++++
 net/ipv6/addrconf.c       |    5 ++---
 2 files changed, 10 insertions(+), 3 deletions(-)
include/net/sch_generic.h +0 -0
index 9f5e644..bfb05a7 100644

include/net/sch_generic.h static inline bool qdisc_tx_changing(struct net_device *dev) · line 221

Quoted 10 lines
include/net/sch_generic.h +7 -0
@@ -212,6 +212,14 @@ static inline bool qdisc_tx_changing(struct net_device *dev)
 	return (txq->qdisc != txq->qdisc_sleeping);
 }
 
+/* Is the device using the noop qdisc?  */
+static inline bool qdisc_tx_is_noop(struct net_device *dev)
+{
+	struct netdev_queue *txq = &dev->tx_queue;
+
+	return (txq->qdisc == &noop_qdisc);
+}

static inline bool qdisc_tx_is_noop(const struct net_device *dev)?

Quoted 8 lines
include/net/sch_generic.h +0 -0
 static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
 				       struct sk_buff_head *list)
 {
net/ipv6/addrconf.c +0 -0
index e6acb89..6dd8c63 100644

net/ipv6/addrconf.c const struct in6_addr in6addr_linklocal_allnodes = IN6ADDR_LINKLOCAL_ALLNODES_IN · line 230

Quoted 10 lines
net/ipv6/addrconf.c +2 -3
@@ -224,10 +224,9 @@ const struct in6_addr in6addr_linklocal_allnodes = IN6ADDR_LINKLOCAL_ALLNODES_IN
 const struct in6_addr in6addr_linklocal_allrouters = IN6ADDR_LINKLOCAL_ALLROUTERS_INIT;
 
 /* Check if a valid qdisc is available */
-static inline int addrconf_qdisc_ok(struct net_device *dev)
+static inline bool addrconf_qdisc_ok(struct net_device *dev)
 {
-	struct netdev_queue *txq = &dev->tx_queue;
-	return (txq->qdisc != &noop_qdisc);
+	return !qdisc_tx_is_noop(dev);
 }

Ditto const
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html