The branch main has been updated by np:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=dfff1de729bd73004404863b7f9e8a9bda7b0f04

commit dfff1de729bd73004404863b7f9e8a9bda7b0f04
Author:     Navdeep Parhar <n...@freebsd.org>
AuthorDate: 2021-02-26 02:10:52 +0000
Commit:     Navdeep Parhar <n...@freebsd.org>
CommitDate: 2021-02-26 07:46:14 +0000

    cxgbe(4): Read the rx 'c' channel for a port and make it available.
    
    MFC after:      1 week
    Sponsored by:   Chelsio Communications
---
 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 5fe7b76ccb0d..ff9e4eacf112 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 b3934381ba7a..bb08c55c87b2 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, &param, &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
@@ -9840,6 +9857,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 3594db2ea136..c9a8b08e8d16 100644
--- a/sys/dev/cxgbe/t4_main.c
+++ b/sys/dev/cxgbe/t4_main.c
@@ -7077,6 +7077,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;
_______________________________________________
dev-commits-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "dev-commits-src-all-unsubscr...@freebsd.org"

Reply via email to