netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eyal Birger <eyal.birger@gmail.com>
To: davem@davemloft.net
Cc: edumazet@google.com, netdev@vger.kernel.org,
	Eyal Birger <eyal.birger@gmail.com>
Subject: [PATCH net-next 2/3] net: use skb->priority for overloading skb->dropcount and skb->reserved_tailroom instead of skb->mark
Date: Mon,  9 Feb 2015 20:15:22 +0200	[thread overview]
Message-ID: <1423505723-2281-3-git-send-email-eyal.birger@gmail.com> (raw)
In-Reply-To: <1423505723-2281-1-git-send-email-eyal.birger@gmail.com>

Commit 977750076d98 ("af_packet: add interframe drop cmsg (v6)") unionized
skb->mark and skb->dropcount in order to allow recording of the socket drop
count while maintaining struct sk_buff size.

In order to allow for the skb->mark to be fetched by user-space code it needs
to be detached from this union; skb->priority is used instead.

Signed-off-by: Eyal Birger <eyal.birger@gmail.com>
----
The purpose of overloading skb->priority is solely for retaining struct sk_buff
size; skb->priority is not used after the skb queued to the socket and has the
same guarentee of not being shared as skb->mark.
---
 include/linux/skbuff.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 1bb36ed..23f1a94 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -621,7 +621,7 @@ struct sk_buff {
 			__u16	csum_offset;
 		};
 	};
-	__u32			priority;
+	__u32			mark;
 	int			skb_iif;
 	__u32			hash;
 	__be16			vlan_proto;
@@ -636,7 +636,7 @@ struct sk_buff {
 	__u32			secmark;
 #endif
 	union {
-		__u32		mark;
+		__u32		priority;
 		__u32		dropcount;
 		__u32		reserved_tailroom;
 	};
-- 
2.1.4

  parent reply	other threads:[~2015-02-09 18:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-09 18:15 [PATCH net-next 0/3] net: Introducing socket mark receive socket option Eyal Birger
2015-02-09 18:15 ` [PATCH net-next 1/3] net: Rename sock_recv_ts_and_drops() to sock_cmsg_recv() Eyal Birger
2015-02-10  2:55   ` David Miller
2015-02-10 12:57     ` Eyal Birger
2015-02-09 18:15 ` Eyal Birger [this message]
2015-02-09 18:15 ` [PATCH net-next 3/3] net: Introducing socket mark receive socket option Eyal Birger

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=1423505723-2281-3-git-send-email-eyal.birger@gmail.com \
    --to=eyal.birger@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=netdev@vger.kernel.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).