From: sandr8 <sandr8_NOSPAM_@crocetta.org>
To: hadi@cyberus.ca, kuznet@ms2.inr.ac.ru, davem@redhat.com,
devik@cdi.cz, shemminger@osdl.org, kaber@trash.net,
rusty@rustcorp.com.au, laforge@netfilter.org
Cc: netdev@oss.sgi.com, netfilter-devel@lists.netfilter.org
Subject: [PATCH 1/4] some cosmetics
Date: Fri, 13 Aug 2004 02:48:07 +0200 [thread overview]
Message-ID: <411C0FC7.3040100@crocetta.org> (raw)
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.
*/
reply other threads:[~2004-08-13 0:48 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=411C0FC7.3040100@crocetta.org \
--to=sandr8_nospam_@crocetta.org \
--cc=davem@redhat.com \
--cc=devik@cdi.cz \
--cc=hadi@cyberus.ca \
--cc=kaber@trash.net \
--cc=kuznet@ms2.inr.ac.ru \
--cc=laforge@netfilter.org \
--cc=netdev@oss.sgi.com \
--cc=netfilter-devel@lists.netfilter.org \
--cc=rusty@rustcorp.com.au \
--cc=shemminger@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).