Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-10]: src/sys/dev/pci/ixgbe Pull up following revision(s) (request...
details: https://anonhg.NetBSD.org/src/rev/02ddf6cc5c04
branches: netbsd-10
changeset: 376515:02ddf6cc5c04
user: martin <martin%NetBSD.org@localhost>
date: Wed Jun 21 19:16:12 2023 +0000
description:
Pull up following revision(s) (requested by msaitoh in ticket #202):
sys/dev/pci/ixgbe/ixgbe_type.h: revision 1.56
sys/dev/pci/ixgbe/ixgbe.c: revision 1.325
sys/dev/pci/ixgbe/ixgbe.c: revision 1.326
sys/dev/pci/ixgbe/ixgbe_common.c: revision 1.44
Use thermal sensor code for IXGBE_DEV_ID_X550EM_A_10G_T, too.
PCI device ID 0x15c8 also use X557-AT PHY, so create the thermal sensor
sysctl for it, too.
Count the number of link down events in the MAC using with LINK_DN_CNT.
- Add new event counter "link_dn_cnt" to count the number of link down
events in the MAC.
- The LINK_DN_CNT register (at 0x0403c) is described only in the
Denverton's datasheet, so use it only on ixgbe_mac_X550EM_a.
diffstat:
sys/dev/pci/ixgbe/ixgbe.c | 22 +++++++++++++++++-----
sys/dev/pci/ixgbe/ixgbe_common.c | 6 ++++--
sys/dev/pci/ixgbe/ixgbe_type.h | 4 +++-
3 files changed, 24 insertions(+), 8 deletions(-)
diffs (137 lines):
diff -r 1c81ada64e81 -r 02ddf6cc5c04 sys/dev/pci/ixgbe/ixgbe.c
--- a/sys/dev/pci/ixgbe/ixgbe.c Wed Jun 21 19:09:07 2023 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe.c Wed Jun 21 19:16:12 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.324 2022/10/28 01:10:41 msaitoh Exp $ */
+/* $NetBSD: ixgbe.c,v 1.324.2.1 2023/06/21 19:16:12 martin Exp $ */
/******************************************************************************
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.324 2022/10/28 01:10:41 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.324.2.1 2023/06/21 19:16:12 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -1680,6 +1680,8 @@ ixgbe_update_stats_counters(struct adapt
IXGBE_EVC_REGADD(hw, stats, IXGBE_MLFC, mlfc);
IXGBE_EVC_REGADD(hw, stats, IXGBE_MRFC, mrfc);
}
+ if (hw->mac.type == ixgbe_mac_X550EM_a)
+ IXGBE_EVC_REGADD(hw, stats, IXGBE_LINK_DN_CNT, link_dn_cnt);
IXGBE_EVC_REGADD2(hw, stats, IXGBE_RLEC, rlec);
/* Hardware workaround, gprc counts missed packets */
@@ -2029,6 +2031,9 @@ ixgbe_add_hw_stats(struct adapter *adapt
stats->namebuf, "MAC Local Faults");
evcnt_attach_dynamic(&stats->mrfc, EVCNT_TYPE_MISC, NULL,
stats->namebuf, "MAC Remote Faults");
+ if (hw->mac.type == ixgbe_mac_X550EM_a)
+ evcnt_attach_dynamic(&stats->link_dn_cnt, EVCNT_TYPE_MISC,
+ NULL, stats->namebuf, "Link down event in the MAC");
evcnt_attach_dynamic(&stats->rlec, EVCNT_TYPE_MISC, NULL,
stats->namebuf, "Receive Length Errors");
evcnt_attach_dynamic(&stats->lxontxc, EVCNT_TYPE_MISC, NULL,
@@ -2197,6 +2202,8 @@ ixgbe_clear_evcnt(struct adapter *adapte
IXGBE_EVC_STORE(&stats->mpctotal, 0);
IXGBE_EVC_STORE(&stats->mlfc, 0);
IXGBE_EVC_STORE(&stats->mrfc, 0);
+ if (hw->mac.type == ixgbe_mac_X550EM_a)
+ IXGBE_EVC_STORE(&stats->link_dn_cnt, 0);
IXGBE_EVC_STORE(&stats->rlec, 0);
IXGBE_EVC_STORE(&stats->lxontxc, 0);
IXGBE_EVC_STORE(&stats->lxonrxc, 0);
@@ -3515,7 +3522,8 @@ ixgbe_add_device_sysctls(struct adapter
}
/* for X552/X557-AT devices */
- if (hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) {
+ if ((hw->device_id == IXGBE_DEV_ID_X550EM_X_10G_T) ||
+ (hw->device_id == IXGBE_DEV_ID_X550EM_A_10G_T)) {
const struct sysctlnode *phy_node;
if (sysctl_createv(log, 0, &rnode, &phy_node, 0, CTLTYPE_NODE,
@@ -3801,6 +3809,8 @@ ixgbe_detach(device_t dev, int flags)
evcnt_detach(&stats->mpctotal);
evcnt_detach(&stats->mlfc);
evcnt_detach(&stats->mrfc);
+ if (hw->mac.type == ixgbe_mac_X550EM_a)
+ evcnt_detach(&stats->link_dn_cnt);
evcnt_detach(&stats->rlec);
evcnt_detach(&stats->lxontxc);
evcnt_detach(&stats->lxonrxc);
@@ -5954,7 +5964,8 @@ ixgbe_sysctl_phy_temp(SYSCTLFN_ARGS)
if (ixgbe_fw_recovery_mode_swflag(adapter))
return (EPERM);
- if (hw->device_id != IXGBE_DEV_ID_X550EM_X_10G_T) {
+ if ((hw->device_id != IXGBE_DEV_ID_X550EM_X_10G_T) &&
+ (hw->device_id != IXGBE_DEV_ID_X550EM_A_10G_T)) {
device_printf(adapter->dev,
"Device has no supported external thermal sensor.\n");
return (ENODEV);
@@ -5997,7 +6008,8 @@ ixgbe_sysctl_phy_overtemp_occurred(SYSCT
if (ixgbe_fw_recovery_mode_swflag(adapter))
return (EPERM);
- if (hw->device_id != IXGBE_DEV_ID_X550EM_X_10G_T) {
+ if ((hw->device_id != IXGBE_DEV_ID_X550EM_X_10G_T) &&
+ (hw->device_id != IXGBE_DEV_ID_X550EM_A_10G_T)){
device_printf(adapter->dev,
"Device has no supported external thermal sensor.\n");
return (ENODEV);
diff -r 1c81ada64e81 -r 02ddf6cc5c04 sys/dev/pci/ixgbe/ixgbe_common.c
--- a/sys/dev/pci/ixgbe/ixgbe_common.c Wed Jun 21 19:09:07 2023 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_common.c Wed Jun 21 19:16:12 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_common.c,v 1.43 2022/06/06 02:16:37 msaitoh Exp $ */
+/* $NetBSD: ixgbe_common.c,v 1.43.4.1 2023/06/21 19:16:12 martin Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@@ -36,7 +36,7 @@
/*$FreeBSD: head/sys/dev/ixgbe/ixgbe_common.c 331224 2018-03-19 20:55:05Z erj $*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixgbe_common.c,v 1.43 2022/06/06 02:16:37 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe_common.c,v 1.43.4.1 2023/06/21 19:16:12 martin Exp $");
#include "ixgbe_common.h"
#include "ixgbe_phy.h"
@@ -544,6 +544,8 @@ s32 ixgbe_clear_hw_cntrs_generic(struct
IXGBE_READ_REG(hw, IXGBE_MLFC);
IXGBE_READ_REG(hw, IXGBE_MRFC);
+ if (hw->mac.type == ixgbe_mac_X550EM_a)
+ IXGBE_READ_REG(hw, IXGBE_LINK_DN_CNT);
IXGBE_READ_REG(hw, IXGBE_RLEC);
IXGBE_READ_REG(hw, IXGBE_LXONTXC);
IXGBE_READ_REG(hw, IXGBE_LXOFFTXC);
diff -r 1c81ada64e81 -r 02ddf6cc5c04 sys/dev/pci/ixgbe/ixgbe_type.h
--- a/sys/dev/pci/ixgbe/ixgbe_type.h Wed Jun 21 19:09:07 2023 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_type.h Wed Jun 21 19:16:12 2023 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe_type.h,v 1.55 2021/12/24 05:11:04 msaitoh Exp $ */
+/* $NetBSD: ixgbe_type.h,v 1.55.4.1 2023/06/21 19:16:12 martin Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@@ -991,6 +991,7 @@ struct ixgbe_dmac_config {
#define IXGBE_MPC(_i) (0x03FA0 + ((_i) * 4)) /* 8 of these 3FA0-3FBC*/
#define IXGBE_MLFC 0x04034
#define IXGBE_MRFC 0x04038
+#define IXGBE_LINK_DN_CNT 0x0403c /* LINK Down Counter */
#define IXGBE_RLEC 0x04040
#define IXGBE_LXONTXC 0x03F60
#define IXGBE_LXONRXC 0x0CF60
@@ -3918,6 +3919,7 @@ struct ixgbe_hw_stats {
struct evcnt mpc[IXGBE_TC_COUNTER_NUM];
struct evcnt mlfc;
struct evcnt mrfc;
+ struct evcnt link_dn_cnt;
struct evcnt rlec;
struct evcnt lxontxc;
struct evcnt lxonrxc;
Home |
Main Index |
Thread Index |
Old Index