All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Lebrun <david.lebrun@uclouvain.be>
To: Tom Herbert <tom@herbertland.com>
Cc: Linux Kernel Network Developers <netdev@vger.kernel.org>
Subject: Re: [PATCH 1/9] ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header)
Date: Tue, 18 Oct 2016 13:43:03 +0200	[thread overview]
Message-ID: <58060AC7.1010501@uclouvain.be> (raw)
In-Reply-To: <CALx6S35sU+aw3UvMTknj8SjJP4O=Q-9eVV3OC640Qzces_eE7w@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1877 bytes --]

On 10/17/2016 07:01 PM, Tom Herbert wrote:
>> +struct ipv6_sr_hdr {
>> +       __u8    nexthdr;
>> +       __u8    hdrlen;
>> +       __u8    type;
>> +       __u8    segments_left;
>> +       __u8    first_segment;
>> +       __be16  flags;
> 
> Bad alignment for 16 bit field could be unpleasant on some
> architectures. Might be better to split this into to u8's, defined
> flags are only in first eight bits anyway.
> 

Will do

>> +config IPV6_SEG6
>> +       bool "IPv6: Segment Routing support"
>> +       depends on IPV6
>> +       select CRYPTO_HMAC
>> +       select CRYPTO_SHA1
>> +       select CRYPTO_SHA256
>> +       ---help---
>> +         Experimental support for IPv6 Segment Routing dataplane as defined
> 
> I don't think calling this experimental is relevant.

OK

>> +       if (skb->ip_summed == CHECKSUM_COMPLETE)
>> +               skb->ip_summed = CHECKSUM_NONE;
>> +
> Because the packet is being changed? Would it make sense to update the
> checksum complete value based on the changes being made. Consider the
> case that the next hop is local to the host (someone may try to
> implement network virtualization this way).
> 

Seems to make sense, I will try your suggestion

>>
>> +#ifdef CONFIG_IPV6_SEG6
>> +       /* segment routing */
>> +       if (hdr->type == IPV6_SRCRT_TYPE_4)
>> +               return ipv6_srh_rcv(skb);
>> +#endif
> 
> This doesn't belong in one of the switch statements in ipv6_rthdr_rcv?
> 

From what I see, ipv6_rthdr_rcv was initially implemented to support
RH0, and then specific code was added at multiple points to handle MIP6.
The first switch already handles a specific case (i.e. segments_left ==
0), so the call to ipv6_srh_rcv() must happen before that. I choose not
to inline ipv6_srh_rcv into ipv6_rthdr_rcv as it would make the code
quite messy.


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2016-10-18 11:41 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17 14:42 [PATCH 0/9] net: add support for IPv6 Segment Routing David Lebrun
2016-10-17 14:42 ` [PATCH 1/9] ipv6: implement dataplane support for rthdr type 4 (Segment Routing Header) David Lebrun
2016-10-17 14:57   ` David Miller
2016-10-17 15:04     ` David Lebrun
2016-10-17 17:01   ` Tom Herbert
2016-10-18 11:43     ` David Lebrun [this message]
2016-10-20 13:04     ` David Lebrun
2016-10-20 15:47       ` Tom Herbert
2016-10-17 17:31   ` Tom Herbert
2016-10-17 14:42 ` [PATCH 2/9] ipv6: sr: add code base for control plane support of SR-IPv6 David Lebrun
2016-10-17 15:00   ` David Miller
2016-10-17 15:06     ` David Lebrun
2016-10-17 15:21       ` David Miller
2016-10-17 17:07   ` Tom Herbert
2016-10-18 11:45     ` David Lebrun
2016-10-17 14:42 ` [PATCH 3/9] ipv6: sr: add support for SRH encapsulation and injection with lwtunnels David Lebrun
2016-10-17 17:17   ` Tom Herbert
2016-10-18 11:47     ` David Lebrun
2016-10-17 14:42 ` [PATCH 4/9] ipv6: sr: add core files for SR HMAC support David Lebrun
2016-10-17 17:24   ` Tom Herbert
2016-10-18 12:07     ` David Lebrun
2016-10-19 13:20   ` zhuyj
2016-10-19 14:43     ` David Laight
2016-10-17 14:43 ` [PATCH 5/9] ipv6: sr: implement API to control SR HMAC structures David Lebrun
2016-10-17 14:43 ` [PATCH 6/9] ipv6: sr: add calls to verify and insert HMAC signatures David Lebrun
2016-10-17 14:43 ` [PATCH 7/9] ipv6: add source address argument for ipv6_push_nfrag_opts David Lebrun
2016-10-17 14:43 ` [PATCH 8/9] ipv6: sr: add support for SRH injection through setsockopt David Lebrun
2016-10-17 14:43 ` [PATCH 9/9] ipv6: sr: add documentation file for per-interface sysctls David Lebrun
2016-10-17 15:09 ` [PATCH 0/9] net: add support for IPv6 Segment Routing David Laight

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=58060AC7.1010501@uclouvain.be \
    --to=david.lebrun@uclouvain.be \
    --cc=netdev@vger.kernel.org \
    --cc=tom@herbertland.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.