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] [day] [month] [year] [list]
Message-Id: <20180227.143445.158717432104110215.davem@davemloft.net>
Date:   Tue, 27 Feb 2018 14:34:45 -0500 (EST)
From:   David Miller <davem@...emloft.net>
To:     maxime.chevallier@...tlin.com
Cc:     netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        antoine.tenart@...tlin.com, thomas.petazzoni@...e-electrons.com,
        gregory.clement@...e-electrons.com,
        miquel.raynal@...e-electrons.com, nadavh@...vell.com,
        stefanc@...vell.com, ymarkman@...vell.com, mw@...ihalf.com
Subject: Re: [PATCH net-next] net: mvpp2: Add hardware offloading for VLAN
 filtering

From: Maxime Chevallier <maxime.chevallier@...tlin.com>
Date: Tue, 27 Feb 2018 10:11:43 +0100

> +/* Find tcam entry with matched pair <vid,port> */
> +static int mvpp2_prs_vid_range_find(struct mvpp2 *priv, int pmap, u16 vid,
> +				    u16 mask)
> +{
> +	struct mvpp2_prs_entry pe;
> +	unsigned char byte[2], enable[2];
> +	u16 rvid, rmask;
> +	int tid;

Please use reverse christmas tree ordering for local variables
(longest to shortest line).

> +/* Write parser entry for VID filtering */
> +static int mvpp2_prs_vid_entry_add(struct mvpp2_port *port, u16 vid)
> +{
> +	struct mvpp2 *priv = port->priv;
> +	struct mvpp2_prs_entry pe;
> +	int tid;
> +	unsigned int mask = 0xfff, reg_val, shift;
> +	unsigned int vid_start = MVPP2_PE_VID_FILT_RANGE_START +
> +				 port->id * MVPP2_PRS_VLAN_FILT_MAX;

Likewise.

> +/* Remove VID filering entry for this port */
> +static void mvpp2_prs_vid_disable_filtering(struct mvpp2_port *port)
> +{
> +	struct mvpp2 *priv = port->priv;
> +	unsigned int tid = MVPP2_PRS_VID_PORT_DFLT(port->id);

Likewise.

> +/* Add guard entry that drops packets when no VID is matched on this port */
> +static void mvpp2_prs_vid_enable_filtering(struct mvpp2_port *port)
> +{
> +	struct mvpp2_prs_entry pe;
> +	struct mvpp2 *priv = port->priv;
> +	unsigned int tid = MVPP2_PRS_VID_PORT_DFLT(port->id);
> +	unsigned int reg_val, shift;

Likewise.

> +static int mvpp2_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
> +{
> +	int ret;
> +	struct mvpp2_port *port = netdev_priv(dev);

Likewise.

> +static int mvpp2_set_features(struct net_device *dev,
> +			      netdev_features_t features)
> +{
> +	struct mvpp2_port *port = netdev_priv(dev);
> +	netdev_features_t changed = dev->features ^ features;

Likewise.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ