From: Simon Horman <simon.horman@netronome.com>
To: Jiri Pirko <jiri@mellanox.com>,
Jamal Hadi Salim <jhs@mojatatu.com>,
Cong Wang <xiyou.wangcong@gmail.com>
Cc: netdev@vger.kernel.org, oss-drivers@netronome.com,
Simon Horman <simon.horman@netronome.com>,
Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Subject: [PATCH/RFC 2/3] net/sched: act_tunnel_key: add extended ack support
Date: Tue, 6 Mar 2018 18:08:04 +0100 [thread overview]
Message-ID: <20180306170805.19500-3-simon.horman@netronome.com> (raw)
In-Reply-To: <20180306170805.19500-1-simon.horman@netronome.com>
Add extended ack support for the tunnel key action by using NL_SET_ERR_MSG
during validation of user input.
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Pieter Jansen van Vuuren <pieter.jansenvanvuuren@netronome.com>
Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
net/sched/act_tunnel_key.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/sched/act_tunnel_key.c b/net/sched/act_tunnel_key.c
index 7ce95538177b..c0bbdec50022 100644
--- a/net/sched/act_tunnel_key.c
+++ b/net/sched/act_tunnel_key.c
@@ -90,12 +90,14 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,
return -EINVAL;
err = nla_parse_nested(tb, TCA_TUNNEL_KEY_MAX, nla, tunnel_key_policy,
- NULL);
+ extack);
if (err < 0)
return err;
- if (!tb[TCA_TUNNEL_KEY_PARMS])
+ if (!tb[TCA_TUNNEL_KEY_PARMS]) {
+ NL_SET_ERR_MSG(extack, "Missing tunnel key parameter");
return -EINVAL;
+ }
parm = nla_data(tb[TCA_TUNNEL_KEY_PARMS]);
exists = tcf_idr_check(tn, parm->index, a, bind);
@@ -107,6 +109,7 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,
break;
case TCA_TUNNEL_KEY_ACT_SET:
if (!tb[TCA_TUNNEL_KEY_ENC_KEY_ID]) {
+ NL_SET_ERR_MSG(extack, "Missing tunnel key enc id");
ret = -EINVAL;
goto err_out;
}
@@ -144,6 +147,7 @@ static int tunnel_key_init(struct net *net, struct nlattr *nla,
0, flags,
key_id, 0);
} else {
+ NL_SET_ERR_MSG(extack, "Missing both ipv4 and ipv6 enc src and dst");
ret = -EINVAL;
goto err_out;
}
--
2.11.0
next prev parent reply other threads:[~2018-03-06 17:08 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-06 17:08 [PATCH/RFC net-next 0/3] introduce Geneve options support in TC tunnel key Simon Horman
2018-03-06 17:08 ` [PATCH/RFC 1/3] net/sched: act_tunnel_key: disambiguate metadata dst error cases Simon Horman
2018-03-06 17:08 ` Simon Horman [this message]
2018-03-09 11:22 ` [PATCH/RFC 2/3] net/sched: act_tunnel_key: add extended ack support Jiri Benc
2018-03-22 11:49 ` Simon Horman
2018-03-06 17:08 ` [PATCH/RFC 3/3] net/sched: add tunnel option support to act_tunnel_key Simon Horman
2018-03-09 11:53 ` Jiri Benc
2018-03-22 11:53 ` Simon Horman
2018-03-06 17:11 ` [PATCH/RFC net-next 0/3] introduce Geneve options support in TC tunnel key Or Gerlitz
2018-03-06 17:16 ` Simon Horman
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=20180306170805.19500-3-simon.horman@netronome.com \
--to=simon.horman@netronome.com \
--cc=jhs@mojatatu.com \
--cc=jiri@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=oss-drivers@netronome.com \
--cc=pieter.jansenvanvuuren@netronome.com \
--cc=xiyou.wangcong@gmail.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).