* [Bridge] [PATCH 00/12] Ethernet: Add and use ether_<type>_addr globals
@ 2018-03-31 7:05 Joe Perches
2018-03-31 7:05 ` [Bridge] [PATCH 02/12] treewide/net: Rename eth_stp_addr to ether_stp_addr Joe Perches
` (2 more replies)
0 siblings, 3 replies; 12+ messages in thread
From: Joe Perches @ 2018-03-31 7:05 UTC (permalink / raw)
To: netdev, linux-wireless, b43-dev, bridge, netfilter-devel,
coreteam
Cc: brcm80211-dev-list.pdl, linux-kernel, brcm80211-dev-list
There are many local static and non-static arrays that are used for
Ethernet broadcast address output or comparison.
Centralize the array into a single separate file and remove the local
arrays.
Joe Perches (12):
ethernet: Add generic ether_<foo>_addr addresses
treewide/net: Rename eth_stp_addr to ether_stp_addr
net: mac80211: Use global ether_broadcast_addr
bridge: netfilter: Use the new global ether_<foo>_addr arrays
net: atm: Use ether_broadcast_addr
wireless: Convert simple uses of a static const Ethernet broadcast address
brcmfmac: Convert ALLFFMAC to ether_broadcast_addr
iwlegacy: Remove EXPORT_SYMBOL(il_bcast_addr) and use ether_broadcast_addr
iwlwifi: Remove local iwl_bcast_addr and use ether_broadcast_addr
mvpp2: Use ether_broadcast_addr instead of a local array
qlogic: Convert local bcast_addr to global ether_broadcast_addr
ethernet: Use ether_zero_addr instead of local statics
drivers/net/dsa/lan9303-core.c | 4 ++--
drivers/net/ethernet/broadcom/b44.c | 5 ++---
drivers/net/ethernet/freescale/gianfar.c | 3 +--
drivers/net/ethernet/marvell/mvpp2.c | 4 +---
drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c | 5 +----
drivers/net/ethernet/qlogic/qlcnic/qlcnic_hw.c | 6 ++----
.../net/ethernet/qlogic/qlcnic/qlcnic_sriov_common.c | 6 ++----
drivers/net/wireless/admtek/adm8211.c | 3 +--
drivers/net/wireless/ath/carl9170/mac.c | 4 +---
drivers/net/wireless/broadcom/b43/main.c | 3 +--
.../net/wireless/broadcom/brcm80211/brcmfmac/common.c | 2 --
.../net/wireless/broadcom/brcm80211/brcmfmac/common.h | 2 --
.../wireless/broadcom/brcm80211/brcmfmac/flowring.c | 8 ++++----
drivers/net/wireless/intel/iwlegacy/3945-mac.c | 2 +-
drivers/net/wireless/intel/iwlegacy/4965-mac.c | 2 +-
drivers/net/wireless/intel/iwlegacy/common.c | 3 ---
drivers/net/wireless/intel/iwlegacy/common.h | 1 -
drivers/net/wireless/intel/iwlwifi/dvm/dev.h | 1 -
drivers/net/wireless/intel/iwlwifi/dvm/scan.c | 2 +-
drivers/net/wireless/intel/iwlwifi/dvm/sta.c | 4 +---
drivers/net/wireless/marvell/mwifiex/cfg80211.c | 3 +--
drivers/net/wireless/realtek/rtlwifi/core.c | 5 ++---
drivers/net/wireless/rndis_wlan.c | 6 +-----
drivers/net/wireless/ti/wl1251/main.c | 5 +----
drivers/net/wireless/ti/wlcore/main.c | 5 +----
include/linux/etherdevice.h | 13 +++++++++----
net/atm/lec.c | 12 +++++-------
net/bridge/br_device.c | 4 ++--
net/bridge/netfilter/ebt_stp.c | 6 ++----
net/ethernet/Makefile | 2 +-
net/ethernet/ether_addrs.c | 19 +++++++++++++++++++
net/mac80211/iface.c | 5 +----
net/mac80211/key.c | 6 ++----
net/mac80211/mesh_hwmp.c | 19 ++++++++++---------
net/mac80211/mesh_pathtbl.c | 8 ++++----
35 files changed, 83 insertions(+), 105 deletions(-)
create mode 100644 net/ethernet/ether_addrs.c
--
2.15.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bridge] [PATCH 02/12] treewide/net: Rename eth_stp_addr to ether_stp_addr
2018-03-31 7:05 [Bridge] [PATCH 00/12] Ethernet: Add and use ether_<type>_addr globals Joe Perches
@ 2018-03-31 7:05 ` Joe Perches
2018-03-31 17:36 ` Andrew Lunn
2018-03-31 7:05 ` [Bridge] [PATCH 04/12] bridge: netfilter: Use the new global ether_<foo>_addr arrays Joe Perches
2018-04-05 13:27 ` [Bridge] [PATCH 00/12] Ethernet: Add and use ether_<type>_addr globals Felix Fietkau
2 siblings, 1 reply; 12+ messages in thread
From: Joe Perches @ 2018-03-31 7:05 UTC (permalink / raw)
To: Andrew Lunn, Vivien Didelot, Florian Fainelli, Stephen Hemminger
Cc: netdev, bridge, David S. Miller, linux-kernel
eth_stp_addr is not in the same form as the other global ether_<foo>_addr
addresses like ether_broadcast_addr.
Convert it treewide.
Miscellanea:
o Add comment to the ether_stp_addr define to show it's for spanning-tree
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/dsa/lan9303-core.c | 4 ++--
include/linux/etherdevice.h | 3 ++-
net/bridge/br_device.c | 4 ++--
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
index fefa454f3e56..a6f015ef251a 100644
--- a/drivers/net/dsa/lan9303-core.c
+++ b/drivers/net/dsa/lan9303-core.c
@@ -789,7 +789,7 @@ static int lan9303_separate_ports(struct lan9303 *chip)
{
int ret;
- lan9303_alr_del_port(chip, eth_stp_addr, 0);
+ lan9303_alr_del_port(chip, ether_stp_addr, 0);
ret = lan9303_write_switch_reg(chip, LAN9303_SWE_PORT_MIRROR,
LAN9303_SWE_PORT_MIRROR_SNIFFER_PORT0 |
LAN9303_SWE_PORT_MIRROR_MIRRORED_PORT1 |
@@ -814,7 +814,7 @@ static void lan9303_bridge_ports(struct lan9303 *chip)
lan9303_write_switch_reg(chip, LAN9303_SWE_PORT_STATE,
chip->swe_port_state);
- lan9303_alr_add_port(chip, eth_stp_addr, 0, true);
+ lan9303_alr_add_port(chip, ether_stp_addr, 0, true);
}
static void lan9303_handle_reset(struct lan9303 *chip)
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 85d2486b2959..142da8043b24 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -70,7 +70,8 @@ extern const u8 ether_zero_addr[ETH_ALEN]; /* all zeros */
/* Reserved Ethernet Addresses per IEEE 802.1Q */
extern const u8 ether_reserved_addr_base[ETH_ALEN];
-#define eth_stp_addr ether_reserved_addr_base
+/* Ethernet bridge - spanning tree protocol */
+#define ether_stp_addr ether_reserved_addr_base
/**
* is_link_local_ether_addr - Determine if given Ethernet address is link-local
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 278fc999d355..3abcf69d1976 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -1,4 +1,4 @@
-/*
+gg/*
* Device handling code
* Linux ethernet bridge
*
@@ -431,7 +431,7 @@ void br_dev_setup(struct net_device *dev)
br->bridge_id.prio[0] = 0x80;
br->bridge_id.prio[1] = 0x00;
- ether_addr_copy(br->group_addr, eth_stp_addr);
+ ether_addr_copy(br->group_addr, ether_stp_addr);
br->stp_enabled = BR_NO_STP;
br->group_fwd_mask = BR_GROUPFWD_DEFAULT;
--
2.15.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [Bridge] [PATCH 04/12] bridge: netfilter: Use the new global ether_<foo>_addr arrays
2018-03-31 7:05 [Bridge] [PATCH 00/12] Ethernet: Add and use ether_<type>_addr globals Joe Perches
2018-03-31 7:05 ` [Bridge] [PATCH 02/12] treewide/net: Rename eth_stp_addr to ether_stp_addr Joe Perches
@ 2018-03-31 7:05 ` Joe Perches
2018-03-31 18:28 ` Pablo Neira Ayuso
2018-04-05 13:27 ` [Bridge] [PATCH 00/12] Ethernet: Add and use ether_<type>_addr globals Felix Fietkau
2 siblings, 1 reply; 12+ messages in thread
From: Joe Perches @ 2018-03-31 7:05 UTC (permalink / raw)
To: Pablo Neira Ayuso, Jozsef Kadlecsik, Florian Westphal
Cc: netdev, bridge, linux-kernel, coreteam, netfilter-devel,
David S. Miller
Remove the local consts and use the new globals.
Signed-off-by: Joe Perches <joe@perches.com>
---
net/bridge/netfilter/ebt_stp.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/bridge/netfilter/ebt_stp.c b/net/bridge/netfilter/ebt_stp.c
index 3140eb912d7e..2b7479cc0140 100644
--- a/net/bridge/netfilter/ebt_stp.c
+++ b/net/bridge/netfilter/ebt_stp.c
@@ -153,8 +153,6 @@ ebt_stp_mt(const struct sk_buff *skb, struct xt_action_param *par)
static int ebt_stp_mt_check(const struct xt_mtchk_param *par)
{
const struct ebt_stp_info *info = par->matchinfo;
- const u8 bridge_ula[6] = {0x01, 0x80, 0xc2, 0x00, 0x00, 0x00};
- const u8 msk[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
const struct ebt_entry *e = par->entryinfo;
if (info->bitmask & ~EBT_STP_MASK || info->invflags & ~EBT_STP_MASK ||
@@ -162,8 +160,8 @@ static int ebt_stp_mt_check(const struct xt_mtchk_param *par)
return -EINVAL;
/* Make sure the match only receives stp frames */
if (!par->nft_compat &&
- (!ether_addr_equal(e->destmac, bridge_ula) ||
- !ether_addr_equal(e->destmsk, msk) ||
+ (!ether_addr_equal(e->destmac, ether_stp_addr) ||
+ !ether_addr_equal(e->destmsk, ether_broadcast_addr) ||
!(e->bitmask & EBT_DESTMAC)))
return -EINVAL;
--
2.15.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [Bridge] [PATCH 02/12] treewide/net: Rename eth_stp_addr to ether_stp_addr
2018-03-31 7:05 ` [Bridge] [PATCH 02/12] treewide/net: Rename eth_stp_addr to ether_stp_addr Joe Perches
@ 2018-03-31 17:36 ` Andrew Lunn
2018-03-31 18:01 ` Joe Perches
2018-03-31 18:34 ` [Bridge] [PATCH V2] " Joe Perches
0 siblings, 2 replies; 12+ messages in thread
From: Andrew Lunn @ 2018-03-31 17:36 UTC (permalink / raw)
To: Joe Perches
Cc: Florian Fainelli, Vivien Didelot, netdev, bridge, linux-kernel,
David S. Miller
On Sat, Mar 31, 2018 at 12:05:17AM -0700, Joe Perches wrote:
> --- a/net/bridge/br_device.c
> +++ b/net/bridge/br_device.c
> @@ -1,4 +1,4 @@
> -/*
> +gg/*
Hi Joe
This does not look good.
Andrew
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bridge] [PATCH 02/12] treewide/net: Rename eth_stp_addr to ether_stp_addr
2018-03-31 17:36 ` Andrew Lunn
@ 2018-03-31 18:01 ` Joe Perches
2018-03-31 18:34 ` [Bridge] [PATCH V2] " Joe Perches
1 sibling, 0 replies; 12+ messages in thread
From: Joe Perches @ 2018-03-31 18:01 UTC (permalink / raw)
To: Andrew Lunn
Cc: Florian Fainelli, Vivien Didelot, netdev, bridge, linux-kernel,
David S. Miller
On Sat, 2018-03-31 at 19:36 +0200, Andrew Lunn wrote:
> On Sat, Mar 31, 2018 at 12:05:17AM -0700, Joe Perches wrote:
> > --- a/net/bridge/br_device.c
> > +++ b/net/bridge/br_device.c
> > @@ -1,4 +1,4 @@
> > -/*
> > +gg/*
>
> Hi Joe
>
> This does not look good.
Definitely agree with that. apologies for not noticing.
It's emacs editing nonsense like a superfluous :wq for vim
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bridge] [PATCH 04/12] bridge: netfilter: Use the new global ether_<foo>_addr arrays
2018-03-31 7:05 ` [Bridge] [PATCH 04/12] bridge: netfilter: Use the new global ether_<foo>_addr arrays Joe Perches
@ 2018-03-31 18:28 ` Pablo Neira Ayuso
2018-03-31 18:40 ` Joe Perches
0 siblings, 1 reply; 12+ messages in thread
From: Pablo Neira Ayuso @ 2018-03-31 18:28 UTC (permalink / raw)
To: Joe Perches
Cc: netdev, bridge, Florian Westphal, linux-kernel, coreteam,
netfilter-devel, Jozsef Kadlecsik, David S. Miller
Hi Joe,
On Sat, Mar 31, 2018 at 12:05:19AM -0700, Joe Perches wrote:
> Remove the local consts and use the new globals.
This one is already upstream:
https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git/commit/?id=9124a20d8794663a396b5d6f91f66903848a042b
I can see you're using is_broadcast_ether_addr(e->destmsk) in this new
version, we would need an incremental version.
Thanks.
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
> net/bridge/netfilter/ebt_stp.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/net/bridge/netfilter/ebt_stp.c b/net/bridge/netfilter/ebt_stp.c
> index 3140eb912d7e..2b7479cc0140 100644
> --- a/net/bridge/netfilter/ebt_stp.c
> +++ b/net/bridge/netfilter/ebt_stp.c
> @@ -153,8 +153,6 @@ ebt_stp_mt(const struct sk_buff *skb, struct xt_action_param *par)
> static int ebt_stp_mt_check(const struct xt_mtchk_param *par)
> {
> const struct ebt_stp_info *info = par->matchinfo;
> - const u8 bridge_ula[6] = {0x01, 0x80, 0xc2, 0x00, 0x00, 0x00};
> - const u8 msk[6] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
> const struct ebt_entry *e = par->entryinfo;
>
> if (info->bitmask & ~EBT_STP_MASK || info->invflags & ~EBT_STP_MASK ||
> @@ -162,8 +160,8 @@ static int ebt_stp_mt_check(const struct xt_mtchk_param *par)
> return -EINVAL;
> /* Make sure the match only receives stp frames */
> if (!par->nft_compat &&
> - (!ether_addr_equal(e->destmac, bridge_ula) ||
> - !ether_addr_equal(e->destmsk, msk) ||
> + (!ether_addr_equal(e->destmac, ether_stp_addr) ||
> + !ether_addr_equal(e->destmsk, ether_broadcast_addr) ||
> !(e->bitmask & EBT_DESTMAC)))
> return -EINVAL;
>
> --
> 2.15.0
>
^ permalink raw reply [flat|nested] 12+ messages in thread
* [Bridge] [PATCH V2] treewide/net: Rename eth_stp_addr to ether_stp_addr
2018-03-31 17:36 ` Andrew Lunn
2018-03-31 18:01 ` Joe Perches
@ 2018-03-31 18:34 ` Joe Perches
2018-04-01 18:07 ` David Miller
1 sibling, 1 reply; 12+ messages in thread
From: Joe Perches @ 2018-03-31 18:34 UTC (permalink / raw)
To: Andrew Lunn, Vivien Didelot, Florian Fainelli, Stephen Hemminger
Cc: netdev, bridge, David S. Miller, linux-kernel
eth_stp_addr is not in the same form as the other global ether_<foo>_addr
addresses like ether_broadcast_addr.
Convert it treewide.
Miscellanea:
o Add comment to the ether_stp_addr define to show it's for spanning-tree
Signed-off-by: Joe Perches <joe@perches.com>
---
V2: Remove gg from initial comment (bad editing)
drivers/net/dsa/lan9303-core.c | 4 ++--
include/linux/etherdevice.h | 3 ++-
net/bridge/br_device.c | 2 +-
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
index fefa454f3e56..a6f015ef251a 100644
--- a/drivers/net/dsa/lan9303-core.c
+++ b/drivers/net/dsa/lan9303-core.c
@@ -789,7 +789,7 @@ static int lan9303_separate_ports(struct lan9303 *chip)
{
int ret;
- lan9303_alr_del_port(chip, eth_stp_addr, 0);
+ lan9303_alr_del_port(chip, ether_stp_addr, 0);
ret = lan9303_write_switch_reg(chip, LAN9303_SWE_PORT_MIRROR,
LAN9303_SWE_PORT_MIRROR_SNIFFER_PORT0 |
LAN9303_SWE_PORT_MIRROR_MIRRORED_PORT1 |
@@ -814,7 +814,7 @@ static void lan9303_bridge_ports(struct lan9303 *chip)
lan9303_write_switch_reg(chip, LAN9303_SWE_PORT_STATE,
chip->swe_port_state);
- lan9303_alr_add_port(chip, eth_stp_addr, 0, true);
+ lan9303_alr_add_port(chip, ether_stp_addr, 0, true);
}
static void lan9303_handle_reset(struct lan9303 *chip)
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 85d2486b2959..142da8043b24 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -70,7 +70,8 @@ extern const u8 ether_zero_addr[ETH_ALEN]; /* all zeros */
/* Reserved Ethernet Addresses per IEEE 802.1Q */
extern const u8 ether_reserved_addr_base[ETH_ALEN];
-#define eth_stp_addr ether_reserved_addr_base
+/* Ethernet bridge - spanning tree protocol */
+#define ether_stp_addr ether_reserved_addr_base
/**
* is_link_local_ether_addr - Determine if given Ethernet address is link-local
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c
index 278fc999d355..17b1917b6ecd 100644
--- a/net/bridge/br_device.c
+++ b/net/bridge/br_device.c
@@ -431,7 +431,7 @@ void br_dev_setup(struct net_device *dev)
br->bridge_id.prio[0] = 0x80;
br->bridge_id.prio[1] = 0x00;
- ether_addr_copy(br->group_addr, eth_stp_addr);
+ ether_addr_copy(br->group_addr, ether_stp_addr);
br->stp_enabled = BR_NO_STP;
br->group_fwd_mask = BR_GROUPFWD_DEFAULT;
--
2.15.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [Bridge] [PATCH 04/12] bridge: netfilter: Use the new global ether_<foo>_addr arrays
2018-03-31 18:28 ` Pablo Neira Ayuso
@ 2018-03-31 18:40 ` Joe Perches
0 siblings, 0 replies; 12+ messages in thread
From: Joe Perches @ 2018-03-31 18:40 UTC (permalink / raw)
To: Pablo Neira Ayuso
Cc: netdev, bridge, Florian Westphal, linux-kernel, coreteam,
netfilter-devel, Jozsef Kadlecsik, David S. Miller
On Sat, 2018-03-31 at 20:28 +0200, Pablo Neira Ayuso wrote:
> Hi Joe,
Hi Pablo.
> On Sat, Mar 31, 2018 at 12:05:19AM -0700, Joe Perches wrote:
> > Remove the local consts and use the new globals.
>
> This one is already upstream:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git/commit/?id=9124a20d8794663a396b5d6f91f66903848a042b
>
> I can see you're using is_broadcast_ether_addr(e->destmsk) in this new
> version, we would need an incremental version.
No worries. I did it against next-20180329
and that other commit wasn't there.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bridge] [PATCH V2] treewide/net: Rename eth_stp_addr to ether_stp_addr
2018-03-31 18:34 ` [Bridge] [PATCH V2] " Joe Perches
@ 2018-04-01 18:07 ` David Miller
0 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2018-04-01 18:07 UTC (permalink / raw)
To: joe; +Cc: andrew, f.fainelli, vivien.didelot, netdev, bridge, linux-kernel
From: Joe Perches <joe@perches.com>
Date: Sat, 31 Mar 2018 11:34:06 -0700
> eth_stp_addr is not in the same form as the other global ether_<foo>_addr
> addresses like ether_broadcast_addr.
>
> Convert it treewide.
>
> Miscellanea:
>
> o Add comment to the ether_stp_addr define to show it's for spanning-tree
>
> Signed-off-by: Joe Perches <joe@perches.com>
> ---
>
> V2: Remove gg from initial comment (bad editing)
Joe this was part of a larger series.
Please repost the entire series when you fix a patch contained
in that series, not just the patch that is changing.
Thank you.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bridge] [PATCH 00/12] Ethernet: Add and use ether_<type>_addr globals
2018-03-31 7:05 [Bridge] [PATCH 00/12] Ethernet: Add and use ether_<type>_addr globals Joe Perches
2018-03-31 7:05 ` [Bridge] [PATCH 02/12] treewide/net: Rename eth_stp_addr to ether_stp_addr Joe Perches
2018-03-31 7:05 ` [Bridge] [PATCH 04/12] bridge: netfilter: Use the new global ether_<foo>_addr arrays Joe Perches
@ 2018-04-05 13:27 ` Felix Fietkau
2018-04-05 13:51 ` Joe Perches
2 siblings, 1 reply; 12+ messages in thread
From: Felix Fietkau @ 2018-04-05 13:27 UTC (permalink / raw)
To: Joe Perches, netdev, linux-wireless, b43-dev, bridge,
netfilter-devel, coreteam
Cc: brcm80211-dev-list.pdl, linux-kernel, brcm80211-dev-list
On 2018-03-31 09:05, Joe Perches wrote:
> There are many local static and non-static arrays that are used for
> Ethernet broadcast address output or comparison.
>
> Centralize the array into a single separate file and remove the local
> arrays.
I suspect that for many targets and configurations, the local arrays
might actually be smaller than exporting a global. You have to factor in
not just the .text size, but the fact that referencing an exported
symbol needs a .reloc entry as well, which also eats up some space (at
least when the code is being built as module).
In my opinion, your series probably causes more bloat in common
configurations instead of reducing it.
You're also touching several places that could easily use
eth_broadcast_addr and eth_zero_addr. I think making those changes would
be more productive than what you did in this series.
- Felix
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bridge] [PATCH 00/12] Ethernet: Add and use ether_<type>_addr globals
2018-04-05 13:27 ` [Bridge] [PATCH 00/12] Ethernet: Add and use ether_<type>_addr globals Felix Fietkau
@ 2018-04-05 13:51 ` Joe Perches
2018-04-05 14:05 ` Felix Fietkau
0 siblings, 1 reply; 12+ messages in thread
From: Joe Perches @ 2018-04-05 13:51 UTC (permalink / raw)
To: Felix Fietkau, netdev, linux-wireless, b43-dev, bridge,
netfilter-devel, coreteam
Cc: brcm80211-dev-list.pdl, linux-kernel, brcm80211-dev-list
On Thu, 2018-04-05 at 15:27 +0200, Felix Fietkau wrote:
> On 2018-03-31 09:05, Joe Perches wrote:
> > There are many local static and non-static arrays that are used for
> > Ethernet broadcast address output or comparison.
> >
> > Centralize the array into a single separate file and remove the local
> > arrays.
>
> I suspect that for many targets and configurations, the local arrays
> might actually be smaller than exporting a global.
I tried x86-64 allnoconfig and defconfig.
Those both did not increase vmlinux size.
The defconfig actually got smaller, but that might have been
some object alignment oddity.
> You have to factor in
> not just the .text size, but the fact that referencing an exported
> symbol needs a .reloc entry as well, which also eats up some space (at
> least when the code is being built as module).
Thanks, the modules I built got smaller.
> In my opinion, your series probably causes more bloat in common
> configurations instead of reducing it.
>
> You're also touching several places that could easily use
> eth_broadcast_addr and eth_zero_addr. I think making those changes would
> be more productive than what you did in this series.
Doubtful. AFAIK: possible unaligned addresses.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [Bridge] [PATCH 00/12] Ethernet: Add and use ether_<type>_addr globals
2018-04-05 13:51 ` Joe Perches
@ 2018-04-05 14:05 ` Felix Fietkau
0 siblings, 0 replies; 12+ messages in thread
From: Felix Fietkau @ 2018-04-05 14:05 UTC (permalink / raw)
To: Joe Perches, netdev, linux-wireless, b43-dev, bridge,
netfilter-devel, coreteam
Cc: brcm80211-dev-list.pdl, linux-kernel, brcm80211-dev-list
On 2018-04-05 15:51, Joe Perches wrote:
>> You have to factor in
>> not just the .text size, but the fact that referencing an exported
>> symbol needs a .reloc entry as well, which also eats up some space (at
>> least when the code is being built as module).
>
> Thanks, the modules I built got smaller.
Please post some numbers to show this. By the way, on other
architectures the numbers will probably be different, especially on
ARM/MIPS.
>> In my opinion, your series probably causes more bloat in common
>> configurations instead of reducing it.
>>
>> You're also touching several places that could easily use
>> eth_broadcast_addr and eth_zero_addr. I think making those changes would
>> be more productive than what you did in this series.
>
> Doubtful. AFAIK: possible unaligned addresses.
Those two are just memset calls, alignment does not matter.
- Felix
^ permalink raw reply [flat|nested] 12+ messages in thread
end of thread, other threads:[~2018-04-05 14:05 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-31 7:05 [Bridge] [PATCH 00/12] Ethernet: Add and use ether_<type>_addr globals Joe Perches
2018-03-31 7:05 ` [Bridge] [PATCH 02/12] treewide/net: Rename eth_stp_addr to ether_stp_addr Joe Perches
2018-03-31 17:36 ` Andrew Lunn
2018-03-31 18:01 ` Joe Perches
2018-03-31 18:34 ` [Bridge] [PATCH V2] " Joe Perches
2018-04-01 18:07 ` David Miller
2018-03-31 7:05 ` [Bridge] [PATCH 04/12] bridge: netfilter: Use the new global ether_<foo>_addr arrays Joe Perches
2018-03-31 18:28 ` Pablo Neira Ayuso
2018-03-31 18:40 ` Joe Perches
2018-04-05 13:27 ` [Bridge] [PATCH 00/12] Ethernet: Add and use ether_<type>_addr globals Felix Fietkau
2018-04-05 13:51 ` Joe Perches
2018-04-05 14:05 ` Felix Fietkau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).