[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b6a2a8c9331d12dc6f7148be210acfea17f16479.camel@microchip.com>
Date: Mon, 31 Oct 2022 11:40:42 +0100
From: Steen Hegelund <steen.hegelund@...rochip.com>
To: Daniel Machon <daniel.machon@...rochip.com>,
<netdev@...r.kernel.org>
CC: <UNGLinuxDriver@...rochip.com>
Subject: Re: [PATCH net-next v5 2/6] net: dcb: add new apptrust attribute
Hi Daniel,
On Fri, 2022-10-28 at 15:13 +0200, Daniel Machon wrote:
> Add new apptrust extension attributes to the 8021Qaz APP managed object.
>
> Two new attributes, DCB_ATTR_DCB_APP_TRUST_TABLE and
> DCB_ATTR_DCB_APP_TRUST, has been added. Trusted selectors are passed in
> the nested attribute DCB_ATTR_DCB_APP_TRUST, in order of precedence.
>
> The new attributes are meant to allow drivers, whose hw supports the
> notion of trust, to be able to set whether a particular app selector is
> trusted - and in which order.
>
> Signed-off-by: Daniel Machon <daniel.machon@...rochip.com>
> ---
...snip...
> @ -1185,6 +1186,29 @@ static int dcbnl_ieee_fill(struct sk_buff *skb, struct net_device *netdev)
> spin_unlock_bh(&dcb_lock);
> nla_nest_end(skb, app);
>
> + if (ops->dcbnl_getapptrust) {
> + u8 selectors[IEEE_8021QAZ_APP_SEL_MAX + 1] = {0};
> + int nselectors, i;
> +
> + apptrust = nla_nest_start(skb, DCB_ATTR_DCB_APP_TRUST_TABLE);
> + if (!app)
apptrust?
> + return -EMSGSIZE;
> +
> + err = ops->dcbnl_getapptrust(netdev, selectors, &nselectors);
> + if (!err) {
> + for (i = 0; i < nselectors; i++) {
> + err = nla_put_u8(skb, DCB_ATTR_DCB_APP_TRUST,
> + selectors[i]);
> + if (err) {
> + nla_nest_cancel(skb, apptrust);
> + return err;
> + }
> + }
> + }
> +
> + nla_nest_end(skb, apptrust);
> + }
> +
>
...snip...
> err:
> err = nla_put_u8(skb, DCB_ATTR_IEEE, err);
> dcbnl_ieee_notify(netdev, RTM_SETDCB, DCB_CMD_IEEE_SET, seq, 0);
BR
Steen
Powered by blists - more mailing lists