netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: jakub.kicinski@netronome.com, davem@davemloft.net,
	alexandre.belloni@bootlin.com, f.fainelli@gmail.com,
	vivien.didelot@gmail.com, joergen.andreasen@microchip.com,
	allan.nielsen@microchip.com, horatiu.vultur@microchip.com,
	claudiu.manoil@nxp.com, netdev@vger.kernel.org,
	Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [PATCH net-next 14/15] net: mscc: ocelot: split assignment of the cpu port into a separate function
Date: Sun, 10 Nov 2019 17:32:29 +0100	[thread overview]
Message-ID: <20191110163229.GE25889@lunn.ch> (raw)
In-Reply-To: <20191109130301.13716-15-olteanv@gmail.com>

> +void ocelot_set_cpu_port(struct ocelot *ocelot, int cpu,
> +			 enum ocelot_tag_prefix injection,
> +			 enum ocelot_tag_prefix extraction)
> +{
> +	/* Configure and enable the CPU port. */
> +	ocelot_write_rix(ocelot, 0, ANA_PGID_PGID, cpu);
> +	ocelot_write_rix(ocelot, BIT(cpu), ANA_PGID_PGID, PGID_CPU);
> +	ocelot_write_gix(ocelot, ANA_PORT_PORT_CFG_RECV_ENA |
> +			 ANA_PORT_PORT_CFG_PORTID_VAL(cpu),
> +			 ANA_PORT_PORT_CFG, cpu);
> +
> +	/* If the CPU port is a physical port, set up the port in Node
> +	 * Processor Interface (NPI) mode. This is the mode through which
> +	 * frames can be injected from and extracted to an external CPU.
> +	 * Only one port can be an NPI at the same time.
> +	 */
> +	if (cpu < ocelot->num_phys_ports) {
> +		ocelot_write(ocelot, QSYS_EXT_CPU_CFG_EXT_CPUQ_MSK_M |
> +			     QSYS_EXT_CPU_CFG_EXT_CPU_PORT(cpu),
> +			     QSYS_EXT_CPU_CFG);
> +	}

If a port is not a physical port, what is it? Is it actually an error
if the CPU port is not physical? Should we be returning -EINVAL here,
indicating the device tree is bad?

	   Andrew

  reply	other threads:[~2019-11-10 16:32 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-09 13:02 [PATCH net-next 00/15] Accomodate DSA front-end into Ocelot Vladimir Oltean
2019-11-09 13:02 ` [PATCH net-next 01/15] net: mscc: ocelot: break apart ocelot_vlan_port_apply Vladimir Oltean
2019-11-09 13:02 ` [PATCH net-next 02/15] net: mscc: ocelot: break apart vlan operations into ocelot_vlan_{add,del} Vladimir Oltean
2019-11-09 13:02 ` [PATCH net-next 03/15] net: mscc: ocelot: break out fdb operations into abstract implementations Vladimir Oltean
2019-11-09 13:02 ` [PATCH net-next 04/15] net: mscc: ocelot: change prototypes of hwtstamping ioctls Vladimir Oltean
2019-11-09 13:02 ` [PATCH net-next 05/15] net: mscc: ocelot: change prototypes of switchdev port attribute handlers Vladimir Oltean
2019-11-09 13:02 ` [PATCH net-next 06/15] net: mscc: ocelot: refactor struct ocelot_port out of function prototypes Vladimir Oltean
2019-11-09 13:02 ` [PATCH net-next 07/15] net: mscc: ocelot: separate net_device related items out of ocelot_port Vladimir Oltean
2019-11-09 13:02 ` [PATCH net-next 08/15] net: mscc: ocelot: refactor ethtool callbacks Vladimir Oltean
2019-11-09 13:02 ` [PATCH net-next 09/15] net: mscc: ocelot: limit vlan ingress filtering to actual number of ports Vladimir Oltean
2019-11-10 16:25   ` Andrew Lunn
2019-11-10 16:29     ` Vladimir Oltean
2019-11-09 13:02 ` [PATCH net-next 10/15] net: mscc: ocelot: move port initialization into separate function Vladimir Oltean
2019-11-09 13:02 ` [PATCH net-next 11/15] net: mscc: ocelot: separate the common implementation of ndo_open and ndo_stop Vladimir Oltean
2019-11-09 13:02 ` [PATCH net-next 12/15] net: mscc: ocelot: initialize list of multicast addresses in common code Vladimir Oltean
2019-11-09 13:02 ` [PATCH net-next 13/15] net: mscc: ocelot: refactor adjust_link into a netdev-independent function Vladimir Oltean
2019-11-09 13:03 ` [PATCH net-next 14/15] net: mscc: ocelot: split assignment of the cpu port into a separate function Vladimir Oltean
2019-11-10 16:32   ` Andrew Lunn [this message]
2019-11-10 16:40     ` Vladimir Oltean
2019-11-10 16:50       ` Vladimir Oltean
2019-11-09 13:03 ` [PATCH net-next 15/15] net: mscc: ocelot: don't hardcode the number of the CPU port Vladimir Oltean
2019-11-10 16:50   ` Andrew Lunn
2019-11-10 17:00     ` Vladimir Oltean
2019-11-10 17:12       ` Andrew Lunn
2019-11-10 17:33         ` Vladimir Oltean
2019-11-10 20:54           ` Florian Fainelli
2019-11-12  0:53             ` Vladimir Oltean
2019-11-12  2:53               ` Andrew Lunn
2019-11-10 17:16 ` [PATCH net-next 00/15] Accomodate DSA front-end into Ocelot Andrew Lunn
2019-11-10 17:22   ` Vladimir Oltean
2019-11-11 12:10 ` Horatiu Vultur
2019-11-11 12:17   ` Vladimir Oltean
2019-11-11 20:59 ` David Miller

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=20191110163229.GE25889@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=alexandre.belloni@bootlin.com \
    --cc=allan.nielsen@microchip.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=horatiu.vultur@microchip.com \
    --cc=jakub.kicinski@netronome.com \
    --cc=joergen.andreasen@microchip.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vivien.didelot@gmail.com \
    --cc=vladimir.oltean@nxp.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).