netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/6] cxgb4: Deadcode removal
@ 2024-10-13 20:38 linux
  2024-10-13 20:38 ` [PATCH net-next 1/6] cxgb4: Remove unused cxgb4_alloc/free_encap_mac_filt linux
                   ` (6 more replies)
  0 siblings, 7 replies; 15+ messages in thread
From: linux @ 2024-10-13 20:38 UTC (permalink / raw)
  To: bharat, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Dr. David Alan Gilbert

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

Hi,
  This is a bunch of deadcode removal in cxgb4.
It's all complete function removal rather than any actual change to
logic.

Build and boot tested, but I don't have the hardware to test
the actual card.

Dave

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


Dr. David Alan Gilbert (6):
  cxgb4: Remove unused cxgb4_alloc/free_encap_mac_filt
  cxgb4: Remove unused cxgb4_alloc/free_raw_mac_filt
  cxgb4: Remove unused cxgb4_get_srq_entry
  cxgb4: Remove unused cxgb4_scsi_init
  cxgb4: Remove unused cxgb4_l2t_alloc_switching
  cxgb4: Remove unused t4_free_ofld_rxqs

 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h    | 23 -----
 .../net/ethernet/chelsio/cxgb4/cxgb4_main.c   | 12 ---
 .../net/ethernet/chelsio/cxgb4/cxgb4_mps.c    | 98 -------------------
 .../net/ethernet/chelsio/cxgb4/cxgb4_uld.h    |  2 -
 drivers/net/ethernet/chelsio/cxgb4/l2t.c      | 19 ----
 drivers/net/ethernet/chelsio/cxgb4/l2t.h      |  2 -
 drivers/net/ethernet/chelsio/cxgb4/sge.c      | 16 ---
 drivers/net/ethernet/chelsio/cxgb4/srq.c      | 58 -----------
 drivers/net/ethernet/chelsio/cxgb4/srq.h      |  2 -
 9 files changed, 232 deletions(-)

-- 
2.47.0


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

* [PATCH net-next 1/6] cxgb4: Remove unused cxgb4_alloc/free_encap_mac_filt
  2024-10-13 20:38 [PATCH net-next 0/6] cxgb4: Deadcode removal linux
@ 2024-10-13 20:38 ` linux
  2024-10-14  3:35   ` Kalesh Anakkur Purayil
  2024-10-13 20:38 ` [PATCH net-next 2/6] cxgb4: Remove unused cxgb4_alloc/free_raw_mac_filt linux
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: linux @ 2024-10-13 20:38 UTC (permalink / raw)
  To: bharat, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Dr. David Alan Gilbert

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

cxgb4_alloc_encap_mac_filt() and cxgb4_free_encap_mac_filt() have been
unused since
commit 28b3870578ef ("cxgb4: Re-work the logic for mps refcounting")

Remove them.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h    |  6 ----
 .../net/ethernet/chelsio/cxgb4/cxgb4_mps.c    | 30 -------------------
 2 files changed, 36 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
index bbf7641a0fc7..1efb0a73ce0e 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
@@ -2141,12 +2141,6 @@ int cxgb4_free_mac_filt(struct adapter *adap, unsigned int viid,
 			unsigned int naddr, const u8 **addr, bool sleep_ok);
 int cxgb4_init_mps_ref_entries(struct adapter *adap);
 void cxgb4_free_mps_ref_entries(struct adapter *adap);
-int cxgb4_alloc_encap_mac_filt(struct adapter *adap, unsigned int viid,
-			       const u8 *addr, const u8 *mask,
-			       unsigned int vni, unsigned int vni_mask,
-			       u8 dip_hit, u8 lookup_type, bool sleep_ok);
-int cxgb4_free_encap_mac_filt(struct adapter *adap, unsigned int viid,
-			      int idx, bool sleep_ok);
 int cxgb4_free_raw_mac_filt(struct adapter *adap,
 			    unsigned int viid,
 			    const u8 *addr,
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c
index a020e8490681..0e5663d19fcf 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c
@@ -187,36 +187,6 @@ int cxgb4_alloc_raw_mac_filt(struct adapter *adap,
 	return ret;
 }
 
-int cxgb4_free_encap_mac_filt(struct adapter *adap, unsigned int viid,
-			      int idx, bool sleep_ok)
-{
-	int ret = 0;
-
-	if (!cxgb4_mps_ref_dec(adap, idx))
-		ret = t4_free_encap_mac_filt(adap, viid, idx, sleep_ok);
-
-	return ret;
-}
-
-int cxgb4_alloc_encap_mac_filt(struct adapter *adap, unsigned int viid,
-			       const u8 *addr, const u8 *mask,
-			       unsigned int vni, unsigned int vni_mask,
-			       u8 dip_hit, u8 lookup_type, bool sleep_ok)
-{
-	int ret;
-
-	ret = t4_alloc_encap_mac_filt(adap, viid, addr, mask, vni, vni_mask,
-				      dip_hit, lookup_type, sleep_ok);
-	if (ret < 0)
-		return ret;
-
-	if (cxgb4_mps_ref_inc(adap, addr, ret, mask)) {
-		ret = -ENOMEM;
-		t4_free_encap_mac_filt(adap, viid, ret, sleep_ok);
-	}
-	return ret;
-}
-
 int cxgb4_init_mps_ref_entries(struct adapter *adap)
 {
 	spin_lock_init(&adap->mps_ref_lock);
-- 
2.47.0


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

* [PATCH net-next 2/6] cxgb4: Remove unused cxgb4_alloc/free_raw_mac_filt
  2024-10-13 20:38 [PATCH net-next 0/6] cxgb4: Deadcode removal linux
  2024-10-13 20:38 ` [PATCH net-next 1/6] cxgb4: Remove unused cxgb4_alloc/free_encap_mac_filt linux
@ 2024-10-13 20:38 ` linux
  2024-10-14  3:37   ` Kalesh Anakkur Purayil
  2024-10-13 20:38 ` [PATCH net-next 3/6] cxgb4: Remove unused cxgb4_get_srq_entry linux
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: linux @ 2024-10-13 20:38 UTC (permalink / raw)
  To: bharat, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Dr. David Alan Gilbert

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

cxgb4_alloc_raw_mac_filt() and cxgb4_free_raw_mac_filt() have been
unused since they were added in 2019 commit
5fab51581f62 ("cxgb4: Add MPS TCAM refcounting for raw mac filters")

Remove them.

This was also the last use of cxgb4_mps_ref_dec().
Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h    | 16 -----
 .../net/ethernet/chelsio/cxgb4/cxgb4_mps.c    | 68 -------------------
 2 files changed, 84 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
index 1efb0a73ce0e..1c302dfd6503 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
@@ -2141,22 +2141,6 @@ int cxgb4_free_mac_filt(struct adapter *adap, unsigned int viid,
 			unsigned int naddr, const u8 **addr, bool sleep_ok);
 int cxgb4_init_mps_ref_entries(struct adapter *adap);
 void cxgb4_free_mps_ref_entries(struct adapter *adap);
-int cxgb4_free_raw_mac_filt(struct adapter *adap,
-			    unsigned int viid,
-			    const u8 *addr,
-			    const u8 *mask,
-			    unsigned int idx,
-			    u8 lookup_type,
-			    u8 port_id,
-			    bool sleep_ok);
-int cxgb4_alloc_raw_mac_filt(struct adapter *adap,
-			     unsigned int viid,
-			     const u8 *addr,
-			     const u8 *mask,
-			     unsigned int idx,
-			     u8 lookup_type,
-			     u8 port_id,
-			     bool sleep_ok);
 int cxgb4_update_mac_filt(struct port_info *pi, unsigned int viid,
 			  int *tcam_idx, const u8 *addr,
 			  bool persistent, u8 *smt_idx);
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c
index 0e5663d19fcf..60f4d5b5eb3a 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c
@@ -28,28 +28,6 @@ static int cxgb4_mps_ref_dec_by_mac(struct adapter *adap,
 	return ret;
 }
 
-static int cxgb4_mps_ref_dec(struct adapter *adap, u16 idx)
-{
-	struct mps_entries_ref *mps_entry, *tmp;
-	int ret = -EINVAL;
-
-	spin_lock(&adap->mps_ref_lock);
-	list_for_each_entry_safe(mps_entry, tmp, &adap->mps_ref, list) {
-		if (mps_entry->idx == idx) {
-			if (!refcount_dec_and_test(&mps_entry->refcnt)) {
-				spin_unlock(&adap->mps_ref_lock);
-				return -EBUSY;
-			}
-			list_del(&mps_entry->list);
-			kfree(mps_entry);
-			ret = 0;
-			break;
-		}
-	}
-	spin_unlock(&adap->mps_ref_lock);
-	return ret;
-}
-
 static int cxgb4_mps_ref_inc(struct adapter *adap, const u8 *mac_addr,
 			     u16 idx, const u8 *mask)
 {
@@ -141,52 +119,6 @@ int cxgb4_update_mac_filt(struct port_info *pi, unsigned int viid,
 	return ret;
 }
 
-int cxgb4_free_raw_mac_filt(struct adapter *adap,
-			    unsigned int viid,
-			    const u8 *addr,
-			    const u8 *mask,
-			    unsigned int idx,
-			    u8 lookup_type,
-			    u8 port_id,
-			    bool sleep_ok)
-{
-	int ret = 0;
-
-	if (!cxgb4_mps_ref_dec(adap, idx))
-		ret = t4_free_raw_mac_filt(adap, viid, addr,
-					   mask, idx, lookup_type,
-					   port_id, sleep_ok);
-
-	return ret;
-}
-
-int cxgb4_alloc_raw_mac_filt(struct adapter *adap,
-			     unsigned int viid,
-			     const u8 *addr,
-			     const u8 *mask,
-			     unsigned int idx,
-			     u8 lookup_type,
-			     u8 port_id,
-			     bool sleep_ok)
-{
-	int ret;
-
-	ret = t4_alloc_raw_mac_filt(adap, viid, addr,
-				    mask, idx, lookup_type,
-				    port_id, sleep_ok);
-	if (ret < 0)
-		return ret;
-
-	if (cxgb4_mps_ref_inc(adap, addr, ret, mask)) {
-		ret = -ENOMEM;
-		t4_free_raw_mac_filt(adap, viid, addr,
-				     mask, idx, lookup_type,
-				     port_id, sleep_ok);
-	}
-
-	return ret;
-}
-
 int cxgb4_init_mps_ref_entries(struct adapter *adap)
 {
 	spin_lock_init(&adap->mps_ref_lock);
-- 
2.47.0


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

* [PATCH net-next 3/6] cxgb4: Remove unused cxgb4_get_srq_entry
  2024-10-13 20:38 [PATCH net-next 0/6] cxgb4: Deadcode removal linux
  2024-10-13 20:38 ` [PATCH net-next 1/6] cxgb4: Remove unused cxgb4_alloc/free_encap_mac_filt linux
  2024-10-13 20:38 ` [PATCH net-next 2/6] cxgb4: Remove unused cxgb4_alloc/free_raw_mac_filt linux
@ 2024-10-13 20:38 ` linux
  2024-10-14  3:33   ` Kalesh Anakkur Purayil
  2024-10-13 20:38 ` [PATCH net-next 4/6] cxgb4: Remove unused cxgb4_scsi_init linux
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: linux @ 2024-10-13 20:38 UTC (permalink / raw)
  To: bharat, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Dr. David Alan Gilbert

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

cxgb4_get_srq_entry() has been unused since 2018's commit
e47094751ddc ("cxgb4: Add support to initialise/read SRQ entries")
which added it.

Remove it.

Note: I'm a bit suspicious whether any of the srq code in there
actually does anything useful;  without this get I can't see anything
that reads the data, so perhaps the whole thing should go?
But that however would remove one of the opcode handlers, and I have
no way to test that.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/net/ethernet/chelsio/cxgb4/srq.c | 58 ------------------------
 drivers/net/ethernet/chelsio/cxgb4/srq.h |  2 -
 2 files changed, 60 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/srq.c b/drivers/net/ethernet/chelsio/cxgb4/srq.c
index 9a54302bb046..a77d6ac1ee8c 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/srq.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/srq.c
@@ -51,64 +51,6 @@ struct srq_data *t4_init_srq(int srq_size)
 	return s;
 }
 
-/* cxgb4_get_srq_entry: read the SRQ table entry
- * @dev: Pointer to the net_device
- * @idx: Index to the srq
- * @entryp: pointer to the srq entry
- *
- * Sends CPL_SRQ_TABLE_REQ message for the given index.
- * Contents will be returned in CPL_SRQ_TABLE_RPL message.
- *
- * Returns zero if the read is successful, else a error
- * number will be returned. Caller should not use the srq
- * entry if the return value is non-zero.
- *
- *
- */
-int cxgb4_get_srq_entry(struct net_device *dev,
-			int srq_idx, struct srq_entry *entryp)
-{
-	struct cpl_srq_table_req *req;
-	struct adapter *adap;
-	struct sk_buff *skb;
-	struct srq_data *s;
-	int rc = -ENODEV;
-
-	adap = netdev2adap(dev);
-	s = adap->srq;
-
-	if (!(adap->flags & CXGB4_FULL_INIT_DONE) || !s)
-		goto out;
-
-	skb = alloc_skb(sizeof(*req), GFP_KERNEL);
-	if (!skb)
-		return -ENOMEM;
-	req = (struct cpl_srq_table_req *)
-		__skb_put_zero(skb, sizeof(*req));
-	INIT_TP_WR(req, 0);
-	OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SRQ_TABLE_REQ,
-					      TID_TID_V(srq_idx) |
-				TID_QID_V(adap->sge.fw_evtq.abs_id)));
-	req->idx = srq_idx;
-
-	mutex_lock(&s->lock);
-
-	s->entryp = entryp;
-	t4_mgmt_tx(adap, skb);
-
-	rc = wait_for_completion_timeout(&s->comp, SRQ_WAIT_TO);
-	if (rc)
-		rc = 0;
-	else /* !rc means we timed out */
-		rc = -ETIMEDOUT;
-
-	WARN_ON_ONCE(entryp->idx != srq_idx);
-	mutex_unlock(&s->lock);
-out:
-	return rc;
-}
-EXPORT_SYMBOL(cxgb4_get_srq_entry);
-
 void do_srq_table_rpl(struct adapter *adap,
 		      const struct cpl_srq_table_rpl *rpl)
 {
diff --git a/drivers/net/ethernet/chelsio/cxgb4/srq.h b/drivers/net/ethernet/chelsio/cxgb4/srq.h
index ec85cf93865a..d9f04bd5ffa3 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/srq.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/srq.h
@@ -58,8 +58,6 @@ struct srq_data {
 };
 
 struct srq_data *t4_init_srq(int srq_size);
-int cxgb4_get_srq_entry(struct net_device *dev,
-			int srq_idx, struct srq_entry *entryp);
 void do_srq_table_rpl(struct adapter *adap,
 		      const struct cpl_srq_table_rpl *rpl);
 #endif  /* __CXGB4_SRQ_H */
-- 
2.47.0


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

* [PATCH net-next 4/6] cxgb4: Remove unused cxgb4_scsi_init
  2024-10-13 20:38 [PATCH net-next 0/6] cxgb4: Deadcode removal linux
                   ` (2 preceding siblings ...)
  2024-10-13 20:38 ` [PATCH net-next 3/6] cxgb4: Remove unused cxgb4_get_srq_entry linux
@ 2024-10-13 20:38 ` linux
  2024-10-14  3:34   ` Kalesh Anakkur Purayil
  2024-10-13 20:38 ` [PATCH net-next 5/6] cxgb4: Remove unused cxgb4_l2t_alloc_switching linux
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 15+ messages in thread
From: linux @ 2024-10-13 20:38 UTC (permalink / raw)
  To: bharat, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Dr. David Alan Gilbert

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

cxgb4_iscsi_init() has been unused since 2016's commit
5999299f1ce9 ("cxgb3i,cxgb4i,libcxgbi: remove iSCSI DDP support")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 12 ------------
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h  |  2 --
 2 files changed, 14 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 2418645c8823..97a261d5357e 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -2188,18 +2188,6 @@ void cxgb4_get_tcp_stats(struct pci_dev *pdev, struct tp_tcp_stats *v4,
 }
 EXPORT_SYMBOL(cxgb4_get_tcp_stats);
 
-void cxgb4_iscsi_init(struct net_device *dev, unsigned int tag_mask,
-		      const unsigned int *pgsz_order)
-{
-	struct adapter *adap = netdev2adap(dev);
-
-	t4_write_reg(adap, ULP_RX_ISCSI_TAGMASK_A, tag_mask);
-	t4_write_reg(adap, ULP_RX_ISCSI_PSZ_A, HPZ0_V(pgsz_order[0]) |
-		     HPZ1_V(pgsz_order[1]) | HPZ2_V(pgsz_order[2]) |
-		     HPZ3_V(pgsz_order[3]));
-}
-EXPORT_SYMBOL(cxgb4_iscsi_init);
-
 int cxgb4_flush_eq_cache(struct net_device *dev)
 {
 	struct adapter *adap = netdev2adap(dev);
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h
index d8cafaa7ddb4..d7713038386c 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h
@@ -518,8 +518,6 @@ unsigned int cxgb4_best_aligned_mtu(const unsigned short *mtus,
 				    unsigned int *mtu_idxp);
 void cxgb4_get_tcp_stats(struct pci_dev *pdev, struct tp_tcp_stats *v4,
 			 struct tp_tcp_stats *v6);
-void cxgb4_iscsi_init(struct net_device *dev, unsigned int tag_mask,
-		      const unsigned int *pgsz_order);
 struct sk_buff *cxgb4_pktgl_to_skb(const struct pkt_gl *gl,
 				   unsigned int skb_len, unsigned int pull_len);
 int cxgb4_sync_txq_pidx(struct net_device *dev, u16 qid, u16 pidx, u16 size);
-- 
2.47.0


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

* [PATCH net-next 5/6] cxgb4: Remove unused cxgb4_l2t_alloc_switching
  2024-10-13 20:38 [PATCH net-next 0/6] cxgb4: Deadcode removal linux
                   ` (3 preceding siblings ...)
  2024-10-13 20:38 ` [PATCH net-next 4/6] cxgb4: Remove unused cxgb4_scsi_init linux
@ 2024-10-13 20:38 ` linux
  2024-10-14  3:36   ` Kalesh Anakkur Purayil
  2024-10-13 20:38 ` [PATCH net-next 6/6] cxgb4: Remove unused t4_free_ofld_rxqs linux
  2024-10-16  0:00 ` [PATCH net-next 0/6] cxgb4: Deadcode removal patchwork-bot+netdevbpf
  6 siblings, 1 reply; 15+ messages in thread
From: linux @ 2024-10-13 20:38 UTC (permalink / raw)
  To: bharat, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Dr. David Alan Gilbert

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

cxgb4_l2t_alloc_switching() has been unused since it was added in
commit f7502659cec8 ("cxgb4: Add API to alloc l2t entry; also update
existing ones")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/net/ethernet/chelsio/cxgb4/l2t.c | 19 -------------------
 drivers/net/ethernet/chelsio/cxgb4/l2t.h |  2 --
 2 files changed, 21 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/l2t.c b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
index 1e5f5b1a22a6..c02b4e9c06b2 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/l2t.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/l2t.c
@@ -608,25 +608,6 @@ struct l2t_entry *t4_l2t_alloc_switching(struct adapter *adap, u16 vlan,
 	return e;
 }
 
-/**
- * cxgb4_l2t_alloc_switching - Allocates an L2T entry for switch filters
- * @dev: net_device pointer
- * @vlan: VLAN Id
- * @port: Associated port
- * @dmac: Destination MAC address to add to L2T
- * Returns pointer to the allocated l2t entry
- *
- * Allocates an L2T entry for use by switching rule of a filter
- */
-struct l2t_entry *cxgb4_l2t_alloc_switching(struct net_device *dev, u16 vlan,
-					    u8 port, u8 *dmac)
-{
-	struct adapter *adap = netdev2adap(dev);
-
-	return t4_l2t_alloc_switching(adap, vlan, port, dmac);
-}
-EXPORT_SYMBOL(cxgb4_l2t_alloc_switching);
-
 struct l2t_data *t4_init_l2t(unsigned int l2t_start, unsigned int l2t_end)
 {
 	unsigned int l2t_size;
diff --git a/drivers/net/ethernet/chelsio/cxgb4/l2t.h b/drivers/net/ethernet/chelsio/cxgb4/l2t.h
index 340fecb28a13..8aad7e9dee6d 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/l2t.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/l2t.h
@@ -115,8 +115,6 @@ struct l2t_entry *cxgb4_l2t_get(struct l2t_data *d, struct neighbour *neigh,
 				unsigned int priority);
 u64 cxgb4_select_ntuple(struct net_device *dev,
 			const struct l2t_entry *l2t);
-struct l2t_entry *cxgb4_l2t_alloc_switching(struct net_device *dev, u16 vlan,
-					    u8 port, u8 *dmac);
 void t4_l2t_update(struct adapter *adap, struct neighbour *neigh);
 struct l2t_entry *t4_l2t_alloc_switching(struct adapter *adap, u16 vlan,
 					 u8 port, u8 *dmac);
-- 
2.47.0


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

* [PATCH net-next 6/6] cxgb4: Remove unused t4_free_ofld_rxqs
  2024-10-13 20:38 [PATCH net-next 0/6] cxgb4: Deadcode removal linux
                   ` (4 preceding siblings ...)
  2024-10-13 20:38 ` [PATCH net-next 5/6] cxgb4: Remove unused cxgb4_l2t_alloc_switching linux
@ 2024-10-13 20:38 ` linux
  2024-10-14  3:31   ` Kalesh Anakkur Purayil
  2024-10-16  0:00 ` [PATCH net-next 0/6] cxgb4: Deadcode removal patchwork-bot+netdevbpf
  6 siblings, 1 reply; 15+ messages in thread
From: linux @ 2024-10-13 20:38 UTC (permalink / raw)
  To: bharat, davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Dr. David Alan Gilbert

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

t4_free_ofld_rxqs() has been unused since
commit 0fbc81b3ad51 ("chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources
dynamically for all cxgb4 ULD's")

Remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4.h |  1 -
 drivers/net/ethernet/chelsio/cxgb4/sge.c   | 16 ----------------
 2 files changed, 17 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
index 1c302dfd6503..75bd69ff61a8 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
@@ -1608,7 +1608,6 @@ void t4_os_portmod_changed(struct adapter *adap, int port_id);
 void t4_os_link_changed(struct adapter *adap, int port_id, int link_stat);
 
 void t4_free_sge_resources(struct adapter *adap);
-void t4_free_ofld_rxqs(struct adapter *adap, int n, struct sge_ofld_rxq *q);
 irq_handler_t t4_intr_handler(struct adapter *adap);
 netdev_tx_t t4_start_xmit(struct sk_buff *skb, struct net_device *dev);
 int cxgb4_selftest_lb_pkt(struct net_device *netdev);
diff --git a/drivers/net/ethernet/chelsio/cxgb4/sge.c b/drivers/net/ethernet/chelsio/cxgb4/sge.c
index de52bcb884c4..a7d76a8ed050 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/sge.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/sge.c
@@ -4874,22 +4874,6 @@ void free_rspq_fl(struct adapter *adap, struct sge_rspq *rq,
 	}
 }
 
-/**
- *      t4_free_ofld_rxqs - free a block of consecutive Rx queues
- *      @adap: the adapter
- *      @n: number of queues
- *      @q: pointer to first queue
- *
- *      Release the resources of a consecutive block of offload Rx queues.
- */
-void t4_free_ofld_rxqs(struct adapter *adap, int n, struct sge_ofld_rxq *q)
-{
-	for ( ; n; n--, q++)
-		if (q->rspq.desc)
-			free_rspq_fl(adap, &q->rspq,
-				     q->fl.size ? &q->fl : NULL);
-}
-
 void t4_sge_free_ethofld_txq(struct adapter *adap, struct sge_eohw_txq *txq)
 {
 	if (txq->q.desc) {
-- 
2.47.0


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

* Re: [PATCH net-next 6/6] cxgb4: Remove unused t4_free_ofld_rxqs
  2024-10-13 20:38 ` [PATCH net-next 6/6] cxgb4: Remove unused t4_free_ofld_rxqs linux
@ 2024-10-14  3:31   ` Kalesh Anakkur Purayil
  2024-10-14 11:21     ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 15+ messages in thread
From: Kalesh Anakkur Purayil @ 2024-10-14  3:31 UTC (permalink / raw)
  To: linux; +Cc: bharat, davem, edumazet, kuba, pabeni, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

On Mon, Oct 14, 2024 at 2:10 AM <linux@treblig.org> wrote:
>
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> t4_free_ofld_rxqs() has been unused since
> commit 0fbc81b3ad51 ("chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources
> dynamically for all cxgb4 ULD's")
>
> Remove it.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>


-- 
Regards,
Kalesh A P

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4239 bytes --]

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

* Re: [PATCH net-next 3/6] cxgb4: Remove unused cxgb4_get_srq_entry
  2024-10-13 20:38 ` [PATCH net-next 3/6] cxgb4: Remove unused cxgb4_get_srq_entry linux
@ 2024-10-14  3:33   ` Kalesh Anakkur Purayil
  0 siblings, 0 replies; 15+ messages in thread
From: Kalesh Anakkur Purayil @ 2024-10-14  3:33 UTC (permalink / raw)
  To: linux; +Cc: bharat, davem, edumazet, kuba, pabeni, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 749 bytes --]

On Mon, Oct 14, 2024 at 2:09 AM <linux@treblig.org> wrote:
>
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> cxgb4_get_srq_entry() has been unused since 2018's commit
> e47094751ddc ("cxgb4: Add support to initialise/read SRQ entries")
> which added it.
>
> Remove it.
>
> Note: I'm a bit suspicious whether any of the srq code in there
> actually does anything useful;  without this get I can't see anything
> that reads the data, so perhaps the whole thing should go?
> But that however would remove one of the opcode handlers, and I have
> no way to test that.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>


-- 
Regards,
Kalesh A P

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4239 bytes --]

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

* Re: [PATCH net-next 4/6] cxgb4: Remove unused cxgb4_scsi_init
  2024-10-13 20:38 ` [PATCH net-next 4/6] cxgb4: Remove unused cxgb4_scsi_init linux
@ 2024-10-14  3:34   ` Kalesh Anakkur Purayil
  0 siblings, 0 replies; 15+ messages in thread
From: Kalesh Anakkur Purayil @ 2024-10-14  3:34 UTC (permalink / raw)
  To: linux; +Cc: bharat, davem, edumazet, kuba, pabeni, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 423 bytes --]

On Mon, Oct 14, 2024 at 2:09 AM <linux@treblig.org> wrote:
>
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> cxgb4_iscsi_init() has been unused since 2016's commit
> 5999299f1ce9 ("cxgb3i,cxgb4i,libcxgbi: remove iSCSI DDP support")
>
> Remove it.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

-- 
Regards,
Kalesh A P

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4239 bytes --]

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

* Re: [PATCH net-next 1/6] cxgb4: Remove unused cxgb4_alloc/free_encap_mac_filt
  2024-10-13 20:38 ` [PATCH net-next 1/6] cxgb4: Remove unused cxgb4_alloc/free_encap_mac_filt linux
@ 2024-10-14  3:35   ` Kalesh Anakkur Purayil
  0 siblings, 0 replies; 15+ messages in thread
From: Kalesh Anakkur Purayil @ 2024-10-14  3:35 UTC (permalink / raw)
  To: linux; +Cc: bharat, davem, edumazet, kuba, pabeni, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 460 bytes --]

On Mon, Oct 14, 2024 at 2:10 AM <linux@treblig.org> wrote:
>
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> cxgb4_alloc_encap_mac_filt() and cxgb4_free_encap_mac_filt() have been
> unused since
> commit 28b3870578ef ("cxgb4: Re-work the logic for mps refcounting")
>
> Remove them.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

-- 
Regards,
Kalesh A P

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4239 bytes --]

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

* Re: [PATCH net-next 5/6] cxgb4: Remove unused cxgb4_l2t_alloc_switching
  2024-10-13 20:38 ` [PATCH net-next 5/6] cxgb4: Remove unused cxgb4_l2t_alloc_switching linux
@ 2024-10-14  3:36   ` Kalesh Anakkur Purayil
  0 siblings, 0 replies; 15+ messages in thread
From: Kalesh Anakkur Purayil @ 2024-10-14  3:36 UTC (permalink / raw)
  To: linux; +Cc: bharat, davem, edumazet, kuba, pabeni, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 458 bytes --]

On Mon, Oct 14, 2024 at 2:10 AM <linux@treblig.org> wrote:
>
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> cxgb4_l2t_alloc_switching() has been unused since it was added in
> commit f7502659cec8 ("cxgb4: Add API to alloc l2t entry; also update
> existing ones")
>
> Remove it.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>


-- 
Regards,
Kalesh A P

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4239 bytes --]

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

* Re: [PATCH net-next 2/6] cxgb4: Remove unused cxgb4_alloc/free_raw_mac_filt
  2024-10-13 20:38 ` [PATCH net-next 2/6] cxgb4: Remove unused cxgb4_alloc/free_raw_mac_filt linux
@ 2024-10-14  3:37   ` Kalesh Anakkur Purayil
  0 siblings, 0 replies; 15+ messages in thread
From: Kalesh Anakkur Purayil @ 2024-10-14  3:37 UTC (permalink / raw)
  To: linux; +Cc: bharat, davem, edumazet, kuba, pabeni, netdev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 558 bytes --]

On Mon, Oct 14, 2024 at 2:09 AM <linux@treblig.org> wrote:
>
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
>
> cxgb4_alloc_raw_mac_filt() and cxgb4_free_raw_mac_filt() have been
> unused since they were added in 2019 commit
> 5fab51581f62 ("cxgb4: Add MPS TCAM refcounting for raw mac filters")
>
> Remove them.
>
> This was also the last use of cxgb4_mps_ref_dec().
> Remove it.
>
> Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>

Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

-- 
Regards,
Kalesh A P

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4239 bytes --]

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

* Re: [PATCH net-next 6/6] cxgb4: Remove unused t4_free_ofld_rxqs
  2024-10-14  3:31   ` Kalesh Anakkur Purayil
@ 2024-10-14 11:21     ` Dr. David Alan Gilbert
  0 siblings, 0 replies; 15+ messages in thread
From: Dr. David Alan Gilbert @ 2024-10-14 11:21 UTC (permalink / raw)
  To: Kalesh Anakkur Purayil
  Cc: bharat, davem, edumazet, kuba, pabeni, netdev, linux-kernel

* Kalesh Anakkur Purayil (kalesh-anakkur.purayil@broadcom.com) wrote:
> On Mon, Oct 14, 2024 at 2:10 AM <linux@treblig.org> wrote:
> >
> > From: "Dr. David Alan Gilbert" <linux@treblig.org>
> >
> > t4_free_ofld_rxqs() has been unused since
> > commit 0fbc81b3ad51 ("chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources
> > dynamically for all cxgb4 ULD's")
> >
> > Remove it.
> >
> > Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
> 
> Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>

Thanks for the quick reviews!

Dave

> 
> -- 
> Regards,
> Kalesh A P


-- 
 -----Open up your eyes, open up your mind, open up your code -------   
/ Dr. David Alan Gilbert    |       Running GNU/Linux       | Happy  \ 
\        dave @ treblig.org |                               | In Hex /
 \ _________________________|_____ http://www.treblig.org   |_______/

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

* Re: [PATCH net-next 0/6] cxgb4: Deadcode removal
  2024-10-13 20:38 [PATCH net-next 0/6] cxgb4: Deadcode removal linux
                   ` (5 preceding siblings ...)
  2024-10-13 20:38 ` [PATCH net-next 6/6] cxgb4: Remove unused t4_free_ofld_rxqs linux
@ 2024-10-16  0:00 ` patchwork-bot+netdevbpf
  6 siblings, 0 replies; 15+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-10-16  0:00 UTC (permalink / raw)
  To: Dr. David Alan Gilbert
  Cc: bharat, davem, edumazet, kuba, pabeni, netdev, linux-kernel

Hello:

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

On Sun, 13 Oct 2024 21:38:25 +0100 you wrote:
> From: "Dr. David Alan Gilbert" <linux@treblig.org>
> 
> Hi,
>   This is a bunch of deadcode removal in cxgb4.
> It's all complete function removal rather than any actual change to
> logic.
> 
> [...]

Here is the summary with links:
  - [net-next,1/6] cxgb4: Remove unused cxgb4_alloc/free_encap_mac_filt
    https://git.kernel.org/netdev/net-next/c/65950f275f4e
  - [net-next,2/6] cxgb4: Remove unused cxgb4_alloc/free_raw_mac_filt
    https://git.kernel.org/netdev/net-next/c/b4701c6359c8
  - [net-next,3/6] cxgb4: Remove unused cxgb4_get_srq_entry
    https://git.kernel.org/netdev/net-next/c/10f6ef31f861
  - [net-next,4/6] cxgb4: Remove unused cxgb4_scsi_init
    https://git.kernel.org/netdev/net-next/c/835c16d137ee
  - [net-next,5/6] cxgb4: Remove unused cxgb4_l2t_alloc_switching
    https://git.kernel.org/netdev/net-next/c/625bb8a9e100
  - [net-next,6/6] cxgb4: Remove unused t4_free_ofld_rxqs
    https://git.kernel.org/netdev/net-next/c/73929750f236

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] 15+ messages in thread

end of thread, other threads:[~2024-10-16  0:00 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-13 20:38 [PATCH net-next 0/6] cxgb4: Deadcode removal linux
2024-10-13 20:38 ` [PATCH net-next 1/6] cxgb4: Remove unused cxgb4_alloc/free_encap_mac_filt linux
2024-10-14  3:35   ` Kalesh Anakkur Purayil
2024-10-13 20:38 ` [PATCH net-next 2/6] cxgb4: Remove unused cxgb4_alloc/free_raw_mac_filt linux
2024-10-14  3:37   ` Kalesh Anakkur Purayil
2024-10-13 20:38 ` [PATCH net-next 3/6] cxgb4: Remove unused cxgb4_get_srq_entry linux
2024-10-14  3:33   ` Kalesh Anakkur Purayil
2024-10-13 20:38 ` [PATCH net-next 4/6] cxgb4: Remove unused cxgb4_scsi_init linux
2024-10-14  3:34   ` Kalesh Anakkur Purayil
2024-10-13 20:38 ` [PATCH net-next 5/6] cxgb4: Remove unused cxgb4_l2t_alloc_switching linux
2024-10-14  3:36   ` Kalesh Anakkur Purayil
2024-10-13 20:38 ` [PATCH net-next 6/6] cxgb4: Remove unused t4_free_ofld_rxqs linux
2024-10-14  3:31   ` Kalesh Anakkur Purayil
2024-10-14 11:21     ` Dr. David Alan Gilbert
2024-10-16  0:00 ` [PATCH net-next 0/6] cxgb4: Deadcode removal 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).