Module Name: src
Committed By: msaitoh
Date: Thu Nov 2 08:41:15 UTC 2017
Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe.h
Log Message:
- Handle hw.ixgN.advertise_speed correctly.
- Fix hw.ixgN.advertise_speed sysctl's description.
To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/ixgbe/ixgbe.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.108 src/sys/dev/pci/ixgbe/ixgbe.c:1.109
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.108 Thu Oct 26 01:40:33 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.c Thu Nov 2 08:41:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.108 2017/10/26 01:40:33 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.109 2017/11/02 08:41:15 msaitoh Exp $ */
/******************************************************************************
@@ -2689,9 +2689,8 @@ ixgbe_media_change(struct ifnet *ifp)
hw->mac.autotry_restart = TRUE;
hw->mac.ops.setup_link(hw, speed, TRUE);
- if (IFM_SUBTYPE(ifm->ifm_media) == IFM_AUTO) {
- adapter->advertise = 0;
- } else {
+ adapter->advertise = 0;
+ if (IFM_SUBTYPE(ifm->ifm_media) != IFM_AUTO) {
if ((speed & IXGBE_LINK_SPEED_10GB_FULL) != 0)
adapter->advertise |= 1 << 2;
if ((speed & IXGBE_LINK_SPEED_1GB_FULL) != 0)
@@ -4783,7 +4782,7 @@ ixgbe_set_advertise(struct adapter *adap
return (EINVAL);
}
- if (advertise < 0x0 || advertise > 0xF) {
+ if (advertise < 0x0 || advertise > 0x2f) {
device_printf(dev,
"Invalid advertised speed; valid modes are 0x0 through 0x7\n");
return (EINVAL);
Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.26 src/sys/dev/pci/ixgbe/ixgbe.h:1.27
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.26 Wed Aug 30 08:49:18 2017
+++ src/sys/dev/pci/ixgbe/ixgbe.h Thu Nov 2 08:41:15 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.26 2017/08/30 08:49:18 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.27 2017/11/02 08:41:15 msaitoh Exp $ */
/******************************************************************************
@@ -631,11 +631,13 @@ struct adapter {
/* Sysctl help messages; displayed with sysctl -d */
#define IXGBE_SYSCTL_DESC_ADV_SPEED \
"\nControl advertised link speed using these flags:\n" \
- "\t0x1 - advertise 100M\n" \
- "\t0x2 - advertise 1G\n" \
- "\t0x4 - advertise 10G\n\n" \
- "\t0x8 - advertise 10M\n\n" \
- "\t100M and 10M are only supported on certain adapters."
+ "\t0x01 - advertise 100M\n" \
+ "\t0x02 - advertise 1G\n" \
+ "\t0x04 - advertise 10G\n" \
+ "\t0x08 - advertise 10M\n" \
+ "\t0x10 - advertise 2.5G\n" \
+ "\t0x20 - advertise 5G\n\n" \
+ "\t5G, 2.5G, 100M and 10M are only supported on certain adapters."
#define IXGBE_SYSCTL_DESC_SET_FC \
"\nSet flow control mode using these values:\n" \