* [PATCH ethtool 1/2] ethtool-copy.h:sync with net
2016-11-04 10:36 [PATCH ethtool 0/2] Adding downshift support to ethtool Allan W. Nielsen
@ 2016-11-04 10:36 ` Allan W. Nielsen
0 siblings, 0 replies; 6+ messages in thread
From: Allan W. Nielsen @ 2016-11-04 10:36 UTC (permalink / raw)
To: netdev; +Cc: andrew, f.fainelli, raju.lakkaraju, allan.nielsen, cphealy, robh
This covers kernel changes upto:
commit 67168af82f30bacbd734a4472670cba6b3d6fd36
Author: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
Date: Wed Nov 2 11:35:12 2016 +0530
ethtool: (uapi) Add ETHTOOL_PHY_DOWNSHIFT to PHY tunables
For operation in cabling environments that are incompatible with 1000BAST-T, PHY
device may provide an automatic link speed downshift operation. When enabled,
the device automatically changes its 1000BAST-T auto-negotiation to the next
slower speed after a configured number of failed attempts at 1000BAST-T. This
feature is useful in setting up in networks using older cable installations that
include only pairs A and B, and not pairs C and D.
Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
Signed-off-by: Allan W. Nielsen <allan.nielsen@microsemi.com>
Signed-off-by: Allan W. Nielsen <allan.nielsen@microsemi.com>
---
ethtool-copy.h | 34 ++++++++++++++++++++++------------
1 file changed, 22 insertions(+), 12 deletions(-)
diff --git a/ethtool-copy.h b/ethtool-copy.h
index 70748f5..040c5b5 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -10,14 +10,16 @@
* Portions Copyright (C) Sun Microsystems 2008
*/
-#ifndef _LINUX_ETHTOOL_H
-#define _LINUX_ETHTOOL_H
+#ifndef _UAPI_LINUX_ETHTOOL_H
+#define _UAPI_LINUX_ETHTOOL_H
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/if_ether.h>
+#ifndef __KERNEL__
#include <limits.h> /* for INT_MAX */
+#endif
/* All structures exposed to userland should be defined such that they
* have the same layout for 32-bit and 64-bit userland.
@@ -114,15 +116,14 @@ struct ethtool_cmd {
__u32 reserved[2];
};
-static __inline__ void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
+static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep,
__u32 speed)
{
-
- ep->speed = (__u16)speed;
+ ep->speed = (__u16)(speed & 0xFFFF);
ep->speed_hi = (__u16)(speed >> 16);
}
-static __inline__ __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
+static inline __u32 ethtool_cmd_speed(const struct ethtool_cmd *ep)
{
return (ep->speed_hi << 16) | ep->speed;
}
@@ -247,6 +248,14 @@ struct ethtool_tunable {
void *data[0];
};
+#define DOWNSHIFT_DEV_DEFAULT_COUNT 0xff
+#define DOWNSHIFT_DEV_DISABLE 0
+
+enum phy_tunable_id {
+ ETHTOOL_PHY_ID_UNSPEC,
+ ETHTOOL_PHY_DOWNSHIFT,
+};
+
/**
* struct ethtool_regs - hardware register dump
* @cmd: Command number = %ETHTOOL_GREGS
@@ -878,12 +887,12 @@ struct ethtool_rx_flow_spec {
#define ETHTOOL_RX_FLOW_SPEC_RING 0x00000000FFFFFFFFLL
#define ETHTOOL_RX_FLOW_SPEC_RING_VF 0x000000FF00000000LL
#define ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF 32
-static __inline__ __u64 ethtool_get_flow_spec_ring(__u64 ring_cookie)
+static inline __u64 ethtool_get_flow_spec_ring(__u64 ring_cookie)
{
return ETHTOOL_RX_FLOW_SPEC_RING & ring_cookie;
};
-static __inline__ __u64 ethtool_get_flow_spec_ring_vf(__u64 ring_cookie)
+static inline __u64 ethtool_get_flow_spec_ring_vf(__u64 ring_cookie)
{
return (ETHTOOL_RX_FLOW_SPEC_RING_VF & ring_cookie) >>
ETHTOOL_RX_FLOW_SPEC_RING_VF_OFF;
@@ -1312,7 +1321,8 @@ struct ethtool_per_queue_op {
#define ETHTOOL_GLINKSETTINGS 0x0000004c /* Get ethtool_link_settings */
#define ETHTOOL_SLINKSETTINGS 0x0000004d /* Set ethtool_link_settings */
-
+#define ETHTOOL_PHY_GTUNABLE 0x0000004e /* Get PHY tunable configuration */
+#define ETHTOOL_PHY_STUNABLE 0x0000004f /* Set PHY tunable configuration */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
@@ -1483,7 +1493,7 @@ enum ethtool_link_mode_bit_indices {
#define SPEED_UNKNOWN -1
-static __inline__ int ethtool_validate_speed(__u32 speed)
+static inline int ethtool_validate_speed(__u32 speed)
{
return speed <= INT_MAX || speed == SPEED_UNKNOWN;
}
@@ -1493,7 +1503,7 @@ static __inline__ int ethtool_validate_speed(__u32 speed)
#define DUPLEX_FULL 0x01
#define DUPLEX_UNKNOWN 0xff
-static __inline__ int ethtool_validate_duplex(__u8 duplex)
+static inline int ethtool_validate_duplex(__u8 duplex)
{
switch (duplex) {
case DUPLEX_HALF:
@@ -1743,4 +1753,4 @@ struct ethtool_link_settings {
* __u32 map_lp_advertising[link_mode_masks_nwords];
*/
};
-#endif /* _LINUX_ETHTOOL_H */
+#endif /* _UAPI_LINUX_ETHTOOL_H */
--
2.7.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH ethtool 0/2] Adding PHY Loopback tunable
@ 2016-11-28 13:25 Allan W. Nielsen
2016-11-28 13:25 ` [PATCH ethtool 1/2] ethtool-copy.h:sync with net Allan W. Nielsen
2016-11-28 13:25 ` [PATCH ethtool 2/2] Ethtool: Implements PHY Loopback Allan W. Nielsen
0 siblings, 2 replies; 6+ messages in thread
From: Allan W. Nielsen @ 2016-11-28 13:25 UTC (permalink / raw)
To: netdev; +Cc: linville, andrew, f.fainelli, raju.lakkaraju, allan.nielsen
Hi All,
This patch implements for support for PHY Loopback using PHY-Tunables.
The patch will add the following options:
ethtool --set-phy-tunable DEVNAME Set PHY tunable
[ loopback off|near|far|extn ]
ethtool --get-phy-tunable DEVNAME Get PHY tunable
[ loopback ]
Please review.
Best regards
Allan and Raju
Raju Lakkaraju (2):
ethtool-copy.h:sync with net
Ethtool: Implements PHY Loopback
ethtool-copy.h | 23 +++++++++-
ethtool.8.in | 49 ++++++++++++++++++++
ethtool.c | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 210 insertions(+), 1 deletion(-)
--
2.7.3
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH ethtool 1/2] ethtool-copy.h:sync with net
2016-11-28 13:25 [PATCH ethtool 0/2] Adding PHY Loopback tunable Allan W. Nielsen
@ 2016-11-28 13:25 ` Allan W. Nielsen
2016-11-28 13:25 ` [PATCH ethtool 2/2] Ethtool: Implements PHY Loopback Allan W. Nielsen
1 sibling, 0 replies; 6+ messages in thread
From: Allan W. Nielsen @ 2016-11-28 13:25 UTC (permalink / raw)
To: netdev
Cc: linville, andrew, f.fainelli, raju.lakkaraju, allan.nielsen,
Raju Lakkaraju
From: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
This covers kernel changes upto:
commit ef05e4c22648c141298f51aab00eb22066838b47
Author: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
Date: Wed Nov 23 15:20:28 2016 +0530
ethtool: (uapi) Add ETHTOOL_PHY_LOOPBACK to PHYtunables
3 types of PHY loopback are supported.
i.e. Near-End Loopback, Far-End Loopback and External Loopback.
Near-End Loopback:
Transmitted data (TXD) is looped back in the PCS block onto the receive
data signal (RXD). When Near-End loopback enable, no data is transmitted
over the network. no data receive from the network.
Far-End Loopback:
This loopback is a special test mode to allow testing the PHY from link
partner side. In this mode data that is received from the link partner pass
through the PHY's receiver, looped back on the MII and transmitted back to
the link partner.
Data present on the transmit data pins of the MAC interface is ignored when
using this test.
External Loopback:
An RJ45 loopback cable can be used to route the transmit signals an the
output of the trnsformer back to the receiver inputs and this loopback will
work at either 10 or 100 or 1000 Mbps speed.
RJ45 Loopback cable created by conncting pin 1 to pin 3 and connecting pin
2 to pin 6.
Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
Signed-off-by: Allan W. Nielsen <allan.nielsen@microsemi.com>
---
ethtool-copy.h | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/ethtool-copy.h b/ethtool-copy.h
index 70748f5..1ebdc72 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -247,6 +247,24 @@ struct ethtool_tunable {
void *data[0];
};
+enum phy_tunable_id {
+ ETHTOOL_PHY_ID_UNSPEC,
+ ETHTOOL_PHY_DOWNSHIFT,
+ ETHTOOL_PHY_LOOPBACK,
+ /*
+ * Add your fresh new phy tunable attribute above and remember to update
+ * phy_tunable_strings[] in net/core/ethtool.c
+ */
+ __ETHTOOL_PHY_TUNABLE_COUNT,
+};
+
+enum phy_loopback_type {
+ ETHTOOL_PHY_LOOPBACK_DISABLE,
+ ETHTOOL_PHY_LOOPBACK_NEAR,
+ ETHTOOL_PHY_LOOPBACK_FAR,
+ ETHTOOL_PHY_LOOPBACK_EXTN
+};
+
/**
* struct ethtool_regs - hardware register dump
* @cmd: Command number = %ETHTOOL_GREGS
@@ -547,6 +565,7 @@ struct ethtool_pauseparam {
* @ETH_SS_FEATURES: Device feature names
* @ETH_SS_RSS_HASH_FUNCS: RSS hush function names
* @ETH_SS_PHY_STATS: Statistic names, for use with %ETHTOOL_GPHYSTATS
+ * @ETH_SS_PHY_TUNABLES: PHY tunable names
*/
enum ethtool_stringset {
ETH_SS_TEST = 0,
@@ -557,6 +576,7 @@ enum ethtool_stringset {
ETH_SS_RSS_HASH_FUNCS,
ETH_SS_TUNABLES,
ETH_SS_PHY_STATS,
+ ETH_SS_PHY_TUNABLES,
};
/**
@@ -1312,7 +1332,8 @@ struct ethtool_per_queue_op {
#define ETHTOOL_GLINKSETTINGS 0x0000004c /* Get ethtool_link_settings */
#define ETHTOOL_SLINKSETTINGS 0x0000004d /* Set ethtool_link_settings */
-
+#define ETHTOOL_PHY_GTUNABLE 0x0000004e /* Get PHY tunable configuration */
+#define ETHTOOL_PHY_STUNABLE 0x0000004f /* Set PHY tunable configuration */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
--
2.7.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH ethtool 2/2] Ethtool: Implements PHY Loopback
2016-11-28 13:25 [PATCH ethtool 0/2] Adding PHY Loopback tunable Allan W. Nielsen
2016-11-28 13:25 ` [PATCH ethtool 1/2] ethtool-copy.h:sync with net Allan W. Nielsen
@ 2016-11-28 13:25 ` Allan W. Nielsen
2016-11-28 17:56 ` Florian Fainelli
1 sibling, 1 reply; 6+ messages in thread
From: Allan W. Nielsen @ 2016-11-28 13:25 UTC (permalink / raw)
To: netdev
Cc: linville, andrew, f.fainelli, raju.lakkaraju, allan.nielsen,
Raju Lakkaraju
From: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
Add loopback in ethtool tunables to access PHY drivers.
Ethtool Help: ethtool -h for PHY tunables
ethtool --set-phy-tunable DEVNAME Set PHY tunable
[ loopback off|near|far|extn ]
ethtool --get-phy-tunable DEVNAME Get PHY tunable
[ loopback ]
Ethtool ex:
ethtool --set-phy-tunable eth0 loopback near
ethtool --set-phy-tunable eth0 loopback far
ethtool --set-phy-tunable eth0 loopback extn
ethtool --set-phy-tunable eth0 loopback off
ethtool --get-phy-tunable eth0 loopback
Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
Signed-off-by: Allan W. Nielsen <allan.nielsen@microsemi.com>
---
ethtool.8.in | 49 +++++++++++++++++++++
ethtool.c | 139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 188 insertions(+)
diff --git a/ethtool.8.in b/ethtool.8.in
index 9631847..83e6b97 100644
--- a/ethtool.8.in
+++ b/ethtool.8.in
@@ -340,6 +340,15 @@ ethtool \- query or control network driver and hardware settings
.B2 tx-lpi on off
.BN tx-timer
.BN advertise
+.HP
+.B ethtool \-\-set\-phy\-tunable
+.I devname
+.B4 loopback off near far extn
+.HP
+.B ethtool \-\-get\-phy\-tunable
+.I devname
+.RB [ loopback ]
+.HP
.
.\" Adjust lines (i.e. full justification) and hyphenate.
.ad
@@ -947,6 +956,46 @@ Values are as for
Sets the amount of time the device should stay in idle mode prior to asserting
its Tx LPI (in microseconds). This has meaning only when Tx LPI is enabled.
.RE
+.TP
+.B \-\-set\-phy\-tunable
+Sets the PHY tunable parameters.
+.RS 4
+.TP
+.A4 loopback off near far extn
+Specifies whether the type of loopback should be enabled
+.RE
+.TP
+.B \-\-get\-phy\-tunable
+Gets the PHY tunable parameters.
+.RS 4
+.TP
+.B loopback
+PHY supports 3 types of the Loopbacks. i.e near, far and external.
+
+Near-End Loopback:
+Transmitted data (TXD) is looped back in the PCS block onto the receive data
+signal (RXD). When Near-End loopback enable, no data is transmitted over
+the network. no data receive from the network.
+
+Far-End Loopback:
+This loopback is a special test mode to allow testing the PHY from link
+partner side. In this mode data that is received from the link partner pass
+through the PHY's receiver, looped back on the MII and transmitted back to
+the link partner.
+
+External Loopback:
+An RJ45 loopback cable can be used to route the transmit signals an the
+output of the trnsformer back to the receiver inputs and this loopback will
+work at either 10 or 100 or 1000 Mbps speed.
+RJ45 Loopback cable created by conncting pin 1 to pin 3 and connecting pin
+2 to pin 6.
+
+Gets the PHY Loopback status.
+.TS
+.PD
+.RE
+.TE
+.RE
.SH BUGS
Not supported (in part or whole) on all network drivers.
.SH AUTHOR
diff --git a/ethtool.c b/ethtool.c
index 62f86ef..a4e6c0d 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -4522,6 +4522,141 @@ static int do_seee(struct cmd_context *ctx)
return 0;
}
+static int do_get_phy_tunable(struct cmd_context *ctx)
+{
+ int argc = ctx->argc;
+ char **argp = ctx->argp;
+ int err = 0, i;
+ u8 lpbk_changed = 0;
+ struct ethtool_tunable tunable;
+
+ if (argc < 1)
+ exit_bad_args();
+ for (i = 0; i < argc; i++) {
+ if (!strcmp(argp[i], "loopback")) {
+ lpbk_changed = 1;
+ i += 1;
+ if (i < argc)
+ exit_bad_args();
+ } else {
+ exit_bad_args();
+ }
+ }
+
+ if (lpbk_changed) {
+ u8 type;
+
+ tunable.cmd = ETHTOOL_PHY_GTUNABLE;
+ tunable.id = ETHTOOL_PHY_LOOPBACK;
+ tunable.type_id = ETHTOOL_TUNABLE_U8;
+ tunable.len = 1;
+ tunable.data[0] = &type;
+ err = send_ioctl(ctx, &tunable);
+ if (err < 0) {
+ perror("Cannot Get PHY Loopback status");
+ return 87;
+ }
+ type = *((u8 *)&tunable.data[0]);
+ switch (type) {
+ case ETHTOOL_PHY_LOOPBACK_NEAR:
+ fprintf(stdout, "Near-end Loopback enabled\n");
+ break;
+ case ETHTOOL_PHY_LOOPBACK_FAR:
+ fprintf(stdout, "Far-end Loopback enabled\n");
+ break;
+ case ETHTOOL_PHY_LOOPBACK_EXTN:
+ fprintf(stdout, "External Loopback enabled\n");
+ break;
+ case ETHTOOL_PHY_LOOPBACK_DISABLE:
+ fprintf(stdout, "All PHY Loopbacks disabled\n");
+ break;
+ default:
+ fprintf(stdout, "Invalid Loopback type\n");
+ break;
+ }
+ }
+
+ return err;
+}
+
+static int parse_named_flag(struct cmd_context *ctx, const char *name,
+ const struct flag_info *flags, size_t size,
+ u8 *type)
+{
+ size_t idx;
+ int found = 0;
+
+ if (ctx->argc < 2)
+ return 0;
+
+ if (strcmp(*ctx->argp, name))
+ return 0;
+ ctx->argc -= 1;
+ ctx->argp += 1;
+
+ for (idx = 0; idx < size; idx++) {
+ if (!strcmp(flags[idx].name, *ctx->argp)) {
+ *type = flags[idx].value;
+ ctx->argc -= 1;
+ ctx->argp += 1;
+ found = 1;
+ break;
+ }
+ }
+
+ if (!found)
+ exit_bad_args();
+
+ return 1;
+}
+
+static const struct flag_info lpbk_flags[] = {
+ { "off", ETHTOOL_PHY_LOOPBACK_DISABLE },
+ { "near", ETHTOOL_PHY_LOOPBACK_NEAR },
+ { "far", ETHTOOL_PHY_LOOPBACK_FAR },
+ { "extn", ETHTOOL_PHY_LOOPBACK_EXTN },
+};
+
+static int do_set_phy_tunable(struct cmd_context *ctx)
+{
+ int err = 0;
+ u8 lpbk_changed = 0, lpbk_type = ETHTOOL_PHY_LOOPBACK_DISABLE;
+ struct ethtool_tunable tunable;
+
+ if (ctx->argc == 0)
+ exit_bad_args();
+
+ /* Parse arguments */
+ while (ctx->argc) {
+ if (parse_named_flag(ctx, "loopback", lpbk_flags,
+ ARRAY_SIZE(lpbk_flags),
+ &lpbk_type)) {
+ lpbk_changed = 1;
+ } else {
+ exit_bad_args();
+ }
+ }
+
+ /* Do it */
+ if (lpbk_changed) {
+ u8 type;
+
+ tunable.cmd = ETHTOOL_PHY_STUNABLE;
+ tunable.id = ETHTOOL_PHY_LOOPBACK;
+ tunable.type_id = ETHTOOL_TUNABLE_U8;
+ tunable.len = sizeof(type);
+ tunable.data[0] = &type;
+ *((u8 *)&tunable.data[0]) = lpbk_type;
+ err = send_ioctl(ctx, &tunable);
+ if (err < 0) {
+ perror("Cannot Set PHY Loopback");
+ err = 87;
+ }
+ }
+
+ return err;
+}
+
#ifndef TEST_ETHTOOL
int send_ioctl(struct cmd_context *ctx, void *cmd)
{
@@ -4683,6 +4818,10 @@ static const struct option {
" [ advertise %x ]\n"
" [ tx-lpi on|off ]\n"
" [ tx-timer %d ]\n"},
+ { "--set-phy-tunable", 1, do_set_phy_tunable, "Set PHY tunable",
+ " [ loopback off|near|far|extn ]\n"},
+ { "--get-phy-tunable", 1, do_get_phy_tunable, "Get PHY tunable",
+ " [ loopback ]\n"},
{ "-h|--help", 0, show_usage, "Show this help" },
{ "--version", 0, do_version, "Show version number" },
{}
--
2.7.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH ethtool 2/2] Ethtool: Implements PHY Loopback
2016-11-28 13:25 ` [PATCH ethtool 2/2] Ethtool: Implements PHY Loopback Allan W. Nielsen
@ 2016-11-28 17:56 ` Florian Fainelli
2016-11-28 19:34 ` Allan W. Nielsen
0 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2016-11-28 17:56 UTC (permalink / raw)
To: Allan W. Nielsen, netdev; +Cc: linville, andrew, raju.lakkaraju
On 11/28/2016 05:25 AM, Allan W. Nielsen wrote:
> From: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
>
> Add loopback in ethtool tunables to access PHY drivers.
>
> Ethtool Help: ethtool -h for PHY tunables
> ethtool --set-phy-tunable DEVNAME Set PHY tunable
> [ loopback off|near|far|extn ]
> ethtool --get-phy-tunable DEVNAME Get PHY tunable
> [ loopback ]
>
> Ethtool ex:
> ethtool --set-phy-tunable eth0 loopback near
> ethtool --set-phy-tunable eth0 loopback far
> ethtool --set-phy-tunable eth0 loopback extn
> ethtool --set-phy-tunable eth0 loopback off
>
> ethtool --get-phy-tunable eth0 loopback
>
> Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
> Signed-off-by: Allan W. Nielsen <allan.nielsen@microsemi.com>
> ---
> +Near-End Loopback:
> +Transmitted data (TXD) is looped back in the PCS block onto the receive data
> +signal (RXD). When Near-End loopback enable, no data is transmitted over
> +the network. no data receive from the network.
This is also known as the local loopback test mode, right?
> +
> +Far-End Loopback:
> +This loopback is a special test mode to allow testing the PHY from link
> +partner side. In this mode data that is received from the link partner pass
> +through the PHY's receiver, looped back on the MII and transmitted back to
> +the link partner.
And this is the remote loopback mode.
> +
> +External Loopback:
> +An RJ45 loopback cable can be used to route the transmit signals an the
> +output of the trnsformer back to the receiver inputs and this loopback will
> +work at either 10 or 100 or 1000 Mbps speed.
> +RJ45 Loopback cable created by conncting pin 1 to pin 3 and connecting pin
> +2 to pin 6.
OK, this name makes sense to me, but for the two other names, we need to
use a terminology that is clearer to the reader and/or people familiar
and targeted at using this feature (e.g: in a lab or during manufacturing).
--
Florian
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH ethtool 2/2] Ethtool: Implements PHY Loopback
2016-11-28 17:56 ` Florian Fainelli
@ 2016-11-28 19:34 ` Allan W. Nielsen
0 siblings, 0 replies; 6+ messages in thread
From: Allan W. Nielsen @ 2016-11-28 19:34 UTC (permalink / raw)
To: Florian Fainelli; +Cc: netdev, linville, andrew, raju.lakkaraju
On 28/11/16 09:56, Florian Fainelli wrote:
> On 11/28/2016 05:25 AM, Allan W. Nielsen wrote:
> > From: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
> >
> > Add loopback in ethtool tunables to access PHY drivers.
> >
> > Ethtool Help: ethtool -h for PHY tunables
> > ethtool --set-phy-tunable DEVNAME Set PHY tunable
> > [ loopback off|near|far|extn ]
> > ethtool --get-phy-tunable DEVNAME Get PHY tunable
> > [ loopback ]
> >
> > Ethtool ex:
> > ethtool --set-phy-tunable eth0 loopback near
> > ethtool --set-phy-tunable eth0 loopback far
> > ethtool --set-phy-tunable eth0 loopback extn
> > ethtool --set-phy-tunable eth0 loopback off
> >
> > ethtool --get-phy-tunable eth0 loopback
> >
> > Signed-off-by: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
> > Signed-off-by: Allan W. Nielsen <allan.nielsen@microsemi.com>
> > ---
>
> > +Near-End Loopback:
> > +Transmitted data (TXD) is looped back in the PCS block onto the receive data
> > +signal (RXD). When Near-End loopback enable, no data is transmitted over
> > +the network. no data receive from the network.
>
> This is also known as the local loopback test mode, right?
Yes - Traffic transmitted/generated by the host list loopback to the
host instead of transmitting it on the wire.
> > +
> > +Far-End Loopback:
> > +This loopback is a special test mode to allow testing the PHY from link
> > +partner side. In this mode data that is received from the link partner pass
> > +through the PHY's receiver, looped back on the MII and transmitted back to
> > +the link partner.
>
> And this is the remote loopback mode.
Yes - Traffic receiwed on the "wire" is transmitted back on the wire.
> > +
> > +External Loopback:
> > +An RJ45 loopback cable can be used to route the transmit signals an the
> > +output of the trnsformer back to the receiver inputs and this loopback will
> > +work at either 10 or 100 or 1000 Mbps speed.
> > +RJ45 Loopback cable created by conncting pin 1 to pin 3 and connecting pin
> > +2 to pin 6.
>
> OK, this name makes sense to me, but for the two other names, we need to
> use a terminology that is clearer to the reader and/or people familiar
> and targeted at using this feature (e.g: in a lab or during manufacturing).
Sure, we can find better names and/or improve the documentation. But
before jumping to that, then it is properly a good idea to agree on
the overall concept.
We will get back to the naming when we agree on the other parts.
/Allan
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-11-28 19:35 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-28 13:25 [PATCH ethtool 0/2] Adding PHY Loopback tunable Allan W. Nielsen
2016-11-28 13:25 ` [PATCH ethtool 1/2] ethtool-copy.h:sync with net Allan W. Nielsen
2016-11-28 13:25 ` [PATCH ethtool 2/2] Ethtool: Implements PHY Loopback Allan W. Nielsen
2016-11-28 17:56 ` Florian Fainelli
2016-11-28 19:34 ` Allan W. Nielsen
-- strict thread matches above, loose matches on Subject: below --
2016-11-04 10:36 [PATCH ethtool 0/2] Adding downshift support to ethtool Allan W. Nielsen
2016-11-04 10:36 ` [PATCH ethtool 1/2] ethtool-copy.h:sync with net Allan W. Nielsen
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).