netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] A pile of sfc deadcode
@ 2024-11-02 15:16 linux
  2024-11-02 15:16 ` [PATCH net-next 1/4] sfc: Remove falcon deadcode linux
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: linux @ 2024-11-02 15:16 UTC (permalink / raw)
  To: ecree.xilinx, habetsm.xilinx, andrew+netdev, davem, edumazet,
	kuba, pabeni
  Cc: netdev, linux-net-drivers, linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

This is a collection of deadcode removal in the sfc
drivers;  the split is vaguely where I found them in
the tree, with some left over.

This has been build tested and booted on an x86 VM,
but I fon't have the hardware to test; however
it's all full function removal.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>


Dr. David Alan Gilbert (4):
  sfc: Remove falcon deadcode
  sfc: Remove unused efx_mae_mport_vf
  sfc: Remove unused mcdi functions
  sfc: Remove more unused functions

 drivers/net/ethernet/sfc/efx.c          |  8 ---
 drivers/net/ethernet/sfc/efx.h          |  1 -
 drivers/net/ethernet/sfc/efx_common.c   | 16 ------
 drivers/net/ethernet/sfc/efx_common.h   |  1 -
 drivers/net/ethernet/sfc/falcon/efx.c   |  8 ---
 drivers/net/ethernet/sfc/falcon/efx.h   |  1 -
 drivers/net/ethernet/sfc/falcon/farch.c | 22 -------
 drivers/net/ethernet/sfc/falcon/nic.c   | 11 ----
 drivers/net/ethernet/sfc/falcon/nic.h   |  5 --
 drivers/net/ethernet/sfc/falcon/tx.c    |  8 ---
 drivers/net/ethernet/sfc/falcon/tx.h    |  3 -
 drivers/net/ethernet/sfc/mae.c          | 11 ----
 drivers/net/ethernet/sfc/mae.h          |  1 -
 drivers/net/ethernet/sfc/mcdi.c         | 76 -------------------------
 drivers/net/ethernet/sfc/mcdi.h         | 10 ----
 drivers/net/ethernet/sfc/ptp.c          |  5 --
 drivers/net/ethernet/sfc/ptp.h          |  1 -
 drivers/net/ethernet/sfc/tx.c           |  8 ---
 drivers/net/ethernet/sfc/tx.h           |  3 -
 19 files changed, 199 deletions(-)

-- 
2.47.0


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH net-next 1/4] sfc: Remove falcon deadcode
  2024-11-02 15:16 [PATCH net-next 0/4] A pile of sfc deadcode linux
@ 2024-11-02 15:16 ` linux
  2024-11-05  9:24   ` Martin Habets
  2024-11-02 15:16 ` [PATCH net-next 2/4] sfc: Remove unused efx_mae_mport_vf linux
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: linux @ 2024-11-02 15:16 UTC (permalink / raw)
  To: ecree.xilinx, habetsm.xilinx, andrew+netdev, davem, edumazet,
	kuba, pabeni
  Cc: netdev, linux-net-drivers, linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

ef4_farch_dimension_resources(), ef4_nic_fix_nodesc_drop_stat(),
ef4_ticks_to_usecs() and ef4_tx_get_copy_buffer_limited() were
copied over from efx_ equivalents in 2016 but never used by
commit 5a6681e22c14 ("sfc: separate out SFC4000 ("Falcon") support into new
sfc-falcon driver")

EF4_MAX_FLUSH_TIME is also unused.

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/net/ethernet/sfc/falcon/efx.c   |  8 --------
 drivers/net/ethernet/sfc/falcon/efx.h   |  1 -
 drivers/net/ethernet/sfc/falcon/farch.c | 22 ----------------------
 drivers/net/ethernet/sfc/falcon/nic.c   | 11 -----------
 drivers/net/ethernet/sfc/falcon/nic.h   |  5 -----
 drivers/net/ethernet/sfc/falcon/tx.c    |  8 --------
 drivers/net/ethernet/sfc/falcon/tx.h    |  3 ---
 7 files changed, 58 deletions(-)

diff --git a/drivers/net/ethernet/sfc/falcon/efx.c b/drivers/net/ethernet/sfc/falcon/efx.c
index 8925745f1c17..b07f7e4e2877 100644
--- a/drivers/net/ethernet/sfc/falcon/efx.c
+++ b/drivers/net/ethernet/sfc/falcon/efx.c
@@ -1886,14 +1886,6 @@ unsigned int ef4_usecs_to_ticks(struct ef4_nic *efx, unsigned int usecs)
 	return usecs * 1000 / efx->timer_quantum_ns;
 }
 
-unsigned int ef4_ticks_to_usecs(struct ef4_nic *efx, unsigned int ticks)
-{
-	/* We must round up when converting ticks to microseconds
-	 * because we round down when converting the other way.
-	 */
-	return DIV_ROUND_UP(ticks * efx->timer_quantum_ns, 1000);
-}
-
 /* Set interrupt moderation parameters */
 int ef4_init_irq_moderation(struct ef4_nic *efx, unsigned int tx_usecs,
 			    unsigned int rx_usecs, bool rx_adaptive,
diff --git a/drivers/net/ethernet/sfc/falcon/efx.h b/drivers/net/ethernet/sfc/falcon/efx.h
index d3b4646545fa..52508f2c8cb2 100644
--- a/drivers/net/ethernet/sfc/falcon/efx.h
+++ b/drivers/net/ethernet/sfc/falcon/efx.h
@@ -198,7 +198,6 @@ int ef4_try_recovery(struct ef4_nic *efx);
 /* Global */
 void ef4_schedule_reset(struct ef4_nic *efx, enum reset_type type);
 unsigned int ef4_usecs_to_ticks(struct ef4_nic *efx, unsigned int usecs);
-unsigned int ef4_ticks_to_usecs(struct ef4_nic *efx, unsigned int ticks);
 int ef4_init_irq_moderation(struct ef4_nic *efx, unsigned int tx_usecs,
 			    unsigned int rx_usecs, bool rx_adaptive,
 			    bool rx_may_override_tx);
diff --git a/drivers/net/ethernet/sfc/falcon/farch.c b/drivers/net/ethernet/sfc/falcon/farch.c
index c64623c2e80c..01017c41338e 100644
--- a/drivers/net/ethernet/sfc/falcon/farch.c
+++ b/drivers/net/ethernet/sfc/falcon/farch.c
@@ -1631,28 +1631,6 @@ void ef4_farch_rx_push_indir_table(struct ef4_nic *efx)
 	}
 }
 
-/* Looks at available SRAM resources and works out how many queues we
- * can support, and where things like descriptor caches should live.
- *
- * SRAM is split up as follows:
- * 0                          buftbl entries for channels
- * efx->vf_buftbl_base        buftbl entries for SR-IOV
- * efx->rx_dc_base            RX descriptor caches
- * efx->tx_dc_base            TX descriptor caches
- */
-void ef4_farch_dimension_resources(struct ef4_nic *efx, unsigned sram_lim_qw)
-{
-	unsigned vi_count;
-
-	/* Account for the buffer table entries backing the datapath channels
-	 * and the descriptor caches for those channels.
-	 */
-	vi_count = max(efx->n_channels, efx->n_tx_channels * EF4_TXQ_TYPES);
-
-	efx->tx_dc_base = sram_lim_qw - vi_count * TX_DC_ENTRIES;
-	efx->rx_dc_base = efx->tx_dc_base - vi_count * RX_DC_ENTRIES;
-}
-
 u32 ef4_farch_fpga_ver(struct ef4_nic *efx)
 {
 	ef4_oword_t altera_build;
diff --git a/drivers/net/ethernet/sfc/falcon/nic.c b/drivers/net/ethernet/sfc/falcon/nic.c
index 78c851b5a56f..1b91992e3698 100644
--- a/drivers/net/ethernet/sfc/falcon/nic.c
+++ b/drivers/net/ethernet/sfc/falcon/nic.c
@@ -511,14 +511,3 @@ void ef4_nic_update_stats(const struct ef4_hw_stat_desc *desc, size_t count,
 		}
 	}
 }
-
-void ef4_nic_fix_nodesc_drop_stat(struct ef4_nic *efx, u64 *rx_nodesc_drops)
-{
-	/* if down, or this is the first update after coming up */
-	if (!(efx->net_dev->flags & IFF_UP) || !efx->rx_nodesc_drops_prev_state)
-		efx->rx_nodesc_drops_while_down +=
-			*rx_nodesc_drops - efx->rx_nodesc_drops_total;
-	efx->rx_nodesc_drops_total = *rx_nodesc_drops;
-	efx->rx_nodesc_drops_prev_state = !!(efx->net_dev->flags & IFF_UP);
-	*rx_nodesc_drops -= efx->rx_nodesc_drops_while_down;
-}
diff --git a/drivers/net/ethernet/sfc/falcon/nic.h b/drivers/net/ethernet/sfc/falcon/nic.h
index ada6e036fd97..ac10c12967df 100644
--- a/drivers/net/ethernet/sfc/falcon/nic.h
+++ b/drivers/net/ethernet/sfc/falcon/nic.h
@@ -477,7 +477,6 @@ void ef4_farch_finish_flr(struct ef4_nic *efx);
 void falcon_start_nic_stats(struct ef4_nic *efx);
 void falcon_stop_nic_stats(struct ef4_nic *efx);
 int falcon_reset_xaui(struct ef4_nic *efx);
-void ef4_farch_dimension_resources(struct ef4_nic *efx, unsigned sram_lim_qw);
 void ef4_farch_init_common(struct ef4_nic *efx);
 void ef4_farch_rx_push_indir_table(struct ef4_nic *efx);
 
@@ -502,10 +501,6 @@ size_t ef4_nic_describe_stats(const struct ef4_hw_stat_desc *desc, size_t count,
 void ef4_nic_update_stats(const struct ef4_hw_stat_desc *desc, size_t count,
 			  const unsigned long *mask, u64 *stats,
 			  const void *dma_buf, bool accumulate);
-void ef4_nic_fix_nodesc_drop_stat(struct ef4_nic *efx, u64 *stat);
-
-#define EF4_MAX_FLUSH_TIME 5000
-
 void ef4_farch_generate_event(struct ef4_nic *efx, unsigned int evq,
 			      ef4_qword_t *event);
 
diff --git a/drivers/net/ethernet/sfc/falcon/tx.c b/drivers/net/ethernet/sfc/falcon/tx.c
index b9369483758c..e6e80b039ca2 100644
--- a/drivers/net/ethernet/sfc/falcon/tx.c
+++ b/drivers/net/ethernet/sfc/falcon/tx.c
@@ -40,14 +40,6 @@ static inline u8 *ef4_tx_get_copy_buffer(struct ef4_tx_queue *tx_queue,
 	return (u8 *)page_buf->addr + offset;
 }
 
-u8 *ef4_tx_get_copy_buffer_limited(struct ef4_tx_queue *tx_queue,
-				   struct ef4_tx_buffer *buffer, size_t len)
-{
-	if (len > EF4_TX_CB_SIZE)
-		return NULL;
-	return ef4_tx_get_copy_buffer(tx_queue, buffer);
-}
-
 static void ef4_dequeue_buffer(struct ef4_tx_queue *tx_queue,
 			       struct ef4_tx_buffer *buffer,
 			       unsigned int *pkts_compl,
diff --git a/drivers/net/ethernet/sfc/falcon/tx.h b/drivers/net/ethernet/sfc/falcon/tx.h
index 2a88c59cbbbe..868ed8a861ab 100644
--- a/drivers/net/ethernet/sfc/falcon/tx.h
+++ b/drivers/net/ethernet/sfc/falcon/tx.h
@@ -15,9 +15,6 @@
 unsigned int ef4_tx_limit_len(struct ef4_tx_queue *tx_queue,
 			      dma_addr_t dma_addr, unsigned int len);
 
-u8 *ef4_tx_get_copy_buffer_limited(struct ef4_tx_queue *tx_queue,
-				   struct ef4_tx_buffer *buffer, size_t len);
-
 int ef4_enqueue_skb_tso(struct ef4_tx_queue *tx_queue, struct sk_buff *skb,
 			bool *data_mapped);
 
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next 2/4] sfc: Remove unused efx_mae_mport_vf
  2024-11-02 15:16 [PATCH net-next 0/4] A pile of sfc deadcode linux
  2024-11-02 15:16 ` [PATCH net-next 1/4] sfc: Remove falcon deadcode linux
@ 2024-11-02 15:16 ` linux
  2024-11-05  9:28   ` Martin Habets
  2024-11-02 15:16 ` [PATCH net-next 3/4] sfc: Remove unused mcdi functions linux
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: linux @ 2024-11-02 15:16 UTC (permalink / raw)
  To: ecree.xilinx, habetsm.xilinx, andrew+netdev, davem, edumazet,
	kuba, pabeni
  Cc: netdev, linux-net-drivers, linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

efx_mae_mport_vf() has been unused since
commit 5227adff37af ("sfc: add mport lookup based on driver's mport data")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/net/ethernet/sfc/mae.c | 11 -----------
 drivers/net/ethernet/sfc/mae.h |  1 -
 2 files changed, 12 deletions(-)

diff --git a/drivers/net/ethernet/sfc/mae.c b/drivers/net/ethernet/sfc/mae.c
index 10709d828a63..50f097487b14 100644
--- a/drivers/net/ethernet/sfc/mae.c
+++ b/drivers/net/ethernet/sfc/mae.c
@@ -76,17 +76,6 @@ void efx_mae_mport_uplink(struct efx_nic *efx __always_unused, u32 *out)
 	*out = EFX_DWORD_VAL(mport);
 }
 
-void efx_mae_mport_vf(struct efx_nic *efx __always_unused, u32 vf_id, u32 *out)
-{
-	efx_dword_t mport;
-
-	EFX_POPULATE_DWORD_3(mport,
-			     MAE_MPORT_SELECTOR_TYPE, MAE_MPORT_SELECTOR_TYPE_FUNC,
-			     MAE_MPORT_SELECTOR_FUNC_PF_ID, MAE_MPORT_SELECTOR_FUNC_PF_ID_CALLER,
-			     MAE_MPORT_SELECTOR_FUNC_VF_ID, vf_id);
-	*out = EFX_DWORD_VAL(mport);
-}
-
 /* Constructs an mport selector from an mport ID, because they're not the same */
 void efx_mae_mport_mport(struct efx_nic *efx __always_unused, u32 mport_id, u32 *out)
 {
diff --git a/drivers/net/ethernet/sfc/mae.h b/drivers/net/ethernet/sfc/mae.h
index 8df30bc4f3ba..db79912c86d8 100644
--- a/drivers/net/ethernet/sfc/mae.h
+++ b/drivers/net/ethernet/sfc/mae.h
@@ -23,7 +23,6 @@ int efx_mae_free_mport(struct efx_nic *efx, u32 id);
 
 void efx_mae_mport_wire(struct efx_nic *efx, u32 *out);
 void efx_mae_mport_uplink(struct efx_nic *efx, u32 *out);
-void efx_mae_mport_vf(struct efx_nic *efx, u32 vf_id, u32 *out);
 void efx_mae_mport_mport(struct efx_nic *efx, u32 mport_id, u32 *out);
 
 int efx_mae_lookup_mport(struct efx_nic *efx, u32 selector, u32 *id);
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next 3/4] sfc: Remove unused mcdi functions
  2024-11-02 15:16 [PATCH net-next 0/4] A pile of sfc deadcode linux
  2024-11-02 15:16 ` [PATCH net-next 1/4] sfc: Remove falcon deadcode linux
  2024-11-02 15:16 ` [PATCH net-next 2/4] sfc: Remove unused efx_mae_mport_vf linux
@ 2024-11-02 15:16 ` linux
  2024-11-05  9:33   ` Martin Habets
  2024-11-02 15:16 ` [PATCH net-next 4/4] sfc: Remove more unused functions linux
  2024-11-06  1:40 ` [PATCH net-next 0/4] A pile of sfc deadcode patchwork-bot+netdevbpf
  4 siblings, 1 reply; 10+ messages in thread
From: linux @ 2024-11-02 15:16 UTC (permalink / raw)
  To: ecree.xilinx, habetsm.xilinx, andrew+netdev, davem, edumazet,
	kuba, pabeni
  Cc: netdev, linux-net-drivers, linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

efx_mcdi_flush_rxqs(), efx_mcdi_rpc_async_quiet(),
efx_mcdi_rpc_finish_quiet(), and efx_mcdi_wol_filter_get_magic()
are unused.
I think these are fall out from the split into Siena
that happened in
commit 4d49e5cd4b09 ("sfc/siena: Rename functions in mcdi headers to avoid
conflicts with sfc")
and
commit d48523cb88e0 ("sfc: Copy shared files needed for Siena (part 2)")

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/net/ethernet/sfc/mcdi.c | 76 ---------------------------------
 drivers/net/ethernet/sfc/mcdi.h | 10 -----
 2 files changed, 86 deletions(-)

diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c
index 76578502226e..d461b1a6ce81 100644
--- a/drivers/net/ethernet/sfc/mcdi.c
+++ b/drivers/net/ethernet/sfc/mcdi.c
@@ -1051,15 +1051,6 @@ efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd,
 				   cookie, false);
 }
 
-int efx_mcdi_rpc_async_quiet(struct efx_nic *efx, unsigned int cmd,
-			     const efx_dword_t *inbuf, size_t inlen,
-			     size_t outlen, efx_mcdi_async_completer *complete,
-			     unsigned long cookie)
-{
-	return _efx_mcdi_rpc_async(efx, cmd, inbuf, inlen, outlen, complete,
-				   cookie, true);
-}
-
 int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen,
 			efx_dword_t *outbuf, size_t outlen,
 			size_t *outlen_actual)
@@ -1068,14 +1059,6 @@ int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen,
 				    outlen_actual, false, NULL, NULL);
 }
 
-int efx_mcdi_rpc_finish_quiet(struct efx_nic *efx, unsigned cmd, size_t inlen,
-			      efx_dword_t *outbuf, size_t outlen,
-			      size_t *outlen_actual)
-{
-	return _efx_mcdi_rpc_finish(efx, cmd, inlen, outbuf, outlen,
-				    outlen_actual, true, NULL, NULL);
-}
-
 void efx_mcdi_display_error(struct efx_nic *efx, unsigned cmd,
 			    size_t inlen, efx_dword_t *outbuf,
 			    size_t outlen, int rc)
@@ -1982,33 +1965,6 @@ efx_mcdi_wol_filter_set_magic(struct efx_nic *efx,  const u8 *mac, int *id_out)
 }
 
 
-int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out)
-{
-	MCDI_DECLARE_BUF(outbuf, MC_CMD_WOL_FILTER_GET_OUT_LEN);
-	size_t outlen;
-	int rc;
-
-	rc = efx_mcdi_rpc(efx, MC_CMD_WOL_FILTER_GET, NULL, 0,
-			  outbuf, sizeof(outbuf), &outlen);
-	if (rc)
-		goto fail;
-
-	if (outlen < MC_CMD_WOL_FILTER_GET_OUT_LEN) {
-		rc = -EIO;
-		goto fail;
-	}
-
-	*id_out = (int)MCDI_DWORD(outbuf, WOL_FILTER_GET_OUT_FILTER_ID);
-
-	return 0;
-
-fail:
-	*id_out = -1;
-	netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc);
-	return rc;
-}
-
-
 int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id)
 {
 	MCDI_DECLARE_BUF(inbuf, MC_CMD_WOL_FILTER_REMOVE_IN_LEN);
@@ -2021,38 +1977,6 @@ int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id)
 	return rc;
 }
 
-int efx_mcdi_flush_rxqs(struct efx_nic *efx)
-{
-	struct efx_channel *channel;
-	struct efx_rx_queue *rx_queue;
-	MCDI_DECLARE_BUF(inbuf,
-			 MC_CMD_FLUSH_RX_QUEUES_IN_LEN(EFX_MAX_CHANNELS));
-	int rc, count;
-
-	BUILD_BUG_ON(EFX_MAX_CHANNELS >
-		     MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_MAXNUM);
-
-	count = 0;
-	efx_for_each_channel(channel, efx) {
-		efx_for_each_channel_rx_queue(rx_queue, channel) {
-			if (rx_queue->flush_pending) {
-				rx_queue->flush_pending = false;
-				atomic_dec(&efx->rxq_flush_pending);
-				MCDI_SET_ARRAY_DWORD(
-					inbuf, FLUSH_RX_QUEUES_IN_QID_OFST,
-					count, efx_rx_queue_index(rx_queue));
-				count++;
-			}
-		}
-	}
-
-	rc = efx_mcdi_rpc(efx, MC_CMD_FLUSH_RX_QUEUES, inbuf,
-			  MC_CMD_FLUSH_RX_QUEUES_IN_LEN(count), NULL, 0, NULL);
-	WARN_ON(rc < 0);
-
-	return rc;
-}
-
 int efx_mcdi_wol_filter_reset(struct efx_nic *efx)
 {
 	int rc;
diff --git a/drivers/net/ethernet/sfc/mcdi.h b/drivers/net/ethernet/sfc/mcdi.h
index ea612c619874..cdb17d7c147f 100644
--- a/drivers/net/ethernet/sfc/mcdi.h
+++ b/drivers/net/ethernet/sfc/mcdi.h
@@ -155,9 +155,6 @@ int efx_mcdi_rpc_start(struct efx_nic *efx, unsigned cmd,
 int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen,
 			efx_dword_t *outbuf, size_t outlen,
 			size_t *outlen_actual);
-int efx_mcdi_rpc_finish_quiet(struct efx_nic *efx, unsigned cmd,
-			      size_t inlen, efx_dword_t *outbuf,
-			      size_t outlen, size_t *outlen_actual);
 
 typedef void efx_mcdi_async_completer(struct efx_nic *efx,
 				      unsigned long cookie, int rc,
@@ -167,11 +164,6 @@ int efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd,
 		       const efx_dword_t *inbuf, size_t inlen, size_t outlen,
 		       efx_mcdi_async_completer *complete,
 		       unsigned long cookie);
-int efx_mcdi_rpc_async_quiet(struct efx_nic *efx, unsigned int cmd,
-			     const efx_dword_t *inbuf, size_t inlen,
-			     size_t outlen,
-			     efx_mcdi_async_completer *complete,
-			     unsigned long cookie);
 
 void efx_mcdi_display_error(struct efx_nic *efx, unsigned cmd,
 			    size_t inlen, efx_dword_t *outbuf,
@@ -410,10 +402,8 @@ int efx_mcdi_handle_assertion(struct efx_nic *efx);
 int efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode);
 int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx, const u8 *mac,
 				  int *id_out);
-int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out);
 int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id);
 int efx_mcdi_wol_filter_reset(struct efx_nic *efx);
-int efx_mcdi_flush_rxqs(struct efx_nic *efx);
 void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev);
 void efx_mcdi_mac_start_stats(struct efx_nic *efx);
 void efx_mcdi_mac_stop_stats(struct efx_nic *efx);
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH net-next 4/4] sfc: Remove more unused functions
  2024-11-02 15:16 [PATCH net-next 0/4] A pile of sfc deadcode linux
                   ` (2 preceding siblings ...)
  2024-11-02 15:16 ` [PATCH net-next 3/4] sfc: Remove unused mcdi functions linux
@ 2024-11-02 15:16 ` linux
  2024-11-05  9:41   ` Martin Habets
  2024-11-06  1:40 ` [PATCH net-next 0/4] A pile of sfc deadcode patchwork-bot+netdevbpf
  4 siblings, 1 reply; 10+ messages in thread
From: linux @ 2024-11-02 15:16 UTC (permalink / raw)
  To: ecree.xilinx, habetsm.xilinx, andrew+netdev, davem, edumazet,
	kuba, pabeni
  Cc: netdev, linux-net-drivers, linux-kernel, Dr. David Alan Gilbert

From: "Dr. David Alan Gilbert" <linux@treblig.org>

efx_ticks_to_usecs(), efx_reconfigure_port(), efx_ptp_get_mode(), and
efx_tx_get_copy_buffer_limited() are unused.
They seem to be partially due to the later splits to Siena, but
some seem unused for longer.

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/net/ethernet/sfc/efx.c        |  8 --------
 drivers/net/ethernet/sfc/efx.h        |  1 -
 drivers/net/ethernet/sfc/efx_common.c | 16 ----------------
 drivers/net/ethernet/sfc/efx_common.h |  1 -
 drivers/net/ethernet/sfc/ptp.c        |  5 -----
 drivers/net/ethernet/sfc/ptp.h        |  1 -
 drivers/net/ethernet/sfc/tx.c         |  8 --------
 drivers/net/ethernet/sfc/tx.h         |  3 ---
 8 files changed, 43 deletions(-)

diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 36b3b57e2055..0382ac30d1aa 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -417,14 +417,6 @@ unsigned int efx_usecs_to_ticks(struct efx_nic *efx, unsigned int usecs)
 	return usecs * 1000 / efx->timer_quantum_ns;
 }
 
-unsigned int efx_ticks_to_usecs(struct efx_nic *efx, unsigned int ticks)
-{
-	/* We must round up when converting ticks to microseconds
-	 * because we round down when converting the other way.
-	 */
-	return DIV_ROUND_UP(ticks * efx->timer_quantum_ns, 1000);
-}
-
 /* Set interrupt moderation parameters */
 int efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs,
 			    unsigned int rx_usecs, bool rx_adaptive,
diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h
index 7a6cab883d66..45e191686625 100644
--- a/drivers/net/ethernet/sfc/efx.h
+++ b/drivers/net/ethernet/sfc/efx.h
@@ -168,7 +168,6 @@ extern const struct ethtool_ops efx_ethtool_ops;
 
 /* Global */
 unsigned int efx_usecs_to_ticks(struct efx_nic *efx, unsigned int usecs);
-unsigned int efx_ticks_to_usecs(struct efx_nic *efx, unsigned int ticks);
 int efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs,
 			    unsigned int rx_usecs, bool rx_adaptive,
 			    bool rx_may_override_tx);
diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c
index 13cf647051af..c88ec3e24836 100644
--- a/drivers/net/ethernet/sfc/efx_common.c
+++ b/drivers/net/ethernet/sfc/efx_common.c
@@ -635,22 +635,6 @@ int __efx_reconfigure_port(struct efx_nic *efx)
 	return rc;
 }
 
-/* Reinitialise the MAC to pick up new PHY settings, even if the port is
- * disabled.
- */
-int efx_reconfigure_port(struct efx_nic *efx)
-{
-	int rc;
-
-	EFX_ASSERT_RESET_SERIALISED(efx);
-
-	mutex_lock(&efx->mac_lock);
-	rc = __efx_reconfigure_port(efx);
-	mutex_unlock(&efx->mac_lock);
-
-	return rc;
-}
-
 /**************************************************************************
  *
  * Device reset and suspend
diff --git a/drivers/net/ethernet/sfc/efx_common.h b/drivers/net/ethernet/sfc/efx_common.h
index 2c54dac3e662..19a8ca530969 100644
--- a/drivers/net/ethernet/sfc/efx_common.h
+++ b/drivers/net/ethernet/sfc/efx_common.h
@@ -40,7 +40,6 @@ void efx_destroy_reset_workqueue(void);
 void efx_start_monitor(struct efx_nic *efx);
 
 int __efx_reconfigure_port(struct efx_nic *efx);
-int efx_reconfigure_port(struct efx_nic *efx);
 
 #define EFX_ASSERT_RESET_SERIALISED(efx)				\
 	do {								\
diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
index aaacdcfa54ae..36bceeeb6483 100644
--- a/drivers/net/ethernet/sfc/ptp.c
+++ b/drivers/net/ethernet/sfc/ptp.c
@@ -1800,11 +1800,6 @@ int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb)
 	return NETDEV_TX_OK;
 }
 
-int efx_ptp_get_mode(struct efx_nic *efx)
-{
-	return efx->ptp_data->mode;
-}
-
 int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
 			unsigned int new_mode)
 {
diff --git a/drivers/net/ethernet/sfc/ptp.h b/drivers/net/ethernet/sfc/ptp.h
index 6946203499ef..feab7bdd7889 100644
--- a/drivers/net/ethernet/sfc/ptp.h
+++ b/drivers/net/ethernet/sfc/ptp.h
@@ -26,7 +26,6 @@ int efx_ptp_get_ts_config(struct efx_nic *efx,
 void efx_ptp_get_ts_info(struct efx_nic *efx,
 			 struct kernel_ethtool_ts_info *ts_info);
 bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
-int efx_ptp_get_mode(struct efx_nic *efx);
 int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
 			unsigned int new_mode);
 int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
index fe2d476028e7..6b4a343a455d 100644
--- a/drivers/net/ethernet/sfc/tx.c
+++ b/drivers/net/ethernet/sfc/tx.c
@@ -49,14 +49,6 @@ static inline u8 *efx_tx_get_copy_buffer(struct efx_tx_queue *tx_queue,
 	return (u8 *)page_buf->addr + offset;
 }
 
-u8 *efx_tx_get_copy_buffer_limited(struct efx_tx_queue *tx_queue,
-				   struct efx_tx_buffer *buffer, size_t len)
-{
-	if (len > EFX_TX_CB_SIZE)
-		return NULL;
-	return efx_tx_get_copy_buffer(tx_queue, buffer);
-}
-
 static void efx_tx_maybe_stop_queue(struct efx_tx_queue *txq1)
 {
 	/* We need to consider all queues that the net core sees as one */
diff --git a/drivers/net/ethernet/sfc/tx.h b/drivers/net/ethernet/sfc/tx.h
index f2c4d2f89919..f882749af8c3 100644
--- a/drivers/net/ethernet/sfc/tx.h
+++ b/drivers/net/ethernet/sfc/tx.h
@@ -15,9 +15,6 @@
 unsigned int efx_tx_limit_len(struct efx_tx_queue *tx_queue,
 			      dma_addr_t dma_addr, unsigned int len);
 
-u8 *efx_tx_get_copy_buffer_limited(struct efx_tx_queue *tx_queue,
-				   struct efx_tx_buffer *buffer, size_t len);
-
 /* What TXQ type will satisfy the checksum offloads required for this skb? */
 static inline unsigned int efx_tx_csum_type_skb(struct sk_buff *skb)
 {
-- 
2.47.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next 1/4] sfc: Remove falcon deadcode
  2024-11-02 15:16 ` [PATCH net-next 1/4] sfc: Remove falcon deadcode linux
@ 2024-11-05  9:24   ` Martin Habets
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Habets @ 2024-11-05  9:24 UTC (permalink / raw)
  To: linux
  Cc: ecree.xilinx, andrew+netdev, davem, edumazet, kuba, pabeni,
	netdev, linux-net-drivers, linux-kernel

On Sat, Nov 02, 2024 at 03:16:22PM +0000, linux@treblig.org wrote:
> 
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> ef4_farch_dimension_resources(), ef4_nic_fix_nodesc_drop_stat(),
> ef4_ticks_to_usecs() and ef4_tx_get_copy_buffer_limited() were
> copied over from efx_ equivalents in 2016 but never used by
> commit 5a6681e22c14 ("sfc: separate out SFC4000 ("Falcon") support into new
> sfc-falcon driver")
> 
> EF4_MAX_FLUSH_TIME is also unused.
> 
> Remove them.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Many thanks David.

Acked-by: Martin Habets <habetsm.xilinx@gmail.com>

> ---
>  drivers/net/ethernet/sfc/falcon/efx.c   |  8 --------
>  drivers/net/ethernet/sfc/falcon/efx.h   |  1 -
>  drivers/net/ethernet/sfc/falcon/farch.c | 22 ----------------------
>  drivers/net/ethernet/sfc/falcon/nic.c   | 11 -----------
>  drivers/net/ethernet/sfc/falcon/nic.h   |  5 -----
>  drivers/net/ethernet/sfc/falcon/tx.c    |  8 --------
>  drivers/net/ethernet/sfc/falcon/tx.h    |  3 ---
>  7 files changed, 58 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/falcon/efx.c b/drivers/net/ethernet/sfc/falcon/efx.c
> index 8925745f1c17..b07f7e4e2877 100644
> --- a/drivers/net/ethernet/sfc/falcon/efx.c
> +++ b/drivers/net/ethernet/sfc/falcon/efx.c
> @@ -1886,14 +1886,6 @@ unsigned int ef4_usecs_to_ticks(struct ef4_nic *efx, unsigned int usecs)
>  	return usecs * 1000 / efx->timer_quantum_ns;
>  }
>  
> -unsigned int ef4_ticks_to_usecs(struct ef4_nic *efx, unsigned int ticks)
> -{
> -	/* We must round up when converting ticks to microseconds
> -	 * because we round down when converting the other way.
> -	 */
> -	return DIV_ROUND_UP(ticks * efx->timer_quantum_ns, 1000);
> -}
> -
>  /* Set interrupt moderation parameters */
>  int ef4_init_irq_moderation(struct ef4_nic *efx, unsigned int tx_usecs,
>  			    unsigned int rx_usecs, bool rx_adaptive,
> diff --git a/drivers/net/ethernet/sfc/falcon/efx.h b/drivers/net/ethernet/sfc/falcon/efx.h
> index d3b4646545fa..52508f2c8cb2 100644
> --- a/drivers/net/ethernet/sfc/falcon/efx.h
> +++ b/drivers/net/ethernet/sfc/falcon/efx.h
> @@ -198,7 +198,6 @@ int ef4_try_recovery(struct ef4_nic *efx);
>  /* Global */
>  void ef4_schedule_reset(struct ef4_nic *efx, enum reset_type type);
>  unsigned int ef4_usecs_to_ticks(struct ef4_nic *efx, unsigned int usecs);
> -unsigned int ef4_ticks_to_usecs(struct ef4_nic *efx, unsigned int ticks);
>  int ef4_init_irq_moderation(struct ef4_nic *efx, unsigned int tx_usecs,
>  			    unsigned int rx_usecs, bool rx_adaptive,
>  			    bool rx_may_override_tx);
> diff --git a/drivers/net/ethernet/sfc/falcon/farch.c b/drivers/net/ethernet/sfc/falcon/farch.c
> index c64623c2e80c..01017c41338e 100644
> --- a/drivers/net/ethernet/sfc/falcon/farch.c
> +++ b/drivers/net/ethernet/sfc/falcon/farch.c
> @@ -1631,28 +1631,6 @@ void ef4_farch_rx_push_indir_table(struct ef4_nic *efx)
>  	}
>  }
>  
> -/* Looks at available SRAM resources and works out how many queues we
> - * can support, and where things like descriptor caches should live.
> - *
> - * SRAM is split up as follows:
> - * 0                          buftbl entries for channels
> - * efx->vf_buftbl_base        buftbl entries for SR-IOV
> - * efx->rx_dc_base            RX descriptor caches
> - * efx->tx_dc_base            TX descriptor caches
> - */
> -void ef4_farch_dimension_resources(struct ef4_nic *efx, unsigned sram_lim_qw)
> -{
> -	unsigned vi_count;
> -
> -	/* Account for the buffer table entries backing the datapath channels
> -	 * and the descriptor caches for those channels.
> -	 */
> -	vi_count = max(efx->n_channels, efx->n_tx_channels * EF4_TXQ_TYPES);
> -
> -	efx->tx_dc_base = sram_lim_qw - vi_count * TX_DC_ENTRIES;
> -	efx->rx_dc_base = efx->tx_dc_base - vi_count * RX_DC_ENTRIES;
> -}
> -
>  u32 ef4_farch_fpga_ver(struct ef4_nic *efx)
>  {
>  	ef4_oword_t altera_build;
> diff --git a/drivers/net/ethernet/sfc/falcon/nic.c b/drivers/net/ethernet/sfc/falcon/nic.c
> index 78c851b5a56f..1b91992e3698 100644
> --- a/drivers/net/ethernet/sfc/falcon/nic.c
> +++ b/drivers/net/ethernet/sfc/falcon/nic.c
> @@ -511,14 +511,3 @@ void ef4_nic_update_stats(const struct ef4_hw_stat_desc *desc, size_t count,
>  		}
>  	}
>  }
> -
> -void ef4_nic_fix_nodesc_drop_stat(struct ef4_nic *efx, u64 *rx_nodesc_drops)
> -{
> -	/* if down, or this is the first update after coming up */
> -	if (!(efx->net_dev->flags & IFF_UP) || !efx->rx_nodesc_drops_prev_state)
> -		efx->rx_nodesc_drops_while_down +=
> -			*rx_nodesc_drops - efx->rx_nodesc_drops_total;
> -	efx->rx_nodesc_drops_total = *rx_nodesc_drops;
> -	efx->rx_nodesc_drops_prev_state = !!(efx->net_dev->flags & IFF_UP);
> -	*rx_nodesc_drops -= efx->rx_nodesc_drops_while_down;
> -}
> diff --git a/drivers/net/ethernet/sfc/falcon/nic.h b/drivers/net/ethernet/sfc/falcon/nic.h
> index ada6e036fd97..ac10c12967df 100644
> --- a/drivers/net/ethernet/sfc/falcon/nic.h
> +++ b/drivers/net/ethernet/sfc/falcon/nic.h
> @@ -477,7 +477,6 @@ void ef4_farch_finish_flr(struct ef4_nic *efx);
>  void falcon_start_nic_stats(struct ef4_nic *efx);
>  void falcon_stop_nic_stats(struct ef4_nic *efx);
>  int falcon_reset_xaui(struct ef4_nic *efx);
> -void ef4_farch_dimension_resources(struct ef4_nic *efx, unsigned sram_lim_qw);
>  void ef4_farch_init_common(struct ef4_nic *efx);
>  void ef4_farch_rx_push_indir_table(struct ef4_nic *efx);
>  
> @@ -502,10 +501,6 @@ size_t ef4_nic_describe_stats(const struct ef4_hw_stat_desc *desc, size_t count,
>  void ef4_nic_update_stats(const struct ef4_hw_stat_desc *desc, size_t count,
>  			  const unsigned long *mask, u64 *stats,
>  			  const void *dma_buf, bool accumulate);
> -void ef4_nic_fix_nodesc_drop_stat(struct ef4_nic *efx, u64 *stat);
> -
> -#define EF4_MAX_FLUSH_TIME 5000
> -
>  void ef4_farch_generate_event(struct ef4_nic *efx, unsigned int evq,
>  			      ef4_qword_t *event);
>  
> diff --git a/drivers/net/ethernet/sfc/falcon/tx.c b/drivers/net/ethernet/sfc/falcon/tx.c
> index b9369483758c..e6e80b039ca2 100644
> --- a/drivers/net/ethernet/sfc/falcon/tx.c
> +++ b/drivers/net/ethernet/sfc/falcon/tx.c
> @@ -40,14 +40,6 @@ static inline u8 *ef4_tx_get_copy_buffer(struct ef4_tx_queue *tx_queue,
>  	return (u8 *)page_buf->addr + offset;
>  }
>  
> -u8 *ef4_tx_get_copy_buffer_limited(struct ef4_tx_queue *tx_queue,
> -				   struct ef4_tx_buffer *buffer, size_t len)
> -{
> -	if (len > EF4_TX_CB_SIZE)
> -		return NULL;
> -	return ef4_tx_get_copy_buffer(tx_queue, buffer);
> -}
> -
>  static void ef4_dequeue_buffer(struct ef4_tx_queue *tx_queue,
>  			       struct ef4_tx_buffer *buffer,
>  			       unsigned int *pkts_compl,
> diff --git a/drivers/net/ethernet/sfc/falcon/tx.h b/drivers/net/ethernet/sfc/falcon/tx.h
> index 2a88c59cbbbe..868ed8a861ab 100644
> --- a/drivers/net/ethernet/sfc/falcon/tx.h
> +++ b/drivers/net/ethernet/sfc/falcon/tx.h
> @@ -15,9 +15,6 @@
>  unsigned int ef4_tx_limit_len(struct ef4_tx_queue *tx_queue,
>  			      dma_addr_t dma_addr, unsigned int len);
>  
> -u8 *ef4_tx_get_copy_buffer_limited(struct ef4_tx_queue *tx_queue,
> -				   struct ef4_tx_buffer *buffer, size_t len);
> -
>  int ef4_enqueue_skb_tso(struct ef4_tx_queue *tx_queue, struct sk_buff *skb,
>  			bool *data_mapped);
>  
> -- 
> 2.47.0
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next 2/4] sfc: Remove unused efx_mae_mport_vf
  2024-11-02 15:16 ` [PATCH net-next 2/4] sfc: Remove unused efx_mae_mport_vf linux
@ 2024-11-05  9:28   ` Martin Habets
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Habets @ 2024-11-05  9:28 UTC (permalink / raw)
  To: linux
  Cc: ecree.xilinx, andrew+netdev, davem, edumazet, kuba, pabeni,
	netdev, linux-net-drivers, linux-kernel

On Sat, Nov 02, 2024 at 03:16:23PM +0000, linux@treblig.org wrote:
> 
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> efx_mae_mport_vf() has been unused since
> commit 5227adff37af ("sfc: add mport lookup based on driver's mport data")
> 
> Remove it.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Acked-by: Martin Habets <habetsm.xilinx@gmail.com>

> ---
>  drivers/net/ethernet/sfc/mae.c | 11 -----------
>  drivers/net/ethernet/sfc/mae.h |  1 -
>  2 files changed, 12 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/mae.c b/drivers/net/ethernet/sfc/mae.c
> index 10709d828a63..50f097487b14 100644
> --- a/drivers/net/ethernet/sfc/mae.c
> +++ b/drivers/net/ethernet/sfc/mae.c
> @@ -76,17 +76,6 @@ void efx_mae_mport_uplink(struct efx_nic *efx __always_unused, u32 *out)
>  	*out = EFX_DWORD_VAL(mport);
>  }
>  
> -void efx_mae_mport_vf(struct efx_nic *efx __always_unused, u32 vf_id, u32 *out)
> -{
> -	efx_dword_t mport;
> -
> -	EFX_POPULATE_DWORD_3(mport,
> -			     MAE_MPORT_SELECTOR_TYPE, MAE_MPORT_SELECTOR_TYPE_FUNC,
> -			     MAE_MPORT_SELECTOR_FUNC_PF_ID, MAE_MPORT_SELECTOR_FUNC_PF_ID_CALLER,
> -			     MAE_MPORT_SELECTOR_FUNC_VF_ID, vf_id);
> -	*out = EFX_DWORD_VAL(mport);
> -}
> -
>  /* Constructs an mport selector from an mport ID, because they're not the same */
>  void efx_mae_mport_mport(struct efx_nic *efx __always_unused, u32 mport_id, u32 *out)
>  {
> diff --git a/drivers/net/ethernet/sfc/mae.h b/drivers/net/ethernet/sfc/mae.h
> index 8df30bc4f3ba..db79912c86d8 100644
> --- a/drivers/net/ethernet/sfc/mae.h
> +++ b/drivers/net/ethernet/sfc/mae.h
> @@ -23,7 +23,6 @@ int efx_mae_free_mport(struct efx_nic *efx, u32 id);
>  
>  void efx_mae_mport_wire(struct efx_nic *efx, u32 *out);
>  void efx_mae_mport_uplink(struct efx_nic *efx, u32 *out);
> -void efx_mae_mport_vf(struct efx_nic *efx, u32 vf_id, u32 *out);
>  void efx_mae_mport_mport(struct efx_nic *efx, u32 mport_id, u32 *out);
>  
>  int efx_mae_lookup_mport(struct efx_nic *efx, u32 selector, u32 *id);
> -- 
> 2.47.0
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next 3/4] sfc: Remove unused mcdi functions
  2024-11-02 15:16 ` [PATCH net-next 3/4] sfc: Remove unused mcdi functions linux
@ 2024-11-05  9:33   ` Martin Habets
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Habets @ 2024-11-05  9:33 UTC (permalink / raw)
  To: linux
  Cc: ecree.xilinx, andrew+netdev, davem, edumazet, kuba, pabeni,
	netdev, linux-net-drivers, linux-kernel

On Sat, Nov 02, 2024 at 03:16:24PM +0000, linux@treblig.org wrote:
> 
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> efx_mcdi_flush_rxqs(), efx_mcdi_rpc_async_quiet(),
> efx_mcdi_rpc_finish_quiet(), and efx_mcdi_wol_filter_get_magic()
> are unused.
> I think these are fall out from the split into Siena
> that happened in
> commit 4d49e5cd4b09 ("sfc/siena: Rename functions in mcdi headers to avoid
> conflicts with sfc")
> and
> commit d48523cb88e0 ("sfc: Copy shared files needed for Siena (part 2)")
> 
> Remove them.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Thanks.

Acked-by: Martin Habets <habetsm.xilinx@gmail.com>

> ---
>  drivers/net/ethernet/sfc/mcdi.c | 76 ---------------------------------
>  drivers/net/ethernet/sfc/mcdi.h | 10 -----
>  2 files changed, 86 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c
> index 76578502226e..d461b1a6ce81 100644
> --- a/drivers/net/ethernet/sfc/mcdi.c
> +++ b/drivers/net/ethernet/sfc/mcdi.c
> @@ -1051,15 +1051,6 @@ efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd,
>  				   cookie, false);
>  }
>  
> -int efx_mcdi_rpc_async_quiet(struct efx_nic *efx, unsigned int cmd,
> -			     const efx_dword_t *inbuf, size_t inlen,
> -			     size_t outlen, efx_mcdi_async_completer *complete,
> -			     unsigned long cookie)
> -{
> -	return _efx_mcdi_rpc_async(efx, cmd, inbuf, inlen, outlen, complete,
> -				   cookie, true);
> -}
> -
>  int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen,
>  			efx_dword_t *outbuf, size_t outlen,
>  			size_t *outlen_actual)
> @@ -1068,14 +1059,6 @@ int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen,
>  				    outlen_actual, false, NULL, NULL);
>  }
>  
> -int efx_mcdi_rpc_finish_quiet(struct efx_nic *efx, unsigned cmd, size_t inlen,
> -			      efx_dword_t *outbuf, size_t outlen,
> -			      size_t *outlen_actual)
> -{
> -	return _efx_mcdi_rpc_finish(efx, cmd, inlen, outbuf, outlen,
> -				    outlen_actual, true, NULL, NULL);
> -}
> -
>  void efx_mcdi_display_error(struct efx_nic *efx, unsigned cmd,
>  			    size_t inlen, efx_dword_t *outbuf,
>  			    size_t outlen, int rc)
> @@ -1982,33 +1965,6 @@ efx_mcdi_wol_filter_set_magic(struct efx_nic *efx,  const u8 *mac, int *id_out)
>  }
>  
>  
> -int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out)
> -{
> -	MCDI_DECLARE_BUF(outbuf, MC_CMD_WOL_FILTER_GET_OUT_LEN);
> -	size_t outlen;
> -	int rc;
> -
> -	rc = efx_mcdi_rpc(efx, MC_CMD_WOL_FILTER_GET, NULL, 0,
> -			  outbuf, sizeof(outbuf), &outlen);
> -	if (rc)
> -		goto fail;
> -
> -	if (outlen < MC_CMD_WOL_FILTER_GET_OUT_LEN) {
> -		rc = -EIO;
> -		goto fail;
> -	}
> -
> -	*id_out = (int)MCDI_DWORD(outbuf, WOL_FILTER_GET_OUT_FILTER_ID);
> -
> -	return 0;
> -
> -fail:
> -	*id_out = -1;
> -	netif_err(efx, hw, efx->net_dev, "%s: failed rc=%d\n", __func__, rc);
> -	return rc;
> -}
> -
> -
>  int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id)
>  {
>  	MCDI_DECLARE_BUF(inbuf, MC_CMD_WOL_FILTER_REMOVE_IN_LEN);
> @@ -2021,38 +1977,6 @@ int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id)
>  	return rc;
>  }
>  
> -int efx_mcdi_flush_rxqs(struct efx_nic *efx)
> -{
> -	struct efx_channel *channel;
> -	struct efx_rx_queue *rx_queue;
> -	MCDI_DECLARE_BUF(inbuf,
> -			 MC_CMD_FLUSH_RX_QUEUES_IN_LEN(EFX_MAX_CHANNELS));
> -	int rc, count;
> -
> -	BUILD_BUG_ON(EFX_MAX_CHANNELS >
> -		     MC_CMD_FLUSH_RX_QUEUES_IN_QID_OFST_MAXNUM);
> -
> -	count = 0;
> -	efx_for_each_channel(channel, efx) {
> -		efx_for_each_channel_rx_queue(rx_queue, channel) {
> -			if (rx_queue->flush_pending) {
> -				rx_queue->flush_pending = false;
> -				atomic_dec(&efx->rxq_flush_pending);
> -				MCDI_SET_ARRAY_DWORD(
> -					inbuf, FLUSH_RX_QUEUES_IN_QID_OFST,
> -					count, efx_rx_queue_index(rx_queue));
> -				count++;
> -			}
> -		}
> -	}
> -
> -	rc = efx_mcdi_rpc(efx, MC_CMD_FLUSH_RX_QUEUES, inbuf,
> -			  MC_CMD_FLUSH_RX_QUEUES_IN_LEN(count), NULL, 0, NULL);
> -	WARN_ON(rc < 0);
> -
> -	return rc;
> -}
> -
>  int efx_mcdi_wol_filter_reset(struct efx_nic *efx)
>  {
>  	int rc;
> diff --git a/drivers/net/ethernet/sfc/mcdi.h b/drivers/net/ethernet/sfc/mcdi.h
> index ea612c619874..cdb17d7c147f 100644
> --- a/drivers/net/ethernet/sfc/mcdi.h
> +++ b/drivers/net/ethernet/sfc/mcdi.h
> @@ -155,9 +155,6 @@ int efx_mcdi_rpc_start(struct efx_nic *efx, unsigned cmd,
>  int efx_mcdi_rpc_finish(struct efx_nic *efx, unsigned cmd, size_t inlen,
>  			efx_dword_t *outbuf, size_t outlen,
>  			size_t *outlen_actual);
> -int efx_mcdi_rpc_finish_quiet(struct efx_nic *efx, unsigned cmd,
> -			      size_t inlen, efx_dword_t *outbuf,
> -			      size_t outlen, size_t *outlen_actual);
>  
>  typedef void efx_mcdi_async_completer(struct efx_nic *efx,
>  				      unsigned long cookie, int rc,
> @@ -167,11 +164,6 @@ int efx_mcdi_rpc_async(struct efx_nic *efx, unsigned int cmd,
>  		       const efx_dword_t *inbuf, size_t inlen, size_t outlen,
>  		       efx_mcdi_async_completer *complete,
>  		       unsigned long cookie);
> -int efx_mcdi_rpc_async_quiet(struct efx_nic *efx, unsigned int cmd,
> -			     const efx_dword_t *inbuf, size_t inlen,
> -			     size_t outlen,
> -			     efx_mcdi_async_completer *complete,
> -			     unsigned long cookie);
>  
>  void efx_mcdi_display_error(struct efx_nic *efx, unsigned cmd,
>  			    size_t inlen, efx_dword_t *outbuf,
> @@ -410,10 +402,8 @@ int efx_mcdi_handle_assertion(struct efx_nic *efx);
>  int efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode);
>  int efx_mcdi_wol_filter_set_magic(struct efx_nic *efx, const u8 *mac,
>  				  int *id_out);
> -int efx_mcdi_wol_filter_get_magic(struct efx_nic *efx, int *id_out);
>  int efx_mcdi_wol_filter_remove(struct efx_nic *efx, int id);
>  int efx_mcdi_wol_filter_reset(struct efx_nic *efx);
> -int efx_mcdi_flush_rxqs(struct efx_nic *efx);
>  void efx_mcdi_process_link_change(struct efx_nic *efx, efx_qword_t *ev);
>  void efx_mcdi_mac_start_stats(struct efx_nic *efx);
>  void efx_mcdi_mac_stop_stats(struct efx_nic *efx);
> -- 
> 2.47.0
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next 4/4] sfc: Remove more unused functions
  2024-11-02 15:16 ` [PATCH net-next 4/4] sfc: Remove more unused functions linux
@ 2024-11-05  9:41   ` Martin Habets
  0 siblings, 0 replies; 10+ messages in thread
From: Martin Habets @ 2024-11-05  9:41 UTC (permalink / raw)
  To: linux
  Cc: ecree.xilinx, andrew+netdev, davem, edumazet, kuba, pabeni,
	netdev, linux-net-drivers, linux-kernel

On Sat, Nov 02, 2024 at 03:16:25PM +0000, linux@treblig.org wrote:
> 
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> efx_ticks_to_usecs(), efx_reconfigure_port(), efx_ptp_get_mode(), and
> efx_tx_get_copy_buffer_limited() are unused.
> They seem to be partially due to the later splits to Siena, but
> some seem unused for longer.
> 
> Remove them.
> 
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Acked-by: Martin Habets <habetsm.xilinx@gmail.com>

> ---
>  drivers/net/ethernet/sfc/efx.c        |  8 --------
>  drivers/net/ethernet/sfc/efx.h        |  1 -
>  drivers/net/ethernet/sfc/efx_common.c | 16 ----------------
>  drivers/net/ethernet/sfc/efx_common.h |  1 -
>  drivers/net/ethernet/sfc/ptp.c        |  5 -----
>  drivers/net/ethernet/sfc/ptp.h        |  1 -
>  drivers/net/ethernet/sfc/tx.c         |  8 --------
>  drivers/net/ethernet/sfc/tx.h         |  3 ---
>  8 files changed, 43 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
> index 36b3b57e2055..0382ac30d1aa 100644
> --- a/drivers/net/ethernet/sfc/efx.c
> +++ b/drivers/net/ethernet/sfc/efx.c
> @@ -417,14 +417,6 @@ unsigned int efx_usecs_to_ticks(struct efx_nic *efx, unsigned int usecs)
>  	return usecs * 1000 / efx->timer_quantum_ns;
>  }
>  
> -unsigned int efx_ticks_to_usecs(struct efx_nic *efx, unsigned int ticks)
> -{
> -	/* We must round up when converting ticks to microseconds
> -	 * because we round down when converting the other way.
> -	 */
> -	return DIV_ROUND_UP(ticks * efx->timer_quantum_ns, 1000);
> -}
> -
>  /* Set interrupt moderation parameters */
>  int efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs,
>  			    unsigned int rx_usecs, bool rx_adaptive,
> diff --git a/drivers/net/ethernet/sfc/efx.h b/drivers/net/ethernet/sfc/efx.h
> index 7a6cab883d66..45e191686625 100644
> --- a/drivers/net/ethernet/sfc/efx.h
> +++ b/drivers/net/ethernet/sfc/efx.h
> @@ -168,7 +168,6 @@ extern const struct ethtool_ops efx_ethtool_ops;
>  
>  /* Global */
>  unsigned int efx_usecs_to_ticks(struct efx_nic *efx, unsigned int usecs);
> -unsigned int efx_ticks_to_usecs(struct efx_nic *efx, unsigned int ticks);
>  int efx_init_irq_moderation(struct efx_nic *efx, unsigned int tx_usecs,
>  			    unsigned int rx_usecs, bool rx_adaptive,
>  			    bool rx_may_override_tx);
> diff --git a/drivers/net/ethernet/sfc/efx_common.c b/drivers/net/ethernet/sfc/efx_common.c
> index 13cf647051af..c88ec3e24836 100644
> --- a/drivers/net/ethernet/sfc/efx_common.c
> +++ b/drivers/net/ethernet/sfc/efx_common.c
> @@ -635,22 +635,6 @@ int __efx_reconfigure_port(struct efx_nic *efx)
>  	return rc;
>  }
>  
> -/* Reinitialise the MAC to pick up new PHY settings, even if the port is
> - * disabled.
> - */
> -int efx_reconfigure_port(struct efx_nic *efx)
> -{
> -	int rc;
> -
> -	EFX_ASSERT_RESET_SERIALISED(efx);
> -
> -	mutex_lock(&efx->mac_lock);
> -	rc = __efx_reconfigure_port(efx);
> -	mutex_unlock(&efx->mac_lock);
> -
> -	return rc;
> -}
> -
>  /**************************************************************************
>   *
>   * Device reset and suspend
> diff --git a/drivers/net/ethernet/sfc/efx_common.h b/drivers/net/ethernet/sfc/efx_common.h
> index 2c54dac3e662..19a8ca530969 100644
> --- a/drivers/net/ethernet/sfc/efx_common.h
> +++ b/drivers/net/ethernet/sfc/efx_common.h
> @@ -40,7 +40,6 @@ void efx_destroy_reset_workqueue(void);
>  void efx_start_monitor(struct efx_nic *efx);
>  
>  int __efx_reconfigure_port(struct efx_nic *efx);
> -int efx_reconfigure_port(struct efx_nic *efx);
>  
>  #define EFX_ASSERT_RESET_SERIALISED(efx)				\
>  	do {								\
> diff --git a/drivers/net/ethernet/sfc/ptp.c b/drivers/net/ethernet/sfc/ptp.c
> index aaacdcfa54ae..36bceeeb6483 100644
> --- a/drivers/net/ethernet/sfc/ptp.c
> +++ b/drivers/net/ethernet/sfc/ptp.c
> @@ -1800,11 +1800,6 @@ int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb)
>  	return NETDEV_TX_OK;
>  }
>  
> -int efx_ptp_get_mode(struct efx_nic *efx)
> -{
> -	return efx->ptp_data->mode;
> -}
> -
>  int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
>  			unsigned int new_mode)
>  {
> diff --git a/drivers/net/ethernet/sfc/ptp.h b/drivers/net/ethernet/sfc/ptp.h
> index 6946203499ef..feab7bdd7889 100644
> --- a/drivers/net/ethernet/sfc/ptp.h
> +++ b/drivers/net/ethernet/sfc/ptp.h
> @@ -26,7 +26,6 @@ int efx_ptp_get_ts_config(struct efx_nic *efx,
>  void efx_ptp_get_ts_info(struct efx_nic *efx,
>  			 struct kernel_ethtool_ts_info *ts_info);
>  bool efx_ptp_is_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
> -int efx_ptp_get_mode(struct efx_nic *efx);
>  int efx_ptp_change_mode(struct efx_nic *efx, bool enable_wanted,
>  			unsigned int new_mode);
>  int efx_ptp_tx(struct efx_nic *efx, struct sk_buff *skb);
> diff --git a/drivers/net/ethernet/sfc/tx.c b/drivers/net/ethernet/sfc/tx.c
> index fe2d476028e7..6b4a343a455d 100644
> --- a/drivers/net/ethernet/sfc/tx.c
> +++ b/drivers/net/ethernet/sfc/tx.c
> @@ -49,14 +49,6 @@ static inline u8 *efx_tx_get_copy_buffer(struct efx_tx_queue *tx_queue,
>  	return (u8 *)page_buf->addr + offset;
>  }
>  
> -u8 *efx_tx_get_copy_buffer_limited(struct efx_tx_queue *tx_queue,
> -				   struct efx_tx_buffer *buffer, size_t len)
> -{
> -	if (len > EFX_TX_CB_SIZE)
> -		return NULL;
> -	return efx_tx_get_copy_buffer(tx_queue, buffer);
> -}
> -
>  static void efx_tx_maybe_stop_queue(struct efx_tx_queue *txq1)
>  {
>  	/* We need to consider all queues that the net core sees as one */
> diff --git a/drivers/net/ethernet/sfc/tx.h b/drivers/net/ethernet/sfc/tx.h
> index f2c4d2f89919..f882749af8c3 100644
> --- a/drivers/net/ethernet/sfc/tx.h
> +++ b/drivers/net/ethernet/sfc/tx.h
> @@ -15,9 +15,6 @@
>  unsigned int efx_tx_limit_len(struct efx_tx_queue *tx_queue,
>  			      dma_addr_t dma_addr, unsigned int len);
>  
> -u8 *efx_tx_get_copy_buffer_limited(struct efx_tx_queue *tx_queue,
> -				   struct efx_tx_buffer *buffer, size_t len);
> -
>  /* What TXQ type will satisfy the checksum offloads required for this skb? */
>  static inline unsigned int efx_tx_csum_type_skb(struct sk_buff *skb)
>  {
> -- 
> 2.47.0
> 

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH net-next 0/4] A pile of sfc deadcode
  2024-11-02 15:16 [PATCH net-next 0/4] A pile of sfc deadcode linux
                   ` (3 preceding siblings ...)
  2024-11-02 15:16 ` [PATCH net-next 4/4] sfc: Remove more unused functions linux
@ 2024-11-06  1:40 ` patchwork-bot+netdevbpf
  4 siblings, 0 replies; 10+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-11-06  1:40 UTC (permalink / raw)
  To: Dr. David Alan Gilbert
  Cc: ecree.xilinx, habetsm.xilinx, andrew+netdev, davem, edumazet,
	kuba, pabeni, netdev, linux-net-drivers, linux-kernel

Hello:

This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat,  2 Nov 2024 15:16:21 +0000 you wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> This is a collection of deadcode removal in the sfc
> drivers;  the split is vaguely where I found them in
> the tree, with some left over.
> 
> This has been build tested and booted on an x86 VM,
> but I fon't have the hardware to test; however
> it's all full function removal.
> 
> [...]

Here is the summary with links:
  - [net-next,1/4] sfc: Remove falcon deadcode
    https://git.kernel.org/netdev/net-next/c/cc4914d90479
  - [net-next,2/4] sfc: Remove unused efx_mae_mport_vf
    https://git.kernel.org/netdev/net-next/c/70e58249a646
  - [net-next,3/4] sfc: Remove unused mcdi functions
    https://git.kernel.org/netdev/net-next/c/5254fdfc746a
  - [net-next,4/4] sfc: Remove more unused functions
    https://git.kernel.org/netdev/net-next/c/d3e80070b5b4

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-11-06  1:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-02 15:16 [PATCH net-next 0/4] A pile of sfc deadcode linux
2024-11-02 15:16 ` [PATCH net-next 1/4] sfc: Remove falcon deadcode linux
2024-11-05  9:24   ` Martin Habets
2024-11-02 15:16 ` [PATCH net-next 2/4] sfc: Remove unused efx_mae_mport_vf linux
2024-11-05  9:28   ` Martin Habets
2024-11-02 15:16 ` [PATCH net-next 3/4] sfc: Remove unused mcdi functions linux
2024-11-05  9:33   ` Martin Habets
2024-11-02 15:16 ` [PATCH net-next 4/4] sfc: Remove more unused functions linux
2024-11-05  9:41   ` Martin Habets
2024-11-06  1:40 ` [PATCH net-next 0/4] A pile of sfc deadcode patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).