Commit 1191cb83 authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

bnx2x: remove some bloat

Before doing skb->head_frag work on bnx2x driver, I found too much stuff
was inlined in bnx2x/bnx2x_cmn.h for no good reason and made my work not
very easy.

Move some big functions out of this include file to the respective .c
file.

A lot of inline keywords are not needed at all in this huge driver.

   text	   data	    bss	    dec	    hex	filename
 490083	   1270	     56	 491409	  77f91	bnx2x/bnx2x.ko.before
 484206	   1270	     56	 485532	  7689c	bnx2x/bnx2x.ko
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Cc: Eilon Greenstein <eilong@broadcom.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Maciej Żenczykowski <maze@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Tom Herbert <therbert@google.com>
Cc: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Cc: Matt Carlson <mcarlson@broadcom.com>
Cc: Michael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d344c4f3
...@@ -592,8 +592,8 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd) ...@@ -592,8 +592,8 @@ static int bnx2x_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
#define IS_E3_ONLINE(info) (((info) & RI_E3_ONLINE) == RI_E3_ONLINE) #define IS_E3_ONLINE(info) (((info) & RI_E3_ONLINE) == RI_E3_ONLINE)
#define IS_E3B0_ONLINE(info) (((info) & RI_E3B0_ONLINE) == RI_E3B0_ONLINE) #define IS_E3B0_ONLINE(info) (((info) & RI_E3B0_ONLINE) == RI_E3B0_ONLINE)
static inline bool bnx2x_is_reg_online(struct bnx2x *bp, static bool bnx2x_is_reg_online(struct bnx2x *bp,
const struct reg_addr *reg_info) const struct reg_addr *reg_info)
{ {
if (CHIP_IS_E1(bp)) if (CHIP_IS_E1(bp))
return IS_E1_ONLINE(reg_info->info); return IS_E1_ONLINE(reg_info->info);
...@@ -610,7 +610,7 @@ static inline bool bnx2x_is_reg_online(struct bnx2x *bp, ...@@ -610,7 +610,7 @@ static inline bool bnx2x_is_reg_online(struct bnx2x *bp,
} }
/******* Paged registers info selectors ********/ /******* Paged registers info selectors ********/
static inline const u32 *__bnx2x_get_page_addr_ar(struct bnx2x *bp) static const u32 *__bnx2x_get_page_addr_ar(struct bnx2x *bp)
{ {
if (CHIP_IS_E2(bp)) if (CHIP_IS_E2(bp))
return page_vals_e2; return page_vals_e2;
...@@ -620,7 +620,7 @@ static inline const u32 *__bnx2x_get_page_addr_ar(struct bnx2x *bp) ...@@ -620,7 +620,7 @@ static inline const u32 *__bnx2x_get_page_addr_ar(struct bnx2x *bp)
return NULL; return NULL;
} }
static inline u32 __bnx2x_get_page_reg_num(struct bnx2x *bp) static u32 __bnx2x_get_page_reg_num(struct bnx2x *bp)
{ {
if (CHIP_IS_E2(bp)) if (CHIP_IS_E2(bp))
return PAGE_MODE_VALUES_E2; return PAGE_MODE_VALUES_E2;
...@@ -630,7 +630,7 @@ static inline u32 __bnx2x_get_page_reg_num(struct bnx2x *bp) ...@@ -630,7 +630,7 @@ static inline u32 __bnx2x_get_page_reg_num(struct bnx2x *bp)
return 0; return 0;
} }
static inline const u32 *__bnx2x_get_page_write_ar(struct bnx2x *bp) static const u32 *__bnx2x_get_page_write_ar(struct bnx2x *bp)
{ {
if (CHIP_IS_E2(bp)) if (CHIP_IS_E2(bp))
return page_write_regs_e2; return page_write_regs_e2;
...@@ -640,7 +640,7 @@ static inline const u32 *__bnx2x_get_page_write_ar(struct bnx2x *bp) ...@@ -640,7 +640,7 @@ static inline const u32 *__bnx2x_get_page_write_ar(struct bnx2x *bp)
return NULL; return NULL;
} }
static inline u32 __bnx2x_get_page_write_num(struct bnx2x *bp) static u32 __bnx2x_get_page_write_num(struct bnx2x *bp)
{ {
if (CHIP_IS_E2(bp)) if (CHIP_IS_E2(bp))
return PAGE_WRITE_REGS_E2; return PAGE_WRITE_REGS_E2;
...@@ -650,7 +650,7 @@ static inline u32 __bnx2x_get_page_write_num(struct bnx2x *bp) ...@@ -650,7 +650,7 @@ static inline u32 __bnx2x_get_page_write_num(struct bnx2x *bp)
return 0; return 0;
} }
static inline const struct reg_addr *__bnx2x_get_page_read_ar(struct bnx2x *bp) static const struct reg_addr *__bnx2x_get_page_read_ar(struct bnx2x *bp)
{ {
if (CHIP_IS_E2(bp)) if (CHIP_IS_E2(bp))
return page_read_regs_e2; return page_read_regs_e2;
...@@ -660,7 +660,7 @@ static inline const struct reg_addr *__bnx2x_get_page_read_ar(struct bnx2x *bp) ...@@ -660,7 +660,7 @@ static inline const struct reg_addr *__bnx2x_get_page_read_ar(struct bnx2x *bp)
return NULL; return NULL;
} }
static inline u32 __bnx2x_get_page_read_num(struct bnx2x *bp) static u32 __bnx2x_get_page_read_num(struct bnx2x *bp)
{ {
if (CHIP_IS_E2(bp)) if (CHIP_IS_E2(bp))
return PAGE_READ_REGS_E2; return PAGE_READ_REGS_E2;
...@@ -670,7 +670,7 @@ static inline u32 __bnx2x_get_page_read_num(struct bnx2x *bp) ...@@ -670,7 +670,7 @@ static inline u32 __bnx2x_get_page_read_num(struct bnx2x *bp)
return 0; return 0;
} }
static inline int __bnx2x_get_regs_len(struct bnx2x *bp) static int __bnx2x_get_regs_len(struct bnx2x *bp)
{ {
int num_pages = __bnx2x_get_page_reg_num(bp); int num_pages = __bnx2x_get_page_reg_num(bp);
int page_write_num = __bnx2x_get_page_write_num(bp); int page_write_num = __bnx2x_get_page_write_num(bp);
...@@ -715,7 +715,7 @@ static int bnx2x_get_regs_len(struct net_device *dev) ...@@ -715,7 +715,7 @@ static int bnx2x_get_regs_len(struct net_device *dev)
* ("read address"). There may be more than one write address per "page" and * ("read address"). There may be more than one write address per "page" and
* more than one read address per write address. * more than one read address per write address.
*/ */
static inline void bnx2x_read_pages_regs(struct bnx2x *bp, u32 *p) static void bnx2x_read_pages_regs(struct bnx2x *bp, u32 *p)
{ {
u32 i, j, k, n; u32 i, j, k, n;
/* addresses of the paged registers */ /* addresses of the paged registers */
...@@ -744,7 +744,7 @@ static inline void bnx2x_read_pages_regs(struct bnx2x *bp, u32 *p) ...@@ -744,7 +744,7 @@ static inline void bnx2x_read_pages_regs(struct bnx2x *bp, u32 *p)
} }
} }
static inline void __bnx2x_get_regs(struct bnx2x *bp, u32 *p) static void __bnx2x_get_regs(struct bnx2x *bp, u32 *p)
{ {
u32 i, j; u32 i, j;
...@@ -2209,7 +2209,7 @@ static void bnx2x_self_test(struct net_device *dev, ...@@ -2209,7 +2209,7 @@ static void bnx2x_self_test(struct net_device *dev,
/* ethtool statistics are displayed for all regular ethernet queues and the /* ethtool statistics are displayed for all regular ethernet queues and the
* fcoe L2 queue if not disabled * fcoe L2 queue if not disabled
*/ */
static inline int bnx2x_num_stat_queues(struct bnx2x *bp) static int bnx2x_num_stat_queues(struct bnx2x *bp)
{ {
return BNX2X_NUM_ETH_QUEUES(bp); return BNX2X_NUM_ETH_QUEUES(bp);
} }
......
...@@ -1316,7 +1316,7 @@ static void bnx2x_port_stats_base_init(struct bnx2x *bp) ...@@ -1316,7 +1316,7 @@ static void bnx2x_port_stats_base_init(struct bnx2x *bp)
* *
* @param bp * @param bp
*/ */
static inline void bnx2x_prep_fw_stats_req(struct bnx2x *bp) static void bnx2x_prep_fw_stats_req(struct bnx2x *bp)
{ {
int i; int i;
int first_queue_query_index; int first_queue_query_index;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment