Skip to content

Commit b855bcd

Browse files
pkitszelanguy11
authored andcommitted
iavf: remove some unused functions and pointless wrappers
Remove iavf_aq_get_rss_lut(), iavf_aq_get_rss_key(), iavf_vf_reset(). Remove some "OS specific memory free for shared code" wrappers ;) Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 61f723e commit b855bcd

5 files changed

Lines changed: 8 additions & 76 deletions

File tree

drivers/net/ethernet/intel/iavf/iavf_alloc.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ enum iavf_status iavf_free_dma_mem(struct iavf_hw *hw,
2828
struct iavf_dma_mem *mem);
2929
enum iavf_status iavf_allocate_virt_mem(struct iavf_hw *hw,
3030
struct iavf_virt_mem *mem, u32 size);
31-
enum iavf_status iavf_free_virt_mem(struct iavf_hw *hw,
32-
struct iavf_virt_mem *mem);
31+
void iavf_free_virt_mem(struct iavf_hw *hw, struct iavf_virt_mem *mem);
3332

3433
#endif /* _IAVF_ALLOC_H_ */

drivers/net/ethernet/intel/iavf/iavf_common.c

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ enum iavf_status iavf_set_mac_type(struct iavf_hw *hw)
3535
status = IAVF_ERR_DEVICE_NOT_SUPPORTED;
3636
}
3737

38-
hw_dbg(hw, "found mac: %d, returns: %d\n", hw->mac.type, status);
3938
return status;
4039
}
4140

@@ -397,23 +396,6 @@ static enum iavf_status iavf_aq_get_set_rss_lut(struct iavf_hw *hw,
397396
return status;
398397
}
399398

400-
/**
401-
* iavf_aq_get_rss_lut
402-
* @hw: pointer to the hardware structure
403-
* @vsi_id: vsi fw index
404-
* @pf_lut: for PF table set true, for VSI table set false
405-
* @lut: pointer to the lut buffer provided by the caller
406-
* @lut_size: size of the lut buffer
407-
*
408-
* get the RSS lookup table, PF or VSI type
409-
**/
410-
enum iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 vsi_id,
411-
bool pf_lut, u8 *lut, u16 lut_size)
412-
{
413-
return iavf_aq_get_set_rss_lut(hw, vsi_id, pf_lut, lut, lut_size,
414-
false);
415-
}
416-
417399
/**
418400
* iavf_aq_set_rss_lut
419401
* @hw: pointer to the hardware structure
@@ -472,19 +454,6 @@ iavf_status iavf_aq_get_set_rss_key(struct iavf_hw *hw, u16 vsi_id,
472454
return status;
473455
}
474456

475-
/**
476-
* iavf_aq_get_rss_key
477-
* @hw: pointer to the hw struct
478-
* @vsi_id: vsi fw index
479-
* @key: pointer to key info struct
480-
*
481-
**/
482-
enum iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 vsi_id,
483-
struct iavf_aqc_get_set_rss_key_data *key)
484-
{
485-
return iavf_aq_get_set_rss_key(hw, vsi_id, key, false);
486-
}
487-
488457
/**
489458
* iavf_aq_set_rss_key
490459
* @hw: pointer to the hw struct
@@ -828,17 +797,3 @@ void iavf_vf_parse_hw_config(struct iavf_hw *hw,
828797
vsi_res++;
829798
}
830799
}
831-
832-
/**
833-
* iavf_vf_reset
834-
* @hw: pointer to the hardware structure
835-
*
836-
* Send a VF_RESET message to the PF. Does not wait for response from PF
837-
* as none will be forthcoming. Immediately after calling this function,
838-
* the admin queue should be shut down and (optionally) reinitialized.
839-
**/
840-
enum iavf_status iavf_vf_reset(struct iavf_hw *hw)
841-
{
842-
return iavf_aq_send_msg_to_pf(hw, VIRTCHNL_OP_RESET_VF,
843-
0, NULL, 0, NULL);
844-
}

drivers/net/ethernet/intel/iavf/iavf_main.c

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,11 @@ enum iavf_status iavf_allocate_dma_mem_d(struct iavf_hw *hw,
192192
}
193193

194194
/**
195-
* iavf_free_dma_mem_d - OS specific memory free for shared code
195+
* iavf_free_dma_mem - wrapper for DMA memory freeing
196196
* @hw: pointer to the HW structure
197197
* @mem: ptr to mem struct to free
198198
**/
199-
enum iavf_status iavf_free_dma_mem_d(struct iavf_hw *hw,
200-
struct iavf_dma_mem *mem)
199+
enum iavf_status iavf_free_dma_mem(struct iavf_hw *hw, struct iavf_dma_mem *mem)
201200
{
202201
struct iavf_adapter *adapter = (struct iavf_adapter *)hw->back;
203202

@@ -209,13 +208,13 @@ enum iavf_status iavf_free_dma_mem_d(struct iavf_hw *hw,
209208
}
210209

211210
/**
212-
* iavf_allocate_virt_mem_d - OS specific memory alloc for shared code
211+
* iavf_allocate_virt_mem - virt memory alloc wrapper
213212
* @hw: pointer to the HW structure
214213
* @mem: ptr to mem struct to fill out
215214
* @size: size of memory requested
216215
**/
217-
enum iavf_status iavf_allocate_virt_mem_d(struct iavf_hw *hw,
218-
struct iavf_virt_mem *mem, u32 size)
216+
enum iavf_status iavf_allocate_virt_mem(struct iavf_hw *hw,
217+
struct iavf_virt_mem *mem, u32 size)
219218
{
220219
if (!mem)
221220
return IAVF_ERR_PARAM;
@@ -230,20 +229,13 @@ enum iavf_status iavf_allocate_virt_mem_d(struct iavf_hw *hw,
230229
}
231230

232231
/**
233-
* iavf_free_virt_mem_d - OS specific memory free for shared code
232+
* iavf_free_virt_mem - virt memory free wrapper
234233
* @hw: pointer to the HW structure
235234
* @mem: ptr to mem struct to free
236235
**/
237-
enum iavf_status iavf_free_virt_mem_d(struct iavf_hw *hw,
238-
struct iavf_virt_mem *mem)
236+
void iavf_free_virt_mem(struct iavf_hw *hw, struct iavf_virt_mem *mem)
239237
{
240-
if (!mem)
241-
return IAVF_ERR_PARAM;
242-
243-
/* it's ok to kfree a NULL pointer */
244238
kfree(mem->va);
245-
246-
return 0;
247239
}
248240

249241
/**

drivers/net/ethernet/intel/iavf/iavf_osdep.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@
1313
/* get readq/writeq support for 32 bit kernels, use the low-first version */
1414
#include <linux/io-64-nonatomic-lo-hi.h>
1515

16-
/* File to be the magic between shared code and
17-
* actual OS primitives
18-
*/
19-
20-
#define hw_dbg(hw, S, A...) do {} while (0)
21-
2216
#define wr32(a, reg, value) writel((value), ((a)->hw_addr + (reg)))
2317
#define rd32(a, reg) readl((a)->hw_addr + (reg))
2418

@@ -35,14 +29,11 @@ struct iavf_dma_mem {
3529

3630
#define iavf_allocate_dma_mem(h, m, unused, s, a) \
3731
iavf_allocate_dma_mem_d(h, m, s, a)
38-
#define iavf_free_dma_mem(h, m) iavf_free_dma_mem_d(h, m)
3932

4033
struct iavf_virt_mem {
4134
void *va;
4235
u32 size;
4336
};
44-
#define iavf_allocate_virt_mem(h, m, s) iavf_allocate_virt_mem_d(h, m, s)
45-
#define iavf_free_virt_mem(h, m) iavf_free_virt_mem_d(h, m)
4637

4738
#define iavf_debug(h, m, s, ...) \
4839
do { \

drivers/net/ethernet/intel/iavf/iavf_prototype.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,8 @@ enum iavf_status iavf_aq_queue_shutdown(struct iavf_hw *hw, bool unloading);
4040
const char *iavf_aq_str(struct iavf_hw *hw, enum iavf_admin_queue_err aq_err);
4141
const char *iavf_stat_str(struct iavf_hw *hw, enum iavf_status stat_err);
4242

43-
enum iavf_status iavf_aq_get_rss_lut(struct iavf_hw *hw, u16 seid,
44-
bool pf_lut, u8 *lut, u16 lut_size);
4543
enum iavf_status iavf_aq_set_rss_lut(struct iavf_hw *hw, u16 seid,
4644
bool pf_lut, u8 *lut, u16 lut_size);
47-
enum iavf_status iavf_aq_get_rss_key(struct iavf_hw *hw, u16 seid,
48-
struct iavf_aqc_get_set_rss_key_data *key);
4945
enum iavf_status iavf_aq_set_rss_key(struct iavf_hw *hw, u16 seid,
5046
struct iavf_aqc_get_set_rss_key_data *key);
5147

@@ -60,7 +56,6 @@ static inline struct iavf_rx_ptype_decoded decode_rx_desc_ptype(u8 ptype)
6056

6157
void iavf_vf_parse_hw_config(struct iavf_hw *hw,
6258
struct virtchnl_vf_resource *msg);
63-
enum iavf_status iavf_vf_reset(struct iavf_hw *hw);
6459
enum iavf_status iavf_aq_send_msg_to_pf(struct iavf_hw *hw,
6560
enum virtchnl_ops v_opcode,
6661
enum iavf_status v_retval,

0 commit comments

Comments
 (0)