From: Stephen Hemminger <stephen@networkplumber.org>
To: Xin Long <lucien.xin@gmail.com>
Cc: network dev <netdev@vger.kernel.org>,
Simon Horman <simon.horman@netronome.com>,
Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Subject: Re: [PATCH iproute2-next 2/7] iproute_lwtunnel: add options support for vxlan metadata
Date: Wed, 5 Feb 2020 04:22:39 -0800 [thread overview]
Message-ID: <20200205042239.322cc844@shemminger-XPS-13-9360> (raw)
In-Reply-To: <85a6a30aac8eeab7c408fdadfa5419dc1596cf5d.1580708369.git.lucien.xin@gmail.com>
On Mon, 3 Feb 2020 13:39:53 +0800
Xin Long <lucien.xin@gmail.com> wrote:
> +static void lwtunnel_print_vxlan_opts(struct rtattr *attr, char *opt)
> +{
> + struct rtattr *tb[LWTUNNEL_IP_OPT_VXLAN_MAX + 1];
> + __u32 gbp;
> +
> + parse_rtattr(tb, LWTUNNEL_IP_OPT_VXLAN_MAX, RTA_DATA(attr),
> + RTA_PAYLOAD(attr));
> + gbp = rta_getattr_u32(tb[LWTUNNEL_IP_OPT_VXLAN_GBP]);
> + sprintf(opt, "%x", gbp);
> + print_string(PRINT_FP, "enc_opt", "\n vxlan_opts %s ", opt);
You need to handle single line mode and JSON.
Proper way is something like:
print_nl();
print_0xhex(PRINT_ANY, "enc_opt", " vxlan_opts %#x", gpb);
Also, why the hex format, this is a an opaque user interface?
next prev parent reply other threads:[~2020-02-05 12:22 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-03 5:39 [PATCH iproute2-next 0/7] iproute2: fully support for geneve/vxlan/erspan options Xin Long
2020-02-03 5:39 ` [PATCH iproute2-next 1/7] iproute_lwtunnel: add options support for geneve metadata Xin Long
2020-02-03 5:39 ` [PATCH iproute2-next 2/7] iproute_lwtunnel: add options support for vxlan metadata Xin Long
2020-02-03 5:39 ` [PATCH iproute2-next 3/7] iproute_lwtunnel: add options support for erspan metadata Xin Long
2020-02-03 5:39 ` [PATCH iproute2-next 4/7] tc: m_tunnel_key: add options support for vxlan Xin Long
2020-02-03 5:39 ` [PATCH iproute2-next 5/7] tc: m_tunnel_key: add options support for erpsan Xin Long
2020-02-03 5:39 ` [PATCH iproute2-next 6/7] tc: f_flower: add options support for vxlan Xin Long
2020-02-03 5:39 ` [PATCH iproute2-next 7/7] tc: f_flower: add options support for erspan Xin Long
2020-02-05 12:22 ` Stephen Hemminger [this message]
2020-02-10 6:09 ` [PATCH iproute2-next 2/7] iproute_lwtunnel: add options support for vxlan metadata Xin Long
2020-02-06 16:07 ` [PATCH iproute2-next 1/7] iproute_lwtunnel: add options support for geneve metadata David Ahern
2020-02-09 14:10 ` Xin Long
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=20200205042239.322cc844@shemminger-XPS-13-9360 \
--to=stephen@networkplumber.org \
--cc=lucien.xin@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pieter.jansenvanvuuren@netronome.com \
--cc=simon.horman@netronome.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;
as well as URLs for NNTP newsgroup(s).