Skip to contentSkip to conversation

octeontx2: remove unneeded symbol exports

PATCH Applied Jakub Kicinski 5 participants 5 messages Sep 25 – Sep 30

Subsystems (4)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 octeontx2: remove unneeded symbol exports

octeontx2 has a bunch of symbols not used outside the module which defines them. Worse, still the macro which defines otx2_mbox_up_handler_* adds exports for all the functions. Remove all the explicit exports and the auto-export from that macro.

otx2_mbox_up_handler_cgx_link_event was exported by the macro and is genuienly called from the VF driver, so add an export.

---
cc: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]

---
 drivers/net/ethernet/marvell/octeontx2/af/cn20k/npa.c    | 1 -
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 8 +-------
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c  | 5 -----
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c  | 3 ---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c     | 2 +-
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c     | 1 -
 6 files changed, 2 insertions(+), 18 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/cn20k/npa.c +0 -1
index fe8f926c8b75..8ebbf844f155 100644
@@ -18,4 +18,3 @@ int rvu_mbox_handler_npa_cn20k_aq_enq(struct rvu *rvu,
 	return rvu_npa_aq_enq_inst(rvu, (struct npa_aq_enq_req *)req,
 				   (struct npa_aq_enq_rsp *)rsp);
 }
-EXPORT_SYMBOL(rvu_mbox_handler_npa_cn20k_aq_enq);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +1 -7
index 175992188c18..6e4ad26a663a 100644
@@ -732,7 +732,6 @@ int otx2_txschq_config(struct otx2_nic *pfvf, int lvl, int prio, bool txschq_for
 
 	return otx2_sync_mbox_msg(&pfvf->mbox);
 }
-EXPORT_SYMBOL(otx2_txschq_config);
 
 int otx2_smq_flush(struct otx2_nic *pfvf, int smq)
 {
@@ -756,7 +755,6 @@ int otx2_smq_flush(struct otx2_nic *pfvf, int smq)
 	mutex_unlock(&pfvf->mbox.lock);
 	return rc;
 }
-EXPORT_SYMBOL(otx2_smq_flush);
 
 int otx2_txsch_alloc(struct otx2_nic *pfvf)
 {
@@ -828,7 +826,6 @@ void otx2_txschq_free_one(struct otx2_nic *pfvf, u16 lvl, u16 schq)
 
 	mutex_unlock(&pfvf->mbox.lock);
 }
-EXPORT_SYMBOL(otx2_txschq_free_one);
 
 void otx2_txschq_stop(struct otx2_nic *pfvf)
 {
@@ -1838,7 +1835,6 @@ int otx2_nix_config_bp(struct otx2_nic *pfvf, bool enable)
 
 	return otx2_sync_mbox_msg(&pfvf->mbox);
 }
-EXPORT_SYMBOL(otx2_nix_config_bp);
 
 int otx2_nix_cpt_config_bp(struct otx2_nic *pfvf, bool enable)
 {
@@ -1863,7 +1859,6 @@ int otx2_nix_cpt_config_bp(struct otx2_nic *pfvf, bool enable)
 
 	return otx2_sync_mbox_msg(&pfvf->mbox);
 }
-EXPORT_SYMBOL(otx2_nix_cpt_config_bp);
 
 /* Mbox message handlers */
 void mbox_handler_cgx_stats(struct otx2_nic *pfvf,
@@ -2110,8 +2105,7 @@ otx2_mbox_up_handler_ ## _fn_name(struct otx2_nic *pfvf,		\
 {									\
 	/* Nothing to do here */					\
 	return 0;							\
-}									\
-EXPORT_SYMBOL(otx2_mbox_up_handler_ ## _fn_name);
+}
 MBOX_UP_CGX_MESSAGES
 MBOX_UP_MCS_MESSAGES
 #undef M
drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c +0 -5
index 91d346d114af..e3d54009180d 100644
@@ -54,7 +54,6 @@ int otx2_pfc_txschq_config(struct otx2_nic *pfvf)
 
 	return 0;
 }
-EXPORT_SYMBOL(otx2_pfc_txschq_config);
 
 static int otx2_pfc_txschq_alloc_one(struct otx2_nic *pfvf, u8 prio)
 {
@@ -123,7 +122,6 @@ int otx2_pfc_txschq_alloc(struct otx2_nic *pfvf)
 
 	return 0;
 }
-EXPORT_SYMBOL(otx2_pfc_txschq_alloc);
 
 static int otx2_pfc_txschq_stop_one(struct otx2_nic *pfvf, u8 prio)
 {
@@ -262,7 +260,6 @@ int otx2_pfc_txschq_update(struct otx2_nic *pfvf)
 
 	return 0;
 }
-EXPORT_SYMBOL(otx2_pfc_txschq_update);
 
 int otx2_pfc_txschq_stop(struct otx2_nic *pfvf)
 {
@@ -285,7 +282,6 @@ int otx2_pfc_txschq_stop(struct otx2_nic *pfvf)
 
 	return 0;
 }
-EXPORT_SYMBOL(otx2_pfc_txschq_stop);
 
 int otx2_config_priority_flow_ctrl(struct otx2_nic *pfvf)
 {
@@ -395,7 +391,6 @@ void otx2_update_bpid_in_rqctx(struct otx2_nic *pfvf, int vlan_prio, int qidx,
 			 "Updating BPIDs in CQ and Aura contexts of RQ%d failed with err %d\n",
 			 qidx, err);
 }
-EXPORT_SYMBOL(otx2_update_bpid_in_rqctx);
 
 static int otx2_dcbnl_ieee_getpfc(struct net_device *dev, struct ieee_pfc *pfc)
 {
drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c +0 -3
index 99d78fc5a2c4..6d095023d17b 100644
@@ -281,7 +281,6 @@ int otx2_alloc_mcam_entries(struct otx2_nic *pfvf, u16 count)
 			    count, allocated);
 	return allocated;
 }
-EXPORT_SYMBOL(otx2_alloc_mcam_entries);
 
 int otx2_mcam_entry_init(struct otx2_nic *pfvf)
 {
@@ -420,7 +419,6 @@ int otx2_mcam_entry_init(struct otx2_nic *pfvf)
 	refcount_set(&flow_cfg->mark_flows, 1);
 	return 0;
 }
-EXPORT_SYMBOL(otx2_mcam_entry_init);
 
 /* TODO : revisit on size */
 #define OTX2_DMAC_FLTR_BITMAP_SZ (4 * 2048 + 32)
@@ -654,7 +652,6 @@ int otx2_get_maxflows(struct otx2_flow_config *flow_cfg)
 	else
 		return flow_cfg->max_flows;
 }
-EXPORT_SYMBOL(otx2_get_maxflows);
 
 int otx2_get_flow(struct otx2_nic *pfvf, struct ethtool_rxnfc *nfc,
 		  u32 location)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +1 -1
index c0e2100de1d9..7dc0ce669d0b 100644
@@ -959,6 +959,7 @@ int otx2_mbox_up_handler_cgx_link_event(struct otx2_nic *pf,
 	otx2_handle_link_event(pf);
 	return 0;
 }
+EXPORT_SYMBOL(otx2_mbox_up_handler_cgx_link_event);
 
 static int otx2_process_mbox_msg_up(struct otx2_nic *pf,
 				    struct mbox_msghdr *req)
@@ -3102,7 +3103,6 @@ int otx2_realloc_msix_vectors(struct otx2_nic *pf)
 
 	return otx2_register_mbox_intr(pf, false);
 }
-EXPORT_SYMBOL(otx2_realloc_msix_vectors);
 
 static int otx2_sriov_vfcfg_init(struct otx2_nic *pf)
 {
drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c +0 -1
index 039fd47ebf52..dee38d5c7f65 100644
@@ -1675,4 +1675,3 @@ void otx2_tc_apply_ingress_police_rules(struct otx2_nic *nic)
 			otx2_tc_config_ingress_rule(nic, node);
 	}
 }
-EXPORT_SYMBOL(otx2_tc_apply_ingress_police_rules);
Signature · 1 line
2.55.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Jakub Kicinski

octeontx2 has a bunch of symbols not used outside the module which defines them. Worse, still the macro which defines otx2_mbox_up_handler_* adds exports for all the functions. Remove all the explicit exports and the auto-export from that macro.

otx2_mbox_up_handler_cgx_link_event was exported by the macro and is genuienly called from the VF driver, so add an export.

Looks good:

#2 lore raw
Quoted 32 lines

-----Original Message-----
From: Christoph Hellwig <[email protected]>
Sent: Monday, September 28, 2026 10:46 AM
To: Jakub Kicinski <[email protected]>
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Sunil Kovvuri Goutham <[email protected]>; Ratheesh Kannoth <[email protected]>; Geethasowjanya Akula <[email protected]>; Subbaraya Sundeep Bhatta <[email protected]>; Bharat Bhushan <[email protected]>; Linu Cherian <[email protected]>
Subject: [EXTERNAL] Re: [PATCH net-next] octeontx2: remove unneeded symbol exports

On Fri, Sep 25, 2026 at 01: 10: 42PM -0700, Jakub Kicinski wrote: > octeontx2 has a bunch of symbols not used outside the module which > defines them. Worse, still the macro which defines otx2_mbox_up_handler_* > adds exports for all ZjQcmQRYFpfptBannerStart Prioritize security for external emails:
Confirm sender and content safety before clicking links or opening attachments
<https://us-phishalarm-
ewt.proofpoint.com/EWT/v1/CRVmXkqW!tC3TvbSULN8QXI82c3J5woPk8U9GSgX _IImdOsjuS-wLTQVkWHRJomLR0GEOtLTcAXAidS3rNNjN$>
Report Suspicious

ZjQcmQRYFpfptBannerEnd

Quoted 5 lines · Jakub Kicinski

octeontx2 has a bunch of symbols not used outside the module which defines them. Worse, still the macro which defines otx2_mbox_up_handler_* adds exports for all the functions. Remove all the explicit exports and the auto-export from that macro.

Quoted 6 lines
Quoted 2 lines

otx2_mbox_up_handler_cgx_link_event was exported by the macro and is genuienly called from the VF driver, so add an export.

Looks good:

Thanks for the patch.
We will verify this on our side and respond by tomorrow.

Regards,
Sunil.

maintainer Tested-by on v1 1/1
#3 lore raw
In reply to Jakub Kicinski
Quoted 207 lines

-----Original Message-----
From: Jakub Kicinski <[email protected]>
Sent: Saturday, September 26, 2026 1:41 AM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Jakub Kicinski <[email protected]>; [email protected]; Sunil Kovvuri Goutham <[email protected]>; Ratheesh Kannoth <[email protected]>; Geethasowjanya Akula <[email protected]>; Subbaraya Sundeep Bhatta <[email protected]>; Bharat Bhushan <[email protected]>; Linu Cherian <[email protected]>
Subject: [EXTERNAL] [PATCH net-next] octeontx2: remove unneeded symbol exports

octeontx2 has a bunch of symbols not used outside the module which defines them. Worse, still the macro which defines otx2_mbox_up_handler_* adds exports for all the functions. Remove all the explicit exports and the auto- export from that macro.

otx2_mbox_up_handler_cgx_link_event was exported by the macro and is genuienly called from the VF driver, so add an export.

Link:
https://urldefense.com/v3/__https://lore.kernel.org/arYYTw8l90VNnKal@infra
dead.org__;!!CRVmXkqW!QDWaHkW3mCorD0r3DGd7L13uExouH8Qz06AT- 2bs1bko5FfLO4eqdtgiJKQR1x1i5BQEsZtpqMQ$

---
cc: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]
---

drivers/net/ethernet/marvell/octeontx2/af/cn20k/npa.c    | 1 -
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 8 +-------
drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c  | 5 -----
drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c  | 3 ---
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c     | 2 +-
drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c     | 1 -
6 files changed, 2 insertions(+), 18 deletions(-)
drivers/net/ethernet/marvell/octeontx2/af/cn20k/npa.c +0 -0
index fe8f926c8b75..8ebbf844f155 100644
@@ -18,4 +18,3 @@ int rvu_mbox_handler_npa_cn20k_aq_enq(struct rvu
 *rvu,
 	return rvu_npa_aq_enq_inst(rvu, (struct npa_aq_enq_req *)req,
 				   (struct npa_aq_enq_rsp *)rsp);

}

drivers/net/ethernet/marvell/octeontx2/af/cn20k/npa.c +0 -1
-EXPORT_SYMBOL(rvu_mbox_handler_npa_cn20k_aq_enq);
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +0 -0
index 175992188c18..6e4ad26a663a 100644
@@ -732,7 +732,6 @@ int otx2_txschq_config(struct otx2_nic *pfvf, int lvl, int

prio, bool txschq_for

	return otx2_sync_mbox_msg(&pfvf->mbox);  } -

EXPORT_SYMBOL(otx2_txschq_config);

int otx2_smq_flush(struct otx2_nic *pfvf, int smq) { @@ -756,7 +755,6 @@ int otx2_smq_flush(struct otx2_nic *pfvf, int smq)

	mutex_unlock(&pfvf->mbox.lock);
	return rc;
}

-EXPORT_SYMBOL(otx2_smq_flush);

int otx2_txsch_alloc(struct otx2_nic *pfvf) { @@ -828,7 +826,6 @@ void otx2_txschq_free_one(struct otx2_nic *pfvf, u16 lvl, u16 schq)

	mutex_unlock(&pfvf->mbox.lock);
}

-EXPORT_SYMBOL(otx2_txschq_free_one);

void otx2_txschq_stop(struct otx2_nic *pfvf) { @@ -1838,7 +1835,6 @@ int otx2_nix_config_bp(struct otx2_nic *pfvf, bool enable)

	return otx2_sync_mbox_msg(&pfvf->mbox);  } -

EXPORT_SYMBOL(otx2_nix_config_bp);

int otx2_nix_cpt_config_bp(struct otx2_nic *pfvf, bool enable) { @@ -1863,7 +1859,6 @@ int otx2_nix_cpt_config_bp(struct otx2_nic *pfvf, bool enable)

	return otx2_sync_mbox_msg(&pfvf->mbox);  } -

EXPORT_SYMBOL(otx2_nix_cpt_config_bp);

/* Mbox message handlers */
void mbox_handler_cgx_stats(struct otx2_nic *pfvf,

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c +1 -2
@@ -2110,8 +2105,7 @@ otx2_mbox_up_handler_ ## _fn_name(struct
 otx2_nic *pfvf,		\
 {									\
 	/* Nothing to do here */					\
 	return 0;							\
-}									\
-EXPORT_SYMBOL(otx2_mbox_up_handler_ ## _fn_name);
+}

MBOX_UP_CGX_MESSAGES
MBOX_UP_MCS_MESSAGES
#undef M

drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c +0 -1
index 91d346d114af..e3d54009180d 100644
@@ -54,7 +54,6 @@ int otx2_pfc_txschq_config(struct otx2_nic *pfvf)
 
 	return 0;
 }
-EXPORT_SYMBOL(otx2_pfc_txschq_config);
 

static int otx2_pfc_txschq_alloc_one(struct otx2_nic *pfvf, u8 prio) { @@ - 123,7 +122,6 @@ int otx2_pfc_txschq_alloc(struct otx2_nic *pfvf)

	return 0;
}

-EXPORT_SYMBOL(otx2_pfc_txschq_alloc);

static int otx2_pfc_txschq_stop_one(struct otx2_nic *pfvf, u8 prio) { @@ - 262,7 +260,6 @@ int otx2_pfc_txschq_update(struct otx2_nic *pfvf)

	return 0;
}

-EXPORT_SYMBOL(otx2_pfc_txschq_update);

int otx2_pfc_txschq_stop(struct otx2_nic *pfvf) { @@ -285,7 +282,6 @@ int otx2_pfc_txschq_stop(struct otx2_nic *pfvf)

	return 0;
}

-EXPORT_SYMBOL(otx2_pfc_txschq_stop);

int otx2_config_priority_flow_ctrl(struct otx2_nic *pfvf) { @@ -395,7 +391,6 @@ void otx2_update_bpid_in_rqctx(struct otx2_nic *pfvf, int vlan_prio, int qidx,
"Updating BPIDs in CQ and Aura contexts of RQ%d
failed with err %d\n",

			 qidx, err);
}

-EXPORT_SYMBOL(otx2_update_bpid_in_rqctx);

static int otx2_dcbnl_ieee_getpfc(struct net_device *dev, struct ieee_pfc *pfc) {

drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c +0 -1
index 99d78fc5a2c4..6d095023d17b 100644
@@ -281,7 +281,6 @@ int otx2_alloc_mcam_entries(struct otx2_nic *pfvf, u16
 count)
 			    count, allocated);
 	return allocated;
 }
-EXPORT_SYMBOL(otx2_alloc_mcam_entries);
 

int otx2_mcam_entry_init(struct otx2_nic *pfvf) { @@ -420,7 +419,6 @@ int otx2_mcam_entry_init(struct otx2_nic *pfvf)

	refcount_set(&flow_cfg->mark_flows, 1);
	return 0;
}

-EXPORT_SYMBOL(otx2_mcam_entry_init);

/* TODO : revisit on size */
#define OTX2_DMAC_FLTR_BITMAP_SZ (4 * 2048 + 32) @@ -654,7 +652,6 @@ int otx2_get_maxflows(struct otx2_flow_config *flow_cfg)

	else
		return flow_cfg->max_flows;
}

-EXPORT_SYMBOL(otx2_get_maxflows);

int otx2_get_flow(struct otx2_nic *pfvf, struct ethtool_rxnfc *nfc,
u32 location)

drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +1 -0
index c0e2100de1d9..7dc0ce669d0b 100644
@@ -959,6 +959,7 @@ int otx2_mbox_up_handler_cgx_link_event(struct
 otx2_nic *pf,
 	otx2_handle_link_event(pf);
 	return 0;
 }
+EXPORT_SYMBOL(otx2_mbox_up_handler_cgx_link_event);
 
 static int otx2_process_mbox_msg_up(struct otx2_nic *pf,

struct mbox_msghdr *req)

drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +0 -0
@@ -3102,7 +3103,6 @@ int otx2_realloc_msix_vectors(struct otx2_nic *pf)
 
 	return otx2_register_mbox_intr(pf, false);  } -
 EXPORT_SYMBOL(otx2_realloc_msix_vectors);
 

static int otx2_sriov_vfcfg_init(struct otx2_nic *pf) { diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c index 039fd47ebf52..dee38d5c7f65 100644

drivers/net/ethernet/marvell/octeontx2/nic/otx2_tc.c +0 -0
@@ -1675,4 +1675,3 @@ void otx2_tc_apply_ingress_police_rules(struct
 otx2_nic *nic)
 			otx2_tc_config_ingress_rule(nic, node);
 	}
Quoted 4 lines

} -EXPORT_SYMBOL(otx2_tc_apply_ingress_police_rules); --
2.55.0

#4 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:

Quoted 9 lines · On Fri, 25 Sep 2026 13:10:42 -0700 you wrote:

octeontx2 has a bunch of symbols not used outside the module which defines them. Worse, still the macro which defines otx2_mbox_up_handler_* adds exports for all the functions. Remove all the explicit exports and the auto-export from that macro.

otx2_mbox_up_handler_cgx_link_event was exported by the macro and is genuienly called from the VF driver, so add an export.

[...]

Here is the summary with links:
- [net-next] octeontx2: remove unneeded symbol exports

    https://git.kernel.org/netdev/net-next/c/3e6a0e83c913

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html