Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1613113

Re: [PATCH net-next 3/9] net: dsa: mv88e6xxx: program the PVT with all ones

From Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Newsgroups linux.kernel
Subject Re: [PATCH net-next 3/9] net: dsa: mv88e6xxx: program the PVT with all ones
Date 2017-03-30 16:20 +0200
Message-ID <tqJ5D-7vN-9@gated-at.bofh.it> (permalink)
References <tqsxQ-3KK-7@gated-at.bofh.it> <tqsxR-3KK-31@gated-at.bofh.it> <tqICC-74s-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Andrew,

Andrew Lunn <andrew@lunn.ch> writes:

>> +	for (dev = 0; dev < 32; ++dev) {
>> +		for (port = 0; port < 16; ++port) {
>> +			err = mv88e6xxx_pvt_map(chip, dev, port);
>> +			if (err)
>> +				return err;
>> +		}
>> +	}
>> +
>> +	return 0;
>
> Hi Vivien
>
> How about adding MV88E6XXX_MAX_PVT_SWITCHES and MV88E6XXX_MAX_PVT_PORTS?

Sure.

>> +static int mv88e6xxx_g2_pvt_op(struct mv88e6xxx_chip *chip, int src_dev,
>> +			       int src_port, u16 op)
>> +{
>> +	int err;
>> +
>> +	/* 9-bit Cross-chip PVT pointer: with GLOBAL2_MISC_5_BIT_PORT cleared,
>> +	 * source device is 5-bit, source port is 4-bit.
>> +	 */
>> +	op |= (src_dev & 0x1f) << 4;
>> +	op |= (src_port & 0xf);
>
> So here, are you hard coding the knowledge that we passed false to
> mv88e6xxx_g2_misc_5_bit_port()?  It kind of defeats the point of
> having the parameter. Maybe simplify the code and remove the
> parameter?

I usually like to have generic library functions, but you are correct
here, it gets inconsistent in this specific case. Unless we add a
dynamic PVT state to the chip, which is totally overkill by now.

I'll add mv88e6xxx_g2_misc_4_bit_port(struct mv88e6xxx_chip *chip).

Thanks,

        Vivien

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 0/9] net: dsa: mv88e6xxx: program cross-chip bridging Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-29 22:40 +0200
  [PATCH net-next 1/9] net: dsa: mv88e6xxx: move PVT description in info Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-29 22:40 +0200
    Re: [PATCH net-next 1/9] net: dsa: mv88e6xxx: move PVT description  in info Andrew Lunn <andrew@lunn.ch> - 2017-03-30 15:40 +0200
  [PATCH net-next 9/9] net: dsa: mv88e6xxx: add cross-chip bridging Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-29 22:40 +0200
  [PATCH net-next 3/9] net: dsa: mv88e6xxx: program the PVT with all ones Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-29 22:40 +0200
    Re: [PATCH net-next 3/9] net: dsa: mv88e6xxx: program the PVT with  all ones Andrew Lunn <andrew@lunn.ch> - 2017-03-30 15:50 +0200
      Re: [PATCH net-next 3/9] net: dsa: mv88e6xxx: program the PVT with all ones Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-30 16:20 +0200
  [PATCH net-next 6/9] net: dsa: mv88e6xxx: factorize in-chip bridge map Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-29 22:40 +0200
    Re: [PATCH net-next 6/9] net: dsa: mv88e6xxx: factorize in-chip  bridge map Andrew Lunn <andrew@lunn.ch> - 2017-03-30 16:10 +0200
  [PATCH net-next 2/9] net: dsa: mv88e6xxx: use 4-bit port for PVT data Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-03-29 22:40 +0200
    Re: [PATCH net-next 2/9] net: dsa: mv88e6xxx: use 4-bit port for PVT  data Andrew Lunn <andrew@lunn.ch> - 2017-03-30 15:40 +0200

csiph-web