aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavdeep Parhar <np@FreeBSD.org>2021-11-03 18:00:44 +0000
committerNavdeep Parhar <np@FreeBSD.org>2021-11-09 23:41:20 +0000
commitd99b1d83b9e9ae2c47ffbd71a7c2a261d9eae2dd (patch)
tree1759a1be4376ee63c0b078a1aab5a1364f5c1ae0
parentb2bf1a57873b8d0c1c673d7b2f0ba5233e5d9890 (diff)
cxgbe(4): sysctl to track the last L1_CFG32 requested by the driver.
dev.<port>.<inst>.rcaps # sysctl dev.cc | grep rcaps dev.cc.1.rcaps: 581107776 dev.cc.0.rcaps: 582156414 MFC after: 1 week Sponsored by: Chelsio Communications
-rw-r--r--sys/dev/cxgbe/common/common.h1
-rw-r--r--sys/dev/cxgbe/common/t4_hw.c1
-rw-r--r--sys/dev/cxgbe/t4_main.c3
3 files changed, 5 insertions, 0 deletions
diff --git a/sys/dev/cxgbe/common/common.h b/sys/dev/cxgbe/common/common.h
index 07d8ab2b40f0..50859e868b9d 100644
--- a/sys/dev/cxgbe/common/common.h
+++ b/sys/dev/cxgbe/common/common.h
@@ -444,6 +444,7 @@ struct link_config {
int8_t requested_fc; /* flow control */
int8_t requested_fec; /* FEC */
u_int requested_speed; /* speed (Mbps) */
+ uint32_t requested_caps;/* rcap in last l1cfg issued by the driver. */
uint32_t pcaps; /* link capabilities */
uint32_t acaps; /* advertised capabilities */
diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c
index f06b21120061..b9bf5df5ccc6 100644
--- a/sys/dev/cxgbe/common/t4_hw.c
+++ b/sys/dev/cxgbe/common/t4_hw.c
@@ -3975,6 +3975,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int mbox, unsigned int port,
c.u.l1cfg.rcap = cpu_to_be32(fwcaps32_to_caps16(rcap));
}
+ lc->requested_caps = rcap;
return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL);
}
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 66f48f2bf922..1c51e4847959 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -5703,6 +5703,7 @@ init_link_config(struct port_info *pi)
PORT_LOCK_ASSERT_OWNED(pi);
+ lc->requested_caps = 0;
lc->requested_speed = 0;
if (t4_autoneg == 0)
@@ -7770,6 +7771,8 @@ cxgbe_sysctls(struct port_info *pi)
sysctl_autoneg, "I",
"autonegotiation (-1 = not supported)");
+ SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rcaps", CTLFLAG_RD,
+ &pi->link_cfg.requested_caps, 0, "L1 config requested by driver");
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "pcaps", CTLFLAG_RD,
&pi->link_cfg.pcaps, 0, "port capabilities");
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "acaps", CTLFLAG_RD,