Netdev List
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eyal.birger@gmail.com
Cc: netdev@vger.kernel.org, edumazet@google.com, shmulik.ladkani@gmail.com
Subject: Re: [PATCH net-next v2 2/3] net: use skb->priority for overloading skb->dropcount and skb->reserved_tailroom instead of skb->mark
Date: Thu, 19 Feb 2015 15:05:00 -0500 (EST)	[thread overview]
Message-ID: <20150219.150500.834870317013347277.davem@davemloft.net> (raw)
In-Reply-To: <1423715535-884-3-git-send-email-eyal.birger@gmail.com>

From: Eyal Birger <eyal.birger@gmail.com>
Date: Thu, 12 Feb 2015 06:32:14 +0200

> 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.

I don't think this analysis is accurate.

> @@ -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;
>  	};
> -- 

You are going to now write to dropcount in packet_rcv() and that will
corrupt skb->priority.  If we got to packet_rcv() via
dev_queue_xmit_nit() then that skb->priority value is actually going
to be used by the packet schedulers for classification, flow
scheduling, etc.

So I don't think this transformation is going to work properly.

I'm also wondering if aliasing with skb->mark, which is what happens
now, is legal too.

  reply	other threads:[~2015-02-19 20:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-12  4:32 [PATCH net-next v2 0/3] net: Introducing socket mark receive socket option Eyal Birger
2015-02-12  4:32 ` [PATCH net-next v2 1/3] net: Rename sock_recv_ts_and_drops() to sock_cmsg_recv() Eyal Birger
2015-02-12  4:32 ` [PATCH net-next v2 2/3] net: use skb->priority for overloading skb->dropcount and skb->reserved_tailroom instead of skb->mark Eyal Birger
2015-02-19 20:05   ` David Miller [this message]
2015-02-20 11:32     ` Eyal Birger
2015-02-22 20:47       ` David Miller
2015-02-12  4:32 ` [PATCH net-next v2 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=20150219.150500.834870317013347277.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eyal.birger@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=shmulik.ladkani@gmail.com \
    /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