From: Justin Iurman <justin.iurman@uliege.be>
To: Paolo Abeni <pabeni@redhat.com>, netdev@vger.kernel.org
Cc: davem@davemloft.net, dsahern@kernel.org, edumazet@google.com,
kuba@kernel.org, horms@kernel.org, linux-kernel@vger.kernel.org,
David Lebrun <dlebrun@google.com>
Subject: Re: [PATCH net-next v4 3/4] net: ipv6: seg6_iptunnel: mitigate 2-realloc issue
Date: Tue, 19 Nov 2024 14:07:11 +0100 [thread overview]
Message-ID: <5dfc336e-d7e0-4219-af1e-6284facbdd94@uliege.be> (raw)
In-Reply-To: <1bc6fbd9-aa04-4bed-b435-262edd8f2d37@redhat.com>
On 11/19/24 11:47, Paolo Abeni wrote:
> On 11/18/24 14:15, Justin Iurman wrote:
> [...]
>> /* encapsulate an IPv6 packet within an outer IPv6 header with reduced SRH */
>> static int seg6_do_srh_encap_red(struct sk_buff *skb,
>> - struct ipv6_sr_hdr *osrh, int proto)
>> + struct ipv6_sr_hdr *osrh, int proto,
>> + struct dst_entry *dst)
>> {
>> __u8 first_seg = osrh->first_segment;
>> - struct dst_entry *dst = skb_dst(skb);
>> - struct net *net = dev_net(dst->dev);
>> + struct net *net = dev_net(skb_dst(skb)->dev);
>> struct ipv6hdr *hdr, *inner_hdr;
>> int hdrlen = ipv6_optlen(osrh);
>> int red_tlv_offset, tlv_offset;
>
>
> Minor nit: please respect the reverse x-mas tree order above.
Oopsie, forgot to move the old one on top. Will do, thanks!
> Also the code would probably be more readable with:
>
> struct dst_entry *old_dst = skb_dst(skb);
>
> and using 'old_dst' instead of 'skb_dst(skb)'
Ack. How about "dst" instead of "old_dst" (since it's the current
dst_entry), and "cache_dst" instead of "dst"?
> Cheers,
>
> Paolo
>
next prev parent reply other threads:[~2024-11-19 13:07 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-18 13:14 [PATCH net-next v4 0/4] Mitigate the two-reallocations issue for iptunnels Justin Iurman
2024-11-18 13:14 ` [PATCH net-next v4 1/4] include: net: add static inline dst_dev_overhead() to dst.h Justin Iurman
2024-11-18 13:15 ` [PATCH net-next v4 2/4] net: ipv6: ioam6_iptunnel: mitigate 2-realloc issue Justin Iurman
2024-11-19 10:42 ` Paolo Abeni
2024-11-19 12:59 ` Justin Iurman
2024-11-18 13:15 ` [PATCH net-next v4 3/4] net: ipv6: seg6_iptunnel: " Justin Iurman
2024-11-19 10:47 ` Paolo Abeni
2024-11-19 13:07 ` Justin Iurman [this message]
2024-11-19 13:26 ` Paolo Abeni
2024-11-18 13:15 ` [PATCH net-next v4 4/4] net: ipv6: rpl_iptunnel: " Justin Iurman
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=5dfc336e-d7e0-4219-af1e-6284facbdd94@uliege.be \
--to=justin.iurman@uliege.be \
--cc=davem@davemloft.net \
--cc=dlebrun@google.com \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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
all inboxes | Powered by JetHome®