From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
Nithin Dabilpuram <ndabilpuram@marvell.com>,
Kiran Kumar K <kirankumark@marvell.com>,
Sunil Kumar Kori <skori@marvell.com>,
Satha Rao <skoteshwar@marvell.com>,
Harman Kalra <hkalra@marvell.com>
Subject: [PATCH 34/45] common/cnxk: remove unused MCS port recovery
Date: Sun, 29 Nov 2026 12:49:19 -0800 [thread overview]
Message-ID: <20261129205006.1440292-35-stephen@networkplumber.org> (raw)
In-Reply-To: <20261129205006.1440292-1-stephen@networkplumber.org>
roc_mcs_port_recovery() has no caller, and removing it leaves
mcs_port_reset_set() unreachable. Remove both.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/common/cnxk/roc_mcs.c | 258 ----------------------------------
drivers/common/cnxk/roc_mcs.h | 2 -
2 files changed, 260 deletions(-)
diff --git a/drivers/common/cnxk/roc_mcs.c b/drivers/common/cnxk/roc_mcs.c
index 5894750f7e..7059bea15c 100644
--- a/drivers/common/cnxk/roc_mcs.c
+++ b/drivers/common/cnxk/roc_mcs.c
@@ -72,25 +72,6 @@ roc_mcs_hw_info_get(struct roc_mcs_hw_info *hw_info)
return rc;
}
-static int
-mcs_port_reset_set(struct roc_mcs *mcs, struct roc_mcs_port_reset_req *port, uint8_t reset)
-{
- struct mcs_port_reset_req *req;
- struct msg_rsp *rsp;
-
- MCS_SUPPORT_CHECK;
-
- req = mbox_alloc_msg_mcs_port_reset(mcs->mbox);
- if (req == NULL)
- return -ENOMEM;
-
- req->reset = reset;
- req->lmac_id = port->port_id;
- req->mcs_id = mcs->idx;
-
- return mbox_process_msg(mcs->mbox, (void *)&rsp);
-}
-
int
roc_mcs_pn_threshold_set(struct roc_mcs *mcs, struct roc_mcs_set_pn_threshold *pn)
{
@@ -143,245 +124,6 @@ roc_mcs_intr_configure(struct roc_mcs *mcs, struct roc_mcs_intr_cfg *config)
return rc;
}
-int
-roc_mcs_port_recovery(struct roc_mcs *mcs, union roc_mcs_event_data *mdata, uint8_t port_id)
-{
- struct mcs_priv *priv = roc_mcs_to_mcs_priv(mcs);
- struct roc_mcs_pn_table_write_req pn_table = {0};
- struct roc_mcs_rx_sc_sa_map rx_map = {0};
- struct roc_mcs_tx_sc_sa_map tx_map = {0};
- struct roc_mcs_port_reset_req port = {0};
- struct roc_mcs_clear_stats stats = {0};
- int tx_cnt = 0, rx_cnt = 0, rc = 0;
- uint64_t set;
- int i;
-
- port.port_id = port_id;
- rc = mcs_port_reset_set(mcs, &port, 1);
-
- /* Reset TX/RX PN tables */
- for (i = 0; i < (priv->sa_entries << 1); i++) {
- set = plt_bitmap_get(priv->port_rsrc[port_id].sa_bmap, i);
- if (set) {
- pn_table.pn_id = i;
- pn_table.next_pn = 1;
- pn_table.dir = MCS_RX;
- if (i >= priv->sa_entries) {
- pn_table.dir = MCS_TX;
- pn_table.pn_id -= priv->sa_entries;
- }
- rc = roc_mcs_pn_table_write(mcs, &pn_table);
- if (rc)
- return rc;
-
- if (i >= priv->sa_entries)
- tx_cnt++;
- else
- rx_cnt++;
- }
- }
-
- if (tx_cnt || rx_cnt) {
- mdata->tx_sa_array = plt_zmalloc(tx_cnt * sizeof(uint16_t), 0);
- if (tx_cnt && (mdata->tx_sa_array == NULL)) {
- rc = -ENOMEM;
- goto exit;
- }
- mdata->rx_sa_array = plt_zmalloc(rx_cnt * sizeof(uint16_t), 0);
- if (rx_cnt && (mdata->rx_sa_array == NULL)) {
- rc = -ENOMEM;
- goto exit;
- }
-
- mdata->num_tx_sa = tx_cnt;
- mdata->num_rx_sa = rx_cnt;
- for (i = 0; i < (priv->sa_entries << 1); i++) {
- set = plt_bitmap_get(priv->port_rsrc[port_id].sa_bmap, i);
- if (set) {
- if (i >= priv->sa_entries)
- mdata->tx_sa_array[--tx_cnt] = i - priv->sa_entries;
- else
- mdata->rx_sa_array[--rx_cnt] = i;
- }
- }
- }
- tx_cnt = 0;
- rx_cnt = 0;
-
- /* Reset Tx active SA to index:0 */
- for (i = priv->sc_entries; i < (priv->sc_entries << 1); i++) {
- set = plt_bitmap_get(priv->port_rsrc[port_id].sc_bmap, i);
- if (set) {
- uint16_t sc_id = i - priv->sc_entries;
-
- tx_map.sa_index0 = priv->port_rsrc[port_id].sc_conf[sc_id].tx.sa_idx0;
- tx_map.sa_index1 = priv->port_rsrc[port_id].sc_conf[sc_id].tx.sa_idx1;
- tx_map.rekey_ena = priv->port_rsrc[port_id].sc_conf[sc_id].tx.rekey_enb;
- tx_map.sectag_sci = priv->port_rsrc[port_id].sc_conf[sc_id].tx.sci;
- tx_map.sa_index0_vld = 1;
- tx_map.sa_index1_vld = 0;
- tx_map.tx_sa_active = 0;
- tx_map.sc_id = sc_id;
- rc = roc_mcs_tx_sc_sa_map_write(mcs, &tx_map);
- if (rc)
- return rc;
-
- tx_cnt++;
- }
- }
-
- if (tx_cnt) {
- mdata->tx_sc_array = plt_zmalloc(tx_cnt * sizeof(uint16_t), 0);
- if (tx_cnt && (mdata->tx_sc_array == NULL)) {
- rc = -ENOMEM;
- goto exit;
- }
-
- mdata->num_tx_sc = tx_cnt;
- for (i = priv->sc_entries; i < (priv->sc_entries << 1); i++) {
- set = plt_bitmap_get(priv->port_rsrc[port_id].sc_bmap, i);
- if (set)
- mdata->tx_sc_array[--tx_cnt] = i - priv->sc_entries;
- }
- }
-
- /* Clear SA_IN_USE for active ANs in RX CPM */
- for (i = 0; i < priv->sc_entries; i++) {
- set = plt_bitmap_get(priv->port_rsrc[port_id].sc_bmap, i);
- if (set) {
- rx_map.sa_index = priv->port_rsrc[port_id].sc_conf[i].rx.sa_idx;
- rx_map.an = priv->port_rsrc[port_id].sc_conf[i].rx.an;
- rx_map.sa_in_use = 0;
- rx_map.sc_id = i;
- rc = roc_mcs_rx_sc_sa_map_write(mcs, &rx_map);
- if (rc)
- return rc;
-
- rx_cnt++;
- }
- }
-
- /* Reset flow(flow/secy/sc/sa) stats mapped to this PORT */
- for (i = 0; i < (priv->tcam_entries << 1); i++) {
- set = plt_bitmap_get(priv->port_rsrc[port_id].tcam_bmap, i);
- if (set) {
- stats.type = MCS_FLOWID_STATS;
- stats.id = i;
- stats.dir = MCS_RX;
- if (i >= priv->sa_entries) {
- stats.dir = MCS_TX;
- stats.id -= priv->tcam_entries;
- }
- rc = roc_mcs_stats_clear(mcs, &stats);
- if (rc)
- return rc;
- }
- }
- for (i = 0; i < (priv->secy_entries << 1); i++) {
- set = plt_bitmap_get(priv->port_rsrc[port_id].secy_bmap, i);
- if (set) {
- stats.type = MCS_SECY_STATS;
- stats.id = i;
- stats.dir = MCS_RX;
- if (i >= priv->sa_entries) {
- stats.dir = MCS_TX;
- stats.id -= priv->secy_entries;
- }
- rc = roc_mcs_stats_clear(mcs, &stats);
- if (rc)
- return rc;
- }
- }
- for (i = 0; i < (priv->sc_entries << 1); i++) {
- set = plt_bitmap_get(priv->port_rsrc[port_id].sc_bmap, i);
- if (set) {
- stats.type = MCS_SC_STATS;
- stats.id = i;
- stats.dir = MCS_RX;
- if (i >= priv->sa_entries) {
- stats.dir = MCS_TX;
- stats.id -= priv->sc_entries;
- }
- rc = roc_mcs_stats_clear(mcs, &stats);
- if (rc)
- return rc;
- }
- }
- if (roc_model_is_cn10kb_a0()) {
- for (i = 0; i < (priv->sa_entries << 1); i++) {
- set = plt_bitmap_get(priv->port_rsrc[port_id].sa_bmap, i);
- if (set) {
- stats.type = MCS_SA_STATS;
- stats.id = i;
- stats.dir = MCS_RX;
- if (i >= priv->sa_entries) {
- stats.dir = MCS_TX;
- stats.id -= priv->sa_entries;
- }
- rc = roc_mcs_stats_clear(mcs, &stats);
- if (rc)
- return rc;
- }
- }
- }
- {
- stats.type = MCS_PORT_STATS;
- stats.id = port_id;
- rc = roc_mcs_stats_clear(mcs, &stats);
- if (rc)
- return rc;
- }
-
- if (rx_cnt) {
- mdata->rx_sc_array = plt_zmalloc(rx_cnt * sizeof(uint16_t), 0);
- if (mdata->rx_sc_array == NULL) {
- rc = -ENOMEM;
- goto exit;
- }
- mdata->sc_an_array = plt_zmalloc(rx_cnt * sizeof(uint8_t), 0);
- if (mdata->sc_an_array == NULL) {
- rc = -ENOMEM;
- goto exit;
- }
-
- mdata->num_rx_sc = rx_cnt;
- }
-
- /* Reactivate in-use ANs for active SCs in RX CPM */
- for (i = 0; i < priv->sc_entries; i++) {
- set = plt_bitmap_get(priv->port_rsrc[port_id].sc_bmap, i);
- if (set) {
- rx_map.sa_index = priv->port_rsrc[port_id].sc_conf[i].rx.sa_idx;
- rx_map.an = priv->port_rsrc[port_id].sc_conf[i].rx.an;
- rx_map.sa_in_use = 1;
- rx_map.sc_id = i;
- rc = roc_mcs_rx_sc_sa_map_write(mcs, &rx_map);
- if (rc)
- return rc;
-
- mdata->rx_sc_array[--rx_cnt] = i;
- mdata->sc_an_array[rx_cnt] = priv->port_rsrc[port_id].sc_conf[i].rx.an;
- }
- }
-
- port.port_id = port_id;
- rc = mcs_port_reset_set(mcs, &port, 0);
-
- return rc;
-exit:
- if (mdata->num_tx_sa)
- plt_free(mdata->tx_sa_array);
- if (mdata->num_rx_sa)
- plt_free(mdata->rx_sa_array);
- if (mdata->num_tx_sc)
- plt_free(mdata->tx_sc_array);
- if (mdata->num_rx_sc) {
- plt_free(mdata->rx_sc_array);
- plt_free(mdata->sc_an_array);
- }
- return rc;
-}
-
int
roc_mcs_event_cb_register(struct roc_mcs *mcs, enum roc_mcs_event_type event,
roc_mcs_dev_cb_fn cb_fn, void *cb_arg, void *userdata)
diff --git a/drivers/common/cnxk/roc_mcs.h b/drivers/common/cnxk/roc_mcs.h
index bba7b855e6..4db6137780 100644
--- a/drivers/common/cnxk/roc_mcs.h
+++ b/drivers/common/cnxk/roc_mcs.h
@@ -574,8 +574,6 @@ __roc_api int roc_mcs_event_cb_unregister(struct roc_mcs *mcs, enum roc_mcs_even
__roc_api int roc_mcs_intr_configure(struct roc_mcs *mcs, struct roc_mcs_intr_cfg *config);
/* Port recovery from fatal errors */
-int roc_mcs_port_recovery(struct roc_mcs *mcs, union roc_mcs_event_data *mdata,
- uint8_t port_id);
/* FIPS reset */
__roc_api int roc_mcs_fips_reset(struct roc_mcs *mcs, struct roc_mcs_fips_req *req);
--
2.53.0
next prev parent reply other threads:[~2026-11-29 20:54 UTC|newest]
Thread overview: 90+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 20:48 [PATCH 00/45] remove unused internal symbols and dead code Stephen Hemminger
2026-11-29 20:48 ` [PATCH 01/45] bus/vmbus: do not export unused internal symbol Stephen Hemminger
2026-11-29 20:48 ` [PATCH 02/45] bus/dpaa: remove exports for nonexistent symbols Stephen Hemminger
2026-11-29 20:48 ` [PATCH 03/45] ethdev: do not export internal dummy ops Stephen Hemminger
2026-11-29 20:48 ` [PATCH 04/45] hash: do not export internal toeplitz helper Stephen Hemminger
2026-11-29 20:48 ` [PATCH 05/45] cryptodev: do not export internal device name helper Stephen Hemminger
2026-11-29 20:48 ` [PATCH 06/45] mldev: do not export internal PMD device helpers Stephen Hemminger
2026-11-29 20:48 ` [PATCH 07/45] gpudev: do not export unused internal functions Stephen Hemminger
2026-11-29 20:48 ` [PATCH 08/45] eal/linux: do not export internal VFIO helpers Stephen Hemminger
2026-11-29 20:48 ` [PATCH 09/45] eal/linux: remove unused VFIO device number helper Stephen Hemminger
2026-11-29 20:48 ` [PATCH 10/45] eal: make per-thread epoll instance getter static Stephen Hemminger
2026-11-29 20:48 ` [PATCH 11/45] bus: do not export unused driver unregister functions Stephen Hemminger
2026-11-29 20:48 ` [PATCH 12/45] bus/fslmc: do not export internal symbols used only in the bus Stephen Hemminger
2026-11-29 20:48 ` [PATCH 13/45] bus/dpaa: " Stephen Hemminger
2026-11-29 20:48 ` [PATCH 14/45] common/dpaax: do not export IOVA table dump helper Stephen Hemminger
2026-11-29 20:49 ` [PATCH 15/45] net/nfb: do not export MDIO speed capability helper Stephen Hemminger
2026-11-30 9:56 ` Martin Spinler
2026-11-29 20:49 ` [PATCH 16/45] common/sxe2: do not export internal ioctl channel helpers Stephen Hemminger
2026-11-29 20:49 ` [PATCH 17/45] common/mlx5: do not export internal symbols used only in common code Stephen Hemminger
2026-11-30 10:50 ` Dariusz Sosnowski
2026-11-29 20:49 ` [PATCH 18/45] net/idpf: do not export internal symbols used only in the driver Stephen Hemminger
2026-11-29 20:49 ` [PATCH 19/45] net/iavf: do not export VF reset function Stephen Hemminger
2026-11-29 20:49 ` [PATCH 20/45] eal: do not export unused Windows interrupt handle accessors Stephen Hemminger
2026-11-29 20:49 ` [PATCH 21/45] common/cnxk: do not export internal symbols used only in roc Stephen Hemminger
2026-11-29 20:49 ` [PATCH 22/45] common/sfc_efx: do not export internal symbols unused outside base Stephen Hemminger
2026-11-29 20:49 ` [PATCH 23/45] crypto/cnxk: do not export internal Rx inject helpers Stephen Hemminger
2026-11-29 20:49 ` [PATCH 24/45] net/cnxk: do not export inline inbound mode setter Stephen Hemminger
2026-11-29 20:49 ` [PATCH 25/45] common/sfc_efx: remove unused libefx functions Stephen Hemminger
2026-11-29 20:49 ` [PATCH 26/45] common/cnxk: remove unused roc functions Stephen Hemminger
2026-11-29 20:49 ` [PATCH 27/45] common/mlx5: remove unused internal functions Stephen Hemminger
2026-11-30 10:51 ` Dariusz Sosnowski
2026-11-29 20:49 ` [PATCH 28/45] bus/fslmc: remove unused VFIO helpers Stephen Hemminger
2026-11-29 20:49 ` [PATCH 29/45] bus/dpaa: remove unused FMan and netcfg helpers Stephen Hemminger
2026-11-29 20:49 ` [PATCH 30/45] common/dpaax: remove unused IOVA table dump Stephen Hemminger
2026-11-29 20:49 ` [PATCH 31/45] net/idpf: remove unused queue enable helper Stephen Hemminger
2026-11-29 20:49 ` [PATCH 32/45] gpudev: remove unused attach function Stephen Hemminger
2026-11-29 20:49 ` [PATCH 33/45] cryptodev: remove unused device name helper Stephen Hemminger
2026-11-29 20:49 ` Stephen Hemminger [this message]
2026-11-29 20:49 ` [PATCH 35/45] bus/dpaa: remove unused QMan and BMan functions Stephen Hemminger
2026-11-29 20:49 ` [PATCH 36/45] bus/fslmc: remove unused MC object functions Stephen Hemminger
2026-11-29 20:49 ` [PATCH 37/45] eal: remove unused Windows interrupt handle accessors Stephen Hemminger
2026-11-29 20:49 ` [PATCH 38/45] common/sfc_efx: make efx_family static Stephen Hemminger
2026-11-29 20:49 ` [PATCH 39/45] gpudev: make event notify helper static Stephen Hemminger
2026-11-29 20:49 ` [PATCH 40/45] mldev: make device lookup " Stephen Hemminger
2026-11-29 20:49 ` [PATCH 41/45] bus/fslmc: make internal helpers static Stephen Hemminger
2026-11-29 20:49 ` [PATCH 42/45] net/cnxk: make inline inbound mode setter static Stephen Hemminger
2026-11-29 20:49 ` [PATCH 43/45] common/sxe2: make memory event callback static Stephen Hemminger
2026-11-29 20:49 ` [PATCH 44/45] net/idpf: make internal burst functions static Stephen Hemminger
2026-11-29 20:49 ` [PATCH 45/45] common/cnxk: make internal roc " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 00/38] enable unreachable code detection Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 01/38] net/mlx4: fix unreachable code warnings Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 02/38] net/mlx5: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 03/38] examples/ipsec-secgw: remove dead code Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 04/38] eventdev: fix vector adapter instance allocation Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 05/38] test/eal: skip filesystem test on FreeBSD Stephen Hemminger
2026-12-01 8:58 ` Bruce Richardson
2026-11-30 21:49 ` [PATCH v2 06/38] eal: silence unreachable code in version string Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 07/38] net/dpaa2: remove debug abort in flow destroy Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 08/38] app/testpmd: fix unreachable VF traffic error message Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 09/38] examples/eventdev_pipeline: remove dead continue Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 10/38] examples/skeleton: handle SIGINT and SIGTERM Stephen Hemminger
2026-12-01 8:59 ` Bruce Richardson
2026-11-30 21:49 ` [PATCH v2 11/38] examples/rxtx_callbacks: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 12/38] examples/service_cores: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 13/38] examples/timer: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 14/38] examples/multi_process: handle SIGINT and SIGTERM in client Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 15/38] examples/server_node_efd: handle SIGINT and SIGTERM in node Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 16/38] examples/pipeline: handle SIGINT and SIGTERM Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 17/38] ethdev: fix unreachable warnings from switch declarations Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 18/38] config: add per-directory option for -Wunreachable-code Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 19/38] bus/dpaa: exempt this driver from unreachable code detection Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 20/38] net/qede: disable unreachable code checks Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 21/38] net/txgbe: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 22/38] net/ixgbe: disable unreachable code check Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 23/38] net/ngbe: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 24/38] net/octeontx: replace unreachable code Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 25/38] common/sfc_efx: disable unreachable code check for base code Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 26/38] net/dpaa2: check port state before changing TM hierarchy Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 27/38] net/e1000: disable unreachable code check for base code Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 28/38] net/ice: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 29/38] raw/ifpga: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 30/38] net/bnxt: disable unreachable code check Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 31/38] net/ntnic: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 32/38] lib: mark never returning thread functions Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 33/38] lib: remove unreachable statements Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 34/38] app: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 35/38] examples: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 36/38] drivers: " Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 37/38] efd: mark configuration dependent vector selection Stephen Hemminger
2026-11-30 21:49 ` [PATCH v2 38/38] config: enable unreachable code detection Stephen Hemminger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261129205006.1440292-35-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=hkalra@marvell.com \
--cc=kirankumark@marvell.com \
--cc=ndabilpuram@marvell.com \
--cc=skori@marvell.com \
--cc=skoteshwar@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox