linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: maxime.chevallier@bootlin.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	antoine.tenart@bootlin.com, thomas.petazzoni@free-electrons.com,
	gregory.clement@free-electrons.com,
	miquel.raynal@free-electrons.com, nadavh@marvell.com,
	stefanc@marvell.com, ymarkman@marvell.com, mw@semihalf.com
Subject: Re: [PATCH net-next] net: mvpp2: Add hardware offloading for VLAN filtering
Date: Tue, 27 Feb 2018 14:34:45 -0500 (EST)	[thread overview]
Message-ID: <20180227.143445.158717432104110215.davem@davemloft.net> (raw)
In-Reply-To: <20180227091143.10696-1-maxime.chevallier@bootlin.com>

From: Maxime Chevallier <maxime.chevallier@bootlin.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.

      reply	other threads:[~2018-02-27 19:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27  9:11 [PATCH net-next] net: mvpp2: Add hardware offloading for VLAN filtering Maxime Chevallier
2018-02-27 19:34 ` David Miller [this message]

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=20180227.143445.158717432104110215.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=antoine.tenart@bootlin.com \
    --cc=gregory.clement@free-electrons.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxime.chevallier@bootlin.com \
    --cc=miquel.raynal@free-electrons.com \
    --cc=mw@semihalf.com \
    --cc=nadavh@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=stefanc@marvell.com \
    --cc=thomas.petazzoni@free-electrons.com \
    --cc=ymarkman@marvell.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).