All of lore.kernel.org
 help / color / mirror / Atom feed
From: Justin Iurman <justin.iurman@uliege.be>
To: Jakub Kicinski <kuba@kernel.org>
Cc: netdev@vger.kernel.org, davem@davemloft.net, tom@herbertland.com
Subject: Re: [PATCH net-next v4 4/5] ipv6: ioam: Support for IOAM injection with lwtunnels
Date: Sun, 30 May 2021 12:48:11 +0200 (CEST)	[thread overview]
Message-ID: <829937119.34112748.1622371691514.JavaMail.zimbra@uliege.be> (raw)
In-Reply-To: <20210529140632.57b434b4@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>

> On Thu, 27 May 2021 17:16:51 +0200 Justin Iurman wrote:
>> Add support for the IOAM inline insertion (only for the host-to-host use case)
>> which is per-route configured with lightweight tunnels. The target is iproute2
>> and the patch is ready. It will be posted as soon as this patchset is merged.
>> Here is an overview:
>> 
>> $ ip -6 ro ad fc00::1/128 encap ioam6 trace type 0x800000 ns 1 size 12 dev eth0
>> 
>> This example configures an IOAM Pre-allocated Trace option attached to the
>> fc00::1/128 prefix. The IOAM namespace (ns) is 1, the size of the pre-allocated
>> trace data block is 12 octets (size) and only the first IOAM data (bit 0:
>> hop_limit + node id) is included in the trace (type) represented as a bitfield.
>> 
>> The reason why the in-transit (IPv6-in-IPv6 encapsulation) use case is not
>> implemented is explained on the patchset cover.
>> 
>> Signed-off-by: Justin Iurman <justin.iurman@uliege.be>
> 
>> +static const struct nla_policy ioam6_iptunnel_policy[IOAM6_IPTUNNEL_MAX + 1] =
>> {
>> +	[IOAM6_IPTUNNEL_TRACE]	= { .type = NLA_BINARY },
> 
> Please use NLA_POLICY_EXACT_LEN(sizeof(..)), that should avoid the need
> for explicit check in the code.

ACK.

>
>> +};
> 
>> +static int ioam6_build_state(struct net *net, struct nlattr *nla,
>> +			     unsigned int family, const void *cfg,
>> +			     struct lwtunnel_state **ts,
>> +			     struct netlink_ext_ack *extack)
>> +{
>> +	struct nlattr *tb[IOAM6_IPTUNNEL_MAX + 1];
>> +	struct ioam6_lwt_encap *tuninfo;
>> +	struct ioam6_trace_hdr *trace;
>> +	struct lwtunnel_state *s;
>> +	int len_aligned;
>> +	int len, err;
>> +
>> +	if (family != AF_INET6)
>> +		return -EINVAL;
>> +
>> +	err = nla_parse_nested(tb, IOAM6_IPTUNNEL_MAX, nla,
>> +			       ioam6_iptunnel_policy, extack);
>> +	if (err < 0)
>> +		return err;
>> +
>> +	if (!tb[IOAM6_IPTUNNEL_TRACE])
>> +		return -EINVAL;
>> +
>> +	trace = nla_data(tb[IOAM6_IPTUNNEL_TRACE]);
>> +	if (nla_len(tb[IOAM6_IPTUNNEL_TRACE]) != sizeof(*trace))
>> +		return -EINVAL;
>> +
>> +	if (!ioam6_validate_trace_hdr(trace))
>> +		return -EINVAL;
> 
> It'd be good to set the extack message and attribute here. And perhaps
> a message for the case of trace missing.

ACK.

  reply	other threads:[~2021-05-30 10:48 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-27 15:16 [PATCH net-next v4 0/5] Support for the IOAM Pre-allocated Trace with IPv6 Justin Iurman
2021-05-27 15:16 ` [PATCH net-next v4 1/5] uapi: IPv6 IOAM headers definition Justin Iurman
2021-05-27 15:16 ` [PATCH net-next v4 2/5] ipv6: ioam: Data plane support for Pre-allocated Trace Justin Iurman
2021-05-29 21:05   ` Jakub Kicinski
2021-05-30 10:36     ` Justin Iurman
2021-05-30 14:50       ` Justin Iurman
2021-05-30 20:05         ` Jakub Kicinski
2021-05-31 11:50           ` Justin Iurman
2021-06-01  4:20             ` Jakub Kicinski
2021-05-30 20:02       ` Jakub Kicinski
2021-05-31 11:43         ` Justin Iurman
2021-06-01  4:21           ` Jakub Kicinski
2021-05-27 15:16 ` [PATCH net-next v4 3/5] ipv6: ioam: IOAM Generic Netlink API Justin Iurman
2021-05-29 21:06   ` Jakub Kicinski
2021-05-30 11:18     ` Justin Iurman
2021-05-30 20:13       ` Jakub Kicinski
2021-05-27 15:16 ` [PATCH net-next v4 4/5] ipv6: ioam: Support for IOAM injection with lwtunnels Justin Iurman
2021-05-29 21:06   ` Jakub Kicinski
2021-05-30 10:48     ` Justin Iurman [this message]
2021-05-27 15:16 ` [PATCH net-next v4 5/5] ipv6: ioam: Documentation for new IOAM sysctls Justin Iurman
2021-05-29 15:58 ` [PATCH net-next v4 0/5] Support for the IOAM Pre-allocated Trace with IPv6 David Ahern
2021-05-29 16:24   ` Justin Iurman
2021-05-31  1:24     ` David Ahern
2021-05-31 12:04       ` Justin Iurman
2021-06-03  3:31         ` David Ahern
2021-05-29 21:10 ` Jakub Kicinski
2021-05-30 10:49   ` 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=829937119.34112748.1622371691514.JavaMail.zimbra@uliege.be \
    --to=justin.iurman@uliege.be \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --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.