lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1a66c3d22f0d6fccb7847a6ae6df011a43af0a9c.camel@microchip.com>
Date:   Fri, 20 Jan 2023 10:35:20 +0100
From:   Steen Hegelund <steen.hegelund@...rochip.com>
To:     Dan Carpenter <error27@...il.com>
CC:     "David S . Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        <UNGLinuxDriver@...rochip.com>,
        Randy Dunlap <rdunlap@...radead.org>,
        Casper Andersson <casper.casan@...il.com>,
        "Russell King" <rmk+kernel@...linux.org.uk>,
        Wan Jiabing <wanjiabing@...o.com>,
        "Nathan Huckleberry" <nhuck@...gle.com>,
        <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        "Daniel Machon" <daniel.machon@...rochip.com>,
        Horatiu Vultur <horatiu.vultur@...rochip.com>,
        Lars Povlsen <lars.povlsen@...rochip.com>,
        Michael Walle <michael@...le.cc>
Subject: Re: [PATCH net-next 3/8] net: microchip: sparx5: Add actionset type
 id information to rule

Hi Dan,

Thanks for the review.

On Fri, 2023-01-20 at 12:11 +0300, Dan Carpenter wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> content is safe
> 
> On Fri, Jan 20, 2023 at 10:08:26AM +0100, Steen Hegelund wrote:
> > +/* Add the actionset typefield to the list of rule actionfields */
> > +static int vcap_add_type_actionfield(struct vcap_rule *rule)
> > +{
> > +     enum vcap_actionfield_set actionset = rule->actionset;
> > +     struct vcap_rule_internal *ri = to_intrule(rule);
> > +     enum vcap_type vt = ri->admin->vtype;
> > +     const struct vcap_field *fields;
> > +     const struct vcap_set *aset;
> > +     int ret = -EINVAL;
> > +
> > +     aset = vcap_actionfieldset(ri->vctrl, vt, actionset);
> > +     if (!aset)
> > +             return ret;
> > +     if (aset->type_id == (u8)-1)  /* No type field is needed */
> > +             return 0;
> > +
> > +     fields = vcap_actionfields(ri->vctrl, vt, actionset);
> > +     if (!fields)
> > +             return -EINVAL;
> > +     if (fields[VCAP_AF_TYPE].width > 1) {
> > +             ret = vcap_rule_add_action_u32(rule, VCAP_AF_TYPE,
> > +                                            aset->type_id);
> > +     } else {
> > +             if (aset->type_id)
> > +                     ret = vcap_rule_add_action_bit(rule, VCAP_AF_TYPE,
> > +                                                    VCAP_BIT_1);
> > +             else
> > +                     ret = vcap_rule_add_action_bit(rule, VCAP_AF_TYPE,
> > +                                                    VCAP_BIT_0);
> > +     }
> > +     return 0;
> 
> return ret; ?

yes that correct... I will update that.

> 
> > +}
> 
> regards,
> dan carpenter
> 

BR
Steen

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ