Skip to content

Commit 0444596

Browse files
committed
Merge branch 'cxgb4-deadcode-removal'
Dr. David Alan Gilbert says: ==================== cxgb4: Deadcode removal 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. ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 6d85870 + 7392975 commit 0444596

File tree

9 files changed

+0
-232
lines changed

9 files changed

+0
-232
lines changed

drivers/net/ethernet/chelsio/cxgb4/cxgb4.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,6 @@ void t4_os_portmod_changed(struct adapter *adap, int port_id);
16081608
void t4_os_link_changed(struct adapter *adap, int port_id, int link_stat);
16091609

16101610
void t4_free_sge_resources(struct adapter *adap);
1611-
void t4_free_ofld_rxqs(struct adapter *adap, int n, struct sge_ofld_rxq *q);
16121611
irq_handler_t t4_intr_handler(struct adapter *adap);
16131612
netdev_tx_t t4_start_xmit(struct sk_buff *skb, struct net_device *dev);
16141613
int cxgb4_selftest_lb_pkt(struct net_device *netdev);
@@ -2141,28 +2140,6 @@ int cxgb4_free_mac_filt(struct adapter *adap, unsigned int viid,
21412140
unsigned int naddr, const u8 **addr, bool sleep_ok);
21422141
int cxgb4_init_mps_ref_entries(struct adapter *adap);
21432142
void cxgb4_free_mps_ref_entries(struct adapter *adap);
2144-
int cxgb4_alloc_encap_mac_filt(struct adapter *adap, unsigned int viid,
2145-
const u8 *addr, const u8 *mask,
2146-
unsigned int vni, unsigned int vni_mask,
2147-
u8 dip_hit, u8 lookup_type, bool sleep_ok);
2148-
int cxgb4_free_encap_mac_filt(struct adapter *adap, unsigned int viid,
2149-
int idx, bool sleep_ok);
2150-
int cxgb4_free_raw_mac_filt(struct adapter *adap,
2151-
unsigned int viid,
2152-
const u8 *addr,
2153-
const u8 *mask,
2154-
unsigned int idx,
2155-
u8 lookup_type,
2156-
u8 port_id,
2157-
bool sleep_ok);
2158-
int cxgb4_alloc_raw_mac_filt(struct adapter *adap,
2159-
unsigned int viid,
2160-
const u8 *addr,
2161-
const u8 *mask,
2162-
unsigned int idx,
2163-
u8 lookup_type,
2164-
u8 port_id,
2165-
bool sleep_ok);
21662143
int cxgb4_update_mac_filt(struct port_info *pi, unsigned int viid,
21672144
int *tcam_idx, const u8 *addr,
21682145
bool persistent, u8 *smt_idx);

drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2188,18 +2188,6 @@ void cxgb4_get_tcp_stats(struct pci_dev *pdev, struct tp_tcp_stats *v4,
21882188
}
21892189
EXPORT_SYMBOL(cxgb4_get_tcp_stats);
21902190

2191-
void cxgb4_iscsi_init(struct net_device *dev, unsigned int tag_mask,
2192-
const unsigned int *pgsz_order)
2193-
{
2194-
struct adapter *adap = netdev2adap(dev);
2195-
2196-
t4_write_reg(adap, ULP_RX_ISCSI_TAGMASK_A, tag_mask);
2197-
t4_write_reg(adap, ULP_RX_ISCSI_PSZ_A, HPZ0_V(pgsz_order[0]) |
2198-
HPZ1_V(pgsz_order[1]) | HPZ2_V(pgsz_order[2]) |
2199-
HPZ3_V(pgsz_order[3]));
2200-
}
2201-
EXPORT_SYMBOL(cxgb4_iscsi_init);
2202-
22032191
int cxgb4_flush_eq_cache(struct net_device *dev)
22042192
{
22052193
struct adapter *adap = netdev2adap(dev);

drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c

Lines changed: 0 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,6 @@ static int cxgb4_mps_ref_dec_by_mac(struct adapter *adap,
2828
return ret;
2929
}
3030

31-
static int cxgb4_mps_ref_dec(struct adapter *adap, u16 idx)
32-
{
33-
struct mps_entries_ref *mps_entry, *tmp;
34-
int ret = -EINVAL;
35-
36-
spin_lock(&adap->mps_ref_lock);
37-
list_for_each_entry_safe(mps_entry, tmp, &adap->mps_ref, list) {
38-
if (mps_entry->idx == idx) {
39-
if (!refcount_dec_and_test(&mps_entry->refcnt)) {
40-
spin_unlock(&adap->mps_ref_lock);
41-
return -EBUSY;
42-
}
43-
list_del(&mps_entry->list);
44-
kfree(mps_entry);
45-
ret = 0;
46-
break;
47-
}
48-
}
49-
spin_unlock(&adap->mps_ref_lock);
50-
return ret;
51-
}
52-
5331
static int cxgb4_mps_ref_inc(struct adapter *adap, const u8 *mac_addr,
5432
u16 idx, const u8 *mask)
5533
{
@@ -141,82 +119,6 @@ int cxgb4_update_mac_filt(struct port_info *pi, unsigned int viid,
141119
return ret;
142120
}
143121

144-
int cxgb4_free_raw_mac_filt(struct adapter *adap,
145-
unsigned int viid,
146-
const u8 *addr,
147-
const u8 *mask,
148-
unsigned int idx,
149-
u8 lookup_type,
150-
u8 port_id,
151-
bool sleep_ok)
152-
{
153-
int ret = 0;
154-
155-
if (!cxgb4_mps_ref_dec(adap, idx))
156-
ret = t4_free_raw_mac_filt(adap, viid, addr,
157-
mask, idx, lookup_type,
158-
port_id, sleep_ok);
159-
160-
return ret;
161-
}
162-
163-
int cxgb4_alloc_raw_mac_filt(struct adapter *adap,
164-
unsigned int viid,
165-
const u8 *addr,
166-
const u8 *mask,
167-
unsigned int idx,
168-
u8 lookup_type,
169-
u8 port_id,
170-
bool sleep_ok)
171-
{
172-
int ret;
173-
174-
ret = t4_alloc_raw_mac_filt(adap, viid, addr,
175-
mask, idx, lookup_type,
176-
port_id, sleep_ok);
177-
if (ret < 0)
178-
return ret;
179-
180-
if (cxgb4_mps_ref_inc(adap, addr, ret, mask)) {
181-
ret = -ENOMEM;
182-
t4_free_raw_mac_filt(adap, viid, addr,
183-
mask, idx, lookup_type,
184-
port_id, sleep_ok);
185-
}
186-
187-
return ret;
188-
}
189-
190-
int cxgb4_free_encap_mac_filt(struct adapter *adap, unsigned int viid,
191-
int idx, bool sleep_ok)
192-
{
193-
int ret = 0;
194-
195-
if (!cxgb4_mps_ref_dec(adap, idx))
196-
ret = t4_free_encap_mac_filt(adap, viid, idx, sleep_ok);
197-
198-
return ret;
199-
}
200-
201-
int cxgb4_alloc_encap_mac_filt(struct adapter *adap, unsigned int viid,
202-
const u8 *addr, const u8 *mask,
203-
unsigned int vni, unsigned int vni_mask,
204-
u8 dip_hit, u8 lookup_type, bool sleep_ok)
205-
{
206-
int ret;
207-
208-
ret = t4_alloc_encap_mac_filt(adap, viid, addr, mask, vni, vni_mask,
209-
dip_hit, lookup_type, sleep_ok);
210-
if (ret < 0)
211-
return ret;
212-
213-
if (cxgb4_mps_ref_inc(adap, addr, ret, mask)) {
214-
ret = -ENOMEM;
215-
t4_free_encap_mac_filt(adap, viid, ret, sleep_ok);
216-
}
217-
return ret;
218-
}
219-
220122
int cxgb4_init_mps_ref_entries(struct adapter *adap)
221123
{
222124
spin_lock_init(&adap->mps_ref_lock);

drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,8 +518,6 @@ unsigned int cxgb4_best_aligned_mtu(const unsigned short *mtus,
518518
unsigned int *mtu_idxp);
519519
void cxgb4_get_tcp_stats(struct pci_dev *pdev, struct tp_tcp_stats *v4,
520520
struct tp_tcp_stats *v6);
521-
void cxgb4_iscsi_init(struct net_device *dev, unsigned int tag_mask,
522-
const unsigned int *pgsz_order);
523521
struct sk_buff *cxgb4_pktgl_to_skb(const struct pkt_gl *gl,
524522
unsigned int skb_len, unsigned int pull_len);
525523
int cxgb4_sync_txq_pidx(struct net_device *dev, u16 qid, u16 pidx, u16 size);

drivers/net/ethernet/chelsio/cxgb4/l2t.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -608,25 +608,6 @@ struct l2t_entry *t4_l2t_alloc_switching(struct adapter *adap, u16 vlan,
608608
return e;
609609
}
610610

611-
/**
612-
* cxgb4_l2t_alloc_switching - Allocates an L2T entry for switch filters
613-
* @dev: net_device pointer
614-
* @vlan: VLAN Id
615-
* @port: Associated port
616-
* @dmac: Destination MAC address to add to L2T
617-
* Returns pointer to the allocated l2t entry
618-
*
619-
* Allocates an L2T entry for use by switching rule of a filter
620-
*/
621-
struct l2t_entry *cxgb4_l2t_alloc_switching(struct net_device *dev, u16 vlan,
622-
u8 port, u8 *dmac)
623-
{
624-
struct adapter *adap = netdev2adap(dev);
625-
626-
return t4_l2t_alloc_switching(adap, vlan, port, dmac);
627-
}
628-
EXPORT_SYMBOL(cxgb4_l2t_alloc_switching);
629-
630611
struct l2t_data *t4_init_l2t(unsigned int l2t_start, unsigned int l2t_end)
631612
{
632613
unsigned int l2t_size;

drivers/net/ethernet/chelsio/cxgb4/l2t.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,6 @@ struct l2t_entry *cxgb4_l2t_get(struct l2t_data *d, struct neighbour *neigh,
115115
unsigned int priority);
116116
u64 cxgb4_select_ntuple(struct net_device *dev,
117117
const struct l2t_entry *l2t);
118-
struct l2t_entry *cxgb4_l2t_alloc_switching(struct net_device *dev, u16 vlan,
119-
u8 port, u8 *dmac);
120118
void t4_l2t_update(struct adapter *adap, struct neighbour *neigh);
121119
struct l2t_entry *t4_l2t_alloc_switching(struct adapter *adap, u16 vlan,
122120
u8 port, u8 *dmac);

drivers/net/ethernet/chelsio/cxgb4/sge.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4874,22 +4874,6 @@ void free_rspq_fl(struct adapter *adap, struct sge_rspq *rq,
48744874
}
48754875
}
48764876

4877-
/**
4878-
* t4_free_ofld_rxqs - free a block of consecutive Rx queues
4879-
* @adap: the adapter
4880-
* @n: number of queues
4881-
* @q: pointer to first queue
4882-
*
4883-
* Release the resources of a consecutive block of offload Rx queues.
4884-
*/
4885-
void t4_free_ofld_rxqs(struct adapter *adap, int n, struct sge_ofld_rxq *q)
4886-
{
4887-
for ( ; n; n--, q++)
4888-
if (q->rspq.desc)
4889-
free_rspq_fl(adap, &q->rspq,
4890-
q->fl.size ? &q->fl : NULL);
4891-
}
4892-
48934877
void t4_sge_free_ethofld_txq(struct adapter *adap, struct sge_eohw_txq *txq)
48944878
{
48954879
if (txq->q.desc) {

drivers/net/ethernet/chelsio/cxgb4/srq.c

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -51,64 +51,6 @@ struct srq_data *t4_init_srq(int srq_size)
5151
return s;
5252
}
5353

54-
/* cxgb4_get_srq_entry: read the SRQ table entry
55-
* @dev: Pointer to the net_device
56-
* @idx: Index to the srq
57-
* @entryp: pointer to the srq entry
58-
*
59-
* Sends CPL_SRQ_TABLE_REQ message for the given index.
60-
* Contents will be returned in CPL_SRQ_TABLE_RPL message.
61-
*
62-
* Returns zero if the read is successful, else a error
63-
* number will be returned. Caller should not use the srq
64-
* entry if the return value is non-zero.
65-
*
66-
*
67-
*/
68-
int cxgb4_get_srq_entry(struct net_device *dev,
69-
int srq_idx, struct srq_entry *entryp)
70-
{
71-
struct cpl_srq_table_req *req;
72-
struct adapter *adap;
73-
struct sk_buff *skb;
74-
struct srq_data *s;
75-
int rc = -ENODEV;
76-
77-
adap = netdev2adap(dev);
78-
s = adap->srq;
79-
80-
if (!(adap->flags & CXGB4_FULL_INIT_DONE) || !s)
81-
goto out;
82-
83-
skb = alloc_skb(sizeof(*req), GFP_KERNEL);
84-
if (!skb)
85-
return -ENOMEM;
86-
req = (struct cpl_srq_table_req *)
87-
__skb_put_zero(skb, sizeof(*req));
88-
INIT_TP_WR(req, 0);
89-
OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_SRQ_TABLE_REQ,
90-
TID_TID_V(srq_idx) |
91-
TID_QID_V(adap->sge.fw_evtq.abs_id)));
92-
req->idx = srq_idx;
93-
94-
mutex_lock(&s->lock);
95-
96-
s->entryp = entryp;
97-
t4_mgmt_tx(adap, skb);
98-
99-
rc = wait_for_completion_timeout(&s->comp, SRQ_WAIT_TO);
100-
if (rc)
101-
rc = 0;
102-
else /* !rc means we timed out */
103-
rc = -ETIMEDOUT;
104-
105-
WARN_ON_ONCE(entryp->idx != srq_idx);
106-
mutex_unlock(&s->lock);
107-
out:
108-
return rc;
109-
}
110-
EXPORT_SYMBOL(cxgb4_get_srq_entry);
111-
11254
void do_srq_table_rpl(struct adapter *adap,
11355
const struct cpl_srq_table_rpl *rpl)
11456
{

drivers/net/ethernet/chelsio/cxgb4/srq.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ struct srq_data {
5858
};
5959

6060
struct srq_data *t4_init_srq(int srq_size);
61-
int cxgb4_get_srq_entry(struct net_device *dev,
62-
int srq_idx, struct srq_entry *entryp);
6361
void do_srq_table_rpl(struct adapter *adap,
6462
const struct cpl_srq_table_rpl *rpl);
6563
#endif /* __CXGB4_SRQ_H */

0 commit comments

Comments
 (0)