From: Simon Horman <simon.horman@corigine.com>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: netdev@vger.kernel.org, kernel@mojatatu.com,
deb.chatterjee@intel.com, anjali.singhai@intel.com,
namrata.limaye@intel.com, khalidm@nvidia.com, tom@sipanda.io,
pratyush@sipanda.io, jiri@resnulli.us, xiyou.wangcong@gmail.com,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, vladbu@nvidia.com
Subject: Re: [PATCH net-next RFC 13/20] p4tc: add metadata create, update, delete, get, flush and dump
Date: Mon, 5 Jun 2023 12:22:03 +0200 [thread overview]
Message-ID: <ZH23SwFoyHuQ4AIx@corigine.com> (raw)
In-Reply-To: <20230124170510.316970-13-jhs@mojatatu.com>
On Tue, Jan 24, 2023 at 12:05:03PM -0500, Jamal Hadi Salim wrote:
...
Hi Victor, Jamal and Pedro,
some minor feedback from my side.
> +struct p4tc_metadata *tcf_meta_create(struct nlmsghdr *n, struct nlattr *nla,
> + u32 m_id, struct p4tc_pipeline *pipeline,
> + struct netlink_ext_ack *extack)
A gcc-12 build with W=1 suggests that this function could be static.
...
> +static int _tcf_meta_fill_nlmsg(struct sk_buff *skb,
> + const struct p4tc_metadata *meta)
> +{
> + unsigned char *b = nlmsg_get_pos(skb);
> + struct p4tc_meta_size_params sz_params;
> + struct nlattr *nest;
> +
> + if (nla_put_u32(skb, P4TC_PATH, meta->m_id))
> + goto out_nlmsg_trim;
> +
> + nest = nla_nest_start(skb, P4TC_PARAMS);
> + if (!nest)
> + goto out_nlmsg_trim;
> +
> + sz_params.datatype = meta->m_datatype;
> + sz_params.startbit = meta->m_startbit;
> + sz_params.endbit = meta->m_endbit;
There may be a hole at the end of sz_params, which is uninitialised,
yet fed into nl_put below.
> +
> + if (nla_put_string(skb, P4TC_META_NAME, meta->common.name))
> + goto out_nlmsg_trim;
> + if (nla_put(skb, P4TC_META_SIZE, sizeof(sz_params), &sz_params))
> + goto out_nlmsg_trim;
> +
> + nla_nest_end(skb, nest);
> +
> + return skb->len;
> +
> +out_nlmsg_trim:
> + nlmsg_trim(skb, b);
> + return -1;
> +}
...
next prev parent reply other threads:[~2023-06-05 10:22 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-24 17:04 [PATCH net-next RFC 01/20] net/sched: act_api: change act_base into an IDR Jamal Hadi Salim
2023-01-24 17:04 ` [PATCH net-next RFC 02/20] net/sched: act_api: increase action kind string length Jamal Hadi Salim
2023-01-24 17:04 ` [PATCH net-next RFC 03/20] net/sched: act_api: increase TCA_ID_MAX Jamal Hadi Salim
2023-01-24 17:04 ` [PATCH net-next RFC 04/20] net/sched: act_api: add init_ops to struct tc_action_op Jamal Hadi Salim
2023-01-24 17:04 ` [PATCH net-next RFC 05/20] net/sched: act_api: introduce tc_lookup_action_byid() Jamal Hadi Salim
2023-01-24 17:04 ` [PATCH net-next RFC 06/20] net/sched: act_api: export generic tc action searcher Jamal Hadi Salim
2023-01-24 17:04 ` [PATCH net-next RFC 07/20] net/sched: act_api: create and export __tcf_register_action Jamal Hadi Salim
2023-01-24 17:04 ` [PATCH net-next RFC 08/20] net/sched: act_api: add struct p4tc_action_ops as a parameter to lookup callback Jamal Hadi Salim
2023-01-24 17:04 ` [PATCH net-next RFC 09/20] net: introduce rcu_replace_pointer_rtnl Jamal Hadi Salim
2023-01-24 17:05 ` [PATCH net-next RFC 10/20] net/kparser: add kParser Jamal Hadi Salim
2023-01-24 17:05 ` [PATCH net-next RFC 11/20] p4tc: add P4 data types Jamal Hadi Salim
2023-01-24 17:05 ` [PATCH net-next RFC 12/20] p4tc: add pipeline create, get, update, delete Jamal Hadi Salim
2023-01-24 17:05 ` [PATCH net-next RFC 13/20] p4tc: add metadata create, update, delete, get, flush and dump Jamal Hadi Salim
2023-06-05 10:22 ` Simon Horman [this message]
2023-06-05 14:45 ` Jamal Hadi Salim
2023-01-24 17:05 ` [PATCH net-next RFC 14/20] p4tc: add header field create, get, delete, " Jamal Hadi Salim
2023-01-25 21:39 ` Vlad Buslov
2023-01-26 14:54 ` Jamal Hadi Salim
2023-01-24 17:05 ` [PATCH net-next RFC 15/20] p4tc: add action template create, update, delete, get, " Jamal Hadi Salim
2023-01-25 21:10 ` Vlad Buslov
2023-01-26 15:28 ` Jamal Hadi Salim
2023-01-24 17:05 ` [PATCH net-next RFC 16/20] p4tc: add table " Jamal Hadi Salim
2023-01-24 17:05 ` [PATCH net-next RFC 17/20] p4tc: add table entry create, update, get, delete, " Jamal Hadi Salim
2023-01-25 21:20 ` Vlad Buslov
2023-01-26 15:45 ` Jamal Hadi Salim
2023-01-24 17:05 ` [PATCH net-next RFC 18/20] p4tc: add register create, update, delete, get, " Jamal Hadi Salim
2023-01-25 21:44 ` Vlad Buslov
2023-01-26 15:49 ` Jamal Hadi Salim
2023-01-24 17:05 ` [PATCH net-next RFC 19/20] p4tc: add dynamic action commands Jamal Hadi Salim
2023-01-25 21:29 ` Vlad Buslov
2023-01-26 12:52 ` Jamal Hadi Salim
2023-01-26 17:04 ` Vlad Buslov
2023-01-26 19:01 ` Jamal Hadi Salim
2023-01-24 17:05 ` [PATCH net-next RFC 20/20] p4tc: add P4 classifier Jamal Hadi Salim
2023-01-25 16:48 ` [PATCH net-next RFC 01/20] net/sched: act_api: change act_base into an IDR Vlad Buslov
2023-01-26 12:37 ` Jamal Hadi Salim
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=ZH23SwFoyHuQ4AIx@corigine.com \
--to=simon.horman@corigine.com \
--cc=anjali.singhai@intel.com \
--cc=davem@davemloft.net \
--cc=deb.chatterjee@intel.com \
--cc=edumazet@google.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kernel@mojatatu.com \
--cc=khalidm@nvidia.com \
--cc=kuba@kernel.org \
--cc=namrata.limaye@intel.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pratyush@sipanda.io \
--cc=tom@sipanda.io \
--cc=vladbu@nvidia.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).