From: David Ahern <dsahern@gmail.com>
To: Li RongQing <roy.qing.li@gmail.com>,
Stephen Hemminger <stephen@networkplumber.org>
Cc: Li RongQing <lirongqing@baidu.com>, netdev@vger.kernel.org
Subject: Re: [PATCH][net-next] ipv6: drop container_of when convert dst to rt6_info
Date: Sun, 30 Sep 2018 09:29:35 -0600 [thread overview]
Message-ID: <ddf3fb95-6068-cef0-f8c4-d39c7c202826@gmail.com> (raw)
In-Reply-To: <CAJFZqHxZc0obHNcM-hgsisxgmrN_qznKFojOGV5bCEiZn1Lu1A@mail.gmail.com>
On 9/30/18 3:38 AM, Li RongQing wrote:
>>
>> I don't understand why you are doing this? It is not going to be
>> faster (or safer) than container_of. container_of provides the
>> same functionality and is safe against position of the member
>> in the structure.
>>
>
> In fact, most places are converting dst to rt6_info directly, and only
> few place uses container_of
>
>
> net/ipv6/ip6_output.c: struct rt6_info *rt = (struct rt6_info *)skb_dst(skb);
> net/ipv6/route.c: const struct rt6_info *rt = (struct rt6_info *)dst;
>
I am trying to convert all places to container_of rather than a
typecast. Please do not undo that
prev parent reply other threads:[~2018-09-30 22:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-30 5:02 [PATCH][net-next] ipv6: drop container_of when convert dst to rt6_info Li RongQing
2018-09-30 9:27 ` Li RongQing
2018-09-30 9:32 ` Stephen Hemminger
2018-09-30 9:38 ` Li RongQing
2018-09-30 15:29 ` David Ahern [this message]
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=ddf3fb95-6068-cef0-f8c4-d39c7c202826@gmail.com \
--to=dsahern@gmail.com \
--cc=lirongqing@baidu.com \
--cc=netdev@vger.kernel.org \
--cc=roy.qing.li@gmail.com \
--cc=stephen@networkplumber.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