Skip to content

Commit

Permalink
Merge branch 'cxgb4-deadcode-removal'
Browse files Browse the repository at this point in the history
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/20241013203831.88051-1-linux@treblig.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Oct 15, 2024
2 parents 6d85870 + 7392975 commit 0444596
Show file tree
Hide file tree
Showing 9 changed files with 0 additions and 232 deletions.
23 changes: 0 additions & 23 deletions drivers/net/ethernet/chelsio/cxgb4/cxgb4.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -2141,28 +2140,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,
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);
Expand Down
12 changes: 0 additions & 12 deletions drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
98 changes: 0 additions & 98 deletions drivers/net/ethernet/chelsio/cxgb4/cxgb4_mps.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -141,82 +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_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);
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/ethernet/chelsio/cxgb4/cxgb4_uld.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 0 additions & 19 deletions drivers/net/ethernet/chelsio/cxgb4/l2t.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/ethernet/chelsio/cxgb4/l2t.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
16 changes: 0 additions & 16 deletions drivers/net/ethernet/chelsio/cxgb4/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
58 changes: 0 additions & 58 deletions drivers/net/ethernet/chelsio/cxgb4/srq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/ethernet/chelsio/cxgb4/srq.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 0444596

Please sign in to comment.