cxgb4: Deadcode removal
Subsystems (3)
cover cxgb4: Deadcode removal
From: "Dr. David Alan Gilbert" <[email protected]>
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
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(-)
Signature · 1 line
2.47.0
PATCH 2/6 cxgb4: Remove unused cxgb4_alloc/free_raw_mac_filt
From: "Dr. David Alan Gilbert" <[email protected]>
cxgb4_alloc_raw_mac_filt() and cxgb4_free_raw_mac_filt() have been unused since they were added in 2019 commit5fab51581f62 ("cxgb4: Add MPS TCAM refcounting for raw mac filters")
Remove them.
This was also the last use of cxgb4_mps_ref_dec(). Remove it.
--- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 16 ----- .../net/ethernet/chelsio/cxgb4/cxgb4_mps.c | 68 ------------------- 2 files changed, 84 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +0 -16
@@ -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);
drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c +0 -68
80 lines not on this page · raw message
Signature · 1 line
2.47.0
PATCH 3/6 cxgb4: Remove unused cxgb4_get_srq_entry
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
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.
--- drivers/net/ethernet/chelsio/cxgb4/srq.c | 58 ------------------------ drivers/net/ethernet/chelsio/cxgb4/srq.h | 2 - 2 files changed, 60 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/srq.c +0 -58
@@ -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) {
drivers/net/ethernet/chelsio/cxgb4/srq.h +0 -2
@@ -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 */
Signature · 1 line
2.47.0
PATCH 4/6 cxgb4: Remove unused cxgb4_scsi_init
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
cxgb4_iscsi_init() has been unused since 2016's commit 5999299f1ce9 ("cxgb3i,cxgb4i,libcxgbi: remove iSCSI DDP support")
Remove it.
--- drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 12 ------------ drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h | 2 -- 2 files changed, 14 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +0 -12
@@ -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);
drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h +0 -2
@@ -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);
Signature · 1 line
2.47.0
PATCH 5/6 cxgb4: Remove unused cxgb4_l2t_alloc_switching
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
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.
--- drivers/net/ethernet/chelsio/cxgb4/l2t.c | 19 ------------------- drivers/net/ethernet/chelsio/cxgb4/l2t.h | 2 -- 2 files changed, 21 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/l2t.c +0 -19
@@ -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;
drivers/net/ethernet/chelsio/cxgb4/l2t.h +0 -2
@@ -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);
Signature · 1 line
2.47.0
PATCH 6/6 cxgb4: Remove unused t4_free_ofld_rxqs
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
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.
--- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 1 - drivers/net/ethernet/chelsio/cxgb4/sge.c | 16 ---------------- 2 files changed, 17 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +0 -1
@@ -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);
drivers/net/ethernet/chelsio/cxgb4/sge.c +0 -16
@@ -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) {
Signature · 1 line
2.47.0
PATCH 1/6 cxgb4: Remove unused cxgb4_alloc/free_encap_mac_filt
In reply to [email protected]From: "Dr. David Alan Gilbert" <[email protected]>
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.
--- drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 6 ---- .../net/ethernet/chelsio/cxgb4/cxgb4_mps.c | 30 ------------------- 2 files changed, 36 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +0 -6
@@ -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,
drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c +0 -30
@@ -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);
Signature · 1 line
2.47.0
Re: [PATCH net-next 6/6] cxgb4: Remove unused t4_free_ofld_rxqs
In reply to [email protected]Quoted 10 lines · On Mon, Oct 14, 2024 at 2:10 AM <[email protected]> wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
t4_free_ofld_rxqs()has been unused since
commit0fbc81b3ad51("chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources dynamically for all cxgb4 ULD's")Remove it.
Signed-off-by Dr. David Alan Gilbert <[email protected]>
Signature · 2 lines
Regards, Kalesh A P
Re: [PATCH net-next 3/6] cxgb4: Remove unused cxgb4_get_srq_entry
In reply to [email protected]Quoted 9 lines · On Mon, Oct 14, 2024 at 2:09 AM <[email protected]> wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
cxgb4_get_srq_entry()has been unused since 2018's commite47094751ddc("cxgb4: Add support to initialise/read SRQ entries") which added it.Remove it.
Quoted 7 lines
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 <[email protected]>
Signature · 2 lines
Regards, Kalesh A P
Re: [PATCH net-next 4/6] cxgb4: Remove unused cxgb4_scsi_init
In reply to [email protected]Quoted 9 lines · On Mon, Oct 14, 2024 at 2:09 AM <[email protected]> wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
cxgb4_iscsi_init()has been unused since 2016's commit5999299f1ce9("cxgb3i,cxgb4i,libcxgbi: remove iSCSI DDP support")Remove it.
Signed-off-by Dr. David Alan Gilbert <[email protected]>
Signature · 2 lines
Regards, Kalesh A P
Re: [PATCH net-next 1/6] cxgb4: Remove unused cxgb4_alloc/free_encap_mac_filt
In reply to [email protected]Quoted 10 lines · On Mon, Oct 14, 2024 at 2:10 AM <[email protected]> wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
cxgb4_alloc_encap_mac_filt()andcxgb4_free_encap_mac_filt()have been unused since
commit28b3870578ef("cxgb4: Re-work the logic for mps refcounting")Remove them.
Signed-off-by Dr. David Alan Gilbert <[email protected]>
Signature · 2 lines
Regards, Kalesh A P
Re: [PATCH net-next 5/6] cxgb4: Remove unused cxgb4_l2t_alloc_switching
In reply to [email protected]Quoted 10 lines · On Mon, Oct 14, 2024 at 2:10 AM <[email protected]> wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
cxgb4_l2t_alloc_switching()has been unused since it was added in commitf7502659cec8("cxgb4: Add API to alloc l2t entry; also update existing ones")Remove it.
Signed-off-by Dr. David Alan Gilbert <[email protected]>
Signature · 2 lines
Regards, Kalesh A P
Re: [PATCH net-next 2/6] cxgb4: Remove unused cxgb4_alloc/free_raw_mac_filt
In reply to [email protected]Quoted 7 lines · On Mon, Oct 14, 2024 at 2:09 AM <[email protected]> wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
cxgb4_alloc_raw_mac_filt()andcxgb4_free_raw_mac_filt()have been unused since they were added in 2019 commit5fab51581f62("cxgb4: Add MPS TCAM refcounting for raw mac filters")
Quoted 6 lines
Remove them.
This was also the last use of
cxgb4_mps_ref_dec(). Remove it.Signed-off-by Dr. David Alan Gilbert <[email protected]>
Signature · 2 lines
Regards, Kalesh A P
Re: [PATCH net-next 6/6] cxgb4: Remove unused t4_free_ofld_rxqs
In reply to Kalesh Anakkur PurayilQuoted 8 lines · * Kalesh Anakkur Purayil ([email protected]) wrote:
Quoted 7 lines · On Mon, Oct 14, 2024 at 2:10 AM <[email protected]> wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
t4_free_ofld_rxqs()has been unused since
commit0fbc81b3ad51("chcr/cxgb4i/cxgbit/RDMA/cxgb4: Allocate resources dynamically for all cxgb4 ULD's")
Quoted 5 lines
Quoted 3 lines
Remove it.
Signed-off-by Dr. David Alan Gilbert <[email protected]>Reviewed-by Kalesh AP <[email protected]>
Thanks for the quick reviews!
Dave
Quoted 4 lines
Signature · 3 lines
-- Regards, Kalesh A P
Signature · 4 lines
-----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 |_______/
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 8 lines · On Sun, 13 Oct 2024 21:38:25 +0100 you wrote:
From: "Dr. David Alan Gilbert" <[email protected]>
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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html