git: cc76018cdd89 - stable/13 - cxgbe(4): Read the rx 'c' channel for a port and make it available.
John Baldwin
jhb at FreeBSD.org
Mon Apr 26 19:03:47 UTC 2021
The branch stable/13 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=cc76018cdd89880eea505b02ebd1d01cec247afb
commit cc76018cdd89880eea505b02ebd1d01cec247afb
Author: Navdeep Parhar <np at FreeBSD.org>
AuthorDate: 2021-02-26 02:10:52 +0000
Commit: John Baldwin <jhb at FreeBSD.org>
CommitDate: 2021-04-26 19:01:10 +0000
cxgbe(4): Read the rx 'c' channel for a port and make it available.
Sponsored by: Chelsio Communications
(cherry picked from commit dfff1de729bd73004404863b7f9e8a9bda7b0f04)
---
sys/dev/cxgbe/adapter.h | 1 +
sys/dev/cxgbe/common/t4_hw.c | 18 ++++++++++++++++++
sys/dev/cxgbe/t4_main.c | 2 ++
3 files changed, 21 insertions(+)
diff --git a/sys/dev/cxgbe/adapter.h b/sys/dev/cxgbe/adapter.h
index 4b2f86d00052..d892fd0e9270 100644
--- a/sys/dev/cxgbe/adapter.h
+++ b/sys/dev/cxgbe/adapter.h
@@ -306,6 +306,7 @@ struct port_info {
uint8_t tx_chan;
uint8_t mps_bg_map; /* rx MPS buffer group bitmap */
uint8_t rx_e_chan_map; /* rx TP e-channel bitmap */
+ uint8_t rx_c_chan; /* rx TP c-channel */
struct link_config link_cfg;
struct ifmedia media;
diff --git a/sys/dev/cxgbe/common/t4_hw.c b/sys/dev/cxgbe/common/t4_hw.c
index b54a71a02ca4..734ab7f33acb 100644
--- a/sys/dev/cxgbe/common/t4_hw.c
+++ b/sys/dev/cxgbe/common/t4_hw.c
@@ -6818,6 +6818,23 @@ static unsigned int t4_get_rx_e_chan_map(struct adapter *adap, int idx)
return 1 << idx;
}
+/*
+ * TP RX c-channel associated with the port.
+ */
+static unsigned int t4_get_rx_c_chan(struct adapter *adap, int idx)
+{
+ u32 param, val;
+ int ret;
+
+ param = (V_FW_PARAMS_MNEM(FW_PARAMS_MNEM_DEV) |
+ V_FW_PARAMS_PARAM_X(FW_PARAMS_PARAM_DEV_TPCHMAP));
+ ret = t4_query_params(adap, adap->mbox, adap->pf, 0, 1, ¶m, &val);
+ if (!ret)
+ return (val >> (8 * idx)) & 0xff;
+
+ return 0;
+}
+
/**
* t4_get_port_type_description - return Port Type string description
* @port_type: firmware Port Type enumeration
@@ -9789,6 +9806,7 @@ int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id)
p->tx_chan = j;
p->mps_bg_map = t4_get_mps_bg_map(adap, j);
p->rx_e_chan_map = t4_get_rx_e_chan_map(adap, j);
+ p->rx_c_chan = t4_get_rx_c_chan(adap, j);
p->lport = j;
if (!(adap->flags & IS_VF) ||
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c
index 18a83df763ab..1ac072c2057c 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -7071,6 +7071,8 @@ cxgbe_sysctls(struct port_info *pi)
pi->mps_bg_map, "MPS buffer group map");
SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_e_chan_map", CTLFLAG_RD,
NULL, pi->rx_e_chan_map, "TP rx e-channel map");
+ SYSCTL_ADD_INT(ctx, children, OID_AUTO, "rx_c_chan", CTLFLAG_RD, NULL,
+ pi->rx_c_chan, "TP rx c-channel");
if (sc->flags & IS_VF)
return;
More information about the dev-commits-src-branches
mailing list