mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: Mugunthan V N <mugunthanvnm@ti.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	linux-api@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH 1/1] ethtool: adding support for multiple slave port configuration
Date: Sun, 27 Jul 2014 03:47:01 +0100	[thread overview]
Message-ID: <1406429221.29010.151.camel@deadeye.wl.decadent.org.uk> (raw)
In-Reply-To: <1406291305-22286-1-git-send-email-mugunthanvnm@ti.com>

[-- Attachment #1: Type: text/plain, Size: 2757 bytes --]

On Fri, 2014-07-25 at 17:58 +0530, Mugunthan V N wrote:
> Some Ethernet Swtich controllers like CPSW in AM335x, TI814x, DRA7x and
> AM43xx SoCs, Network Coprocessor in AM5K2E0x, Realtek Switch controllers
> etc has to capability of conneting multiple networks using L2 switching
> and has multiple phys. With the existing code, ethtool can communicate
> only to one phy.
> 
> To enable user to communicate multiple phy connected to single Ethernet
> Switch controller, intoducing a optional new parameter in Ethtool interface
> to pass which slave to set/get the phy configuration.

There was some discussion about configuration APIs for hardware/firmware
bridges earlier this year and I thought there was a consensus for
assigning a network device to each port.  This would remove the need to
identify ports within a device.  But I may have misremembered.

> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
> ---
>  include/uapi/linux/ethtool.h | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/include/uapi/linux/ethtool.h b/include/uapi/linux/ethtool.h
> index 96ade34..3011427 100644
> --- a/include/uapi/linux/ethtool.h
> +++ b/include/uapi/linux/ethtool.h
> @@ -60,6 +60,9 @@
>   *	and other link features that the link partner advertised
>   *	through autonegotiation; 0 if unknown or not applicable.
>   *	Read-only.
> + * @slave_port: Specify which slave port to be used to set/get
> + *	parmeters, for example which slave port phy to be used for
> + *	set/get phy capabilities

The difficulty with assigning the reserved fields in struct ethtool_cmd
is that nothing has ever checked that they are set to 0.  So if we were
to assign this field and support it in ethtool, someone might run it on
an older kernel version and all configuration changes will be made to
port 0 rather than the one they specified.  I don't think it would be
acceptable to tell users that 'oh, the port number option silently fails
on older kernel versions'.

So at the very least you would also need to add some way for userland to
find out whether the driver will check the value of this field.

Ben.

>   * The link speed in Mbps is split between @speed and @speed_hi.  Use
>   * the ethtool_cmd_speed() and ethtool_cmd_speed_set() functions to
> @@ -107,7 +110,8 @@ struct ethtool_cmd {
>  	__u8	eth_tp_mdix;
>  	__u8	eth_tp_mdix_ctrl;
>  	__u32	lp_advertising;
> -	__u32	reserved[2];
> +	__u32	slave_port;
> +	__u32	reserved;
>  };
>  
>  static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,

-- 
Ben Hutchings
The generation of random numbers is too important to be left to chance.
                                                            - Robert Coveyou

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

  reply	other threads:[~2014-07-27  2:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25 12:28 Mugunthan V N
2014-07-27  2:47 ` Ben Hutchings [this message]
2014-07-27 16:09   ` John Fastabend
2014-07-30 17:34     ` Mugunthan V N
2014-07-29  1:03   ` Andy Gospodarek

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=1406429221.29010.151.camel@deadeye.wl.decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=davem@davemloft.net \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mugunthanvnm@ti.com \
    --cc=netdev@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®