* [PATCH 1/4] some cosmetics
@ 2004-08-13 0:48 sandr8
0 siblings, 0 replies; only message in thread
From: sandr8 @ 2004-08-13 0:48 UTC (permalink / raw)
To: hadi, kuznet, davem, devik, shemminger, kaber, rusty, laforge
Cc: netdev, netfilter-devel
1) the first patch is a tiny patch that changes the #define-s for the
NET_XMIT_* return values and provides quick inline functions that
determine if *a* packet was dropped ("a packet" does not necessarily
mean "the" packet that was enqueued!) this is not just cosmetic but it's
useful later on.
furthermore, in some places the code makes me think that there has been
a lack of update... in those places it was assumpted that the success or
insuccess was somewhat binary (either 0 or NET_XMIT_SUCCESS or !=
NET_XMIT_SUCCESS)...
Alessandro Salvatori
--
the _NOSPAM_ account is the one i am subscribed with, please remove
_NOSPAM_ for personal replies
diff -NaurX dontdiff linux-2.6.8-rc4/include/linux/netdevice.h
linux-2.6.8-rc4-netxmitcodes/include/linux/netdevice.h
--- linux-2.6.8-rc4/include/linux/netdevice.h 2004-08-10
12:27:33.000000000 +0200
+++ linux-2.6.8-rc4-netxmitcodes/include/linux/netdevice.h 2004-08-12
13:31:07.278643720 +0200
@@ -52,12 +52,14 @@
#define HAVE_NETDEV_PRIV /* netdev_priv() */
#define NET_XMIT_SUCCESS 0
-#define NET_XMIT_DROP 1 /* skb dropped */
-#define NET_XMIT_CN 2 /* congestion notification */
-#define NET_XMIT_POLICED 3 /* skb is shot by police */
-#define NET_XMIT_BYPASS 4 /* packet does not leave via dequeue;
+#define NET_XMIT_BYPASS 2 /* packet does not leave via dequeue;
(TC use only - dev_queue_xmit
returns this as NET_XMIT_SUCCESS) */
+#define NET_XMIT_RESHAPED 4
+
+#define NET_XMIT_DROP 5 /* skb dropped */
+#define NET_XMIT_CN 7 /* congestion notification */
+#define NET_XMIT_POLICED 9 /* skb is shot by police */
/* Backlog congestion levels */
#define NET_RX_SUCCESS 0 /* keep 'em coming, baby */
diff -NaurX dontdiff linux-2.6.8-rc4/include/net/pkt_sched.h
linux-2.6.8-rc4-netxmitcodes/include/net/pkt_sched.h
--- linux-2.6.8-rc4/include/net/pkt_sched.h 2004-08-10
12:27:34.000000000 +0200
+++ linux-2.6.8-rc4-netxmitcodes/include/net/pkt_sched.h 2004-08-12
13:31:12.114908496 +0200
@@ -440,6 +440,16 @@
extern int qdisc_restart(struct net_device *dev);
+static inline unsigned any_dropped(unsigned code)
+{
+ return(0x1 & code);
+}
+
+static inline unsigned no_dropped(unsigned code)
+{
+ return(!(0x1 & code));
+}
+
/* Calculate maximal size of packet seen by hard_start_xmit
routine of this device.
*/
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-08-13 0:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-08-13 0:48 [PATCH 1/4] some cosmetics sandr8
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).