Skip to content

Commit e87a8f2

Browse files
Jiri Kosinadavem330
authored andcommitted
net: resolve symbol conflicts with generic hashtable.h
This is a preparatory patch for converting qdisc linked list into a hashtable. As we'll need to include hashtable.h in netdevice.h, we first have to make sure that this will not introduce symbol conflicts for any of the netdevice.h users. Reviewed-by: Cong Wang <[email protected]> Signed-off-by: Jiri Kosina <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent b89b815 commit e87a8f2

File tree

5 files changed

+28
-28
lines changed

5 files changed

+28
-28
lines changed

drivers/net/ethernet/ti/davinci_emac.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -597,14 +597,14 @@ static u32 hash_get(u8 *addr)
597597
}
598598

599599
/**
600-
* hash_add - Hash function to add mac addr from hash table
600+
* emac_hash_add - Hash function to add mac addr from hash table
601601
* @priv: The DaVinci EMAC private adapter structure
602602
* @mac_addr: mac address to delete from hash table
603603
*
604604
* Adds mac address to the internal hash table
605605
*
606606
*/
607-
static int hash_add(struct emac_priv *priv, u8 *mac_addr)
607+
static int emac_hash_add(struct emac_priv *priv, u8 *mac_addr)
608608
{
609609
struct device *emac_dev = &priv->ndev->dev;
610610
u32 rc = 0;
@@ -613,7 +613,7 @@ static int hash_add(struct emac_priv *priv, u8 *mac_addr)
613613

614614
if (hash_value >= EMAC_NUM_MULTICAST_BITS) {
615615
if (netif_msg_drv(priv)) {
616-
dev_err(emac_dev, "DaVinci EMAC: hash_add(): Invalid "\
616+
dev_err(emac_dev, "DaVinci EMAC: emac_hash_add(): Invalid "\
617617
"Hash %08x, should not be greater than %08x",
618618
hash_value, (EMAC_NUM_MULTICAST_BITS - 1));
619619
}
@@ -639,14 +639,14 @@ static int hash_add(struct emac_priv *priv, u8 *mac_addr)
639639
}
640640

641641
/**
642-
* hash_del - Hash function to delete mac addr from hash table
642+
* emac_hash_del - Hash function to delete mac addr from hash table
643643
* @priv: The DaVinci EMAC private adapter structure
644644
* @mac_addr: mac address to delete from hash table
645645
*
646646
* Removes mac address from the internal hash table
647647
*
648648
*/
649-
static int hash_del(struct emac_priv *priv, u8 *mac_addr)
649+
static int emac_hash_del(struct emac_priv *priv, u8 *mac_addr)
650650
{
651651
u32 hash_value;
652652
u32 hash_bit;
@@ -696,10 +696,10 @@ static void emac_add_mcast(struct emac_priv *priv, u32 action, u8 *mac_addr)
696696

697697
switch (action) {
698698
case EMAC_MULTICAST_ADD:
699-
update = hash_add(priv, mac_addr);
699+
update = emac_hash_add(priv, mac_addr);
700700
break;
701701
case EMAC_MULTICAST_DEL:
702-
update = hash_del(priv, mac_addr);
702+
update = emac_hash_del(priv, mac_addr);
703703
break;
704704
case EMAC_ALL_MULTI_SET:
705705
update = 1;

net/ipv6/ip6_gre.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ static bool log_ecn_error = true;
6161
module_param(log_ecn_error, bool, 0644);
6262
MODULE_PARM_DESC(log_ecn_error, "Log packets received with corrupted ECN");
6363

64-
#define HASH_SIZE_SHIFT 5
65-
#define HASH_SIZE (1 << HASH_SIZE_SHIFT)
64+
#define IP6_GRE_HASH_SIZE_SHIFT 5
65+
#define IP6_GRE_HASH_SIZE (1 << IP6_GRE_HASH_SIZE_SHIFT)
6666

6767
static int ip6gre_net_id __read_mostly;
6868
struct ip6gre_net {
69-
struct ip6_tnl __rcu *tunnels[4][HASH_SIZE];
69+
struct ip6_tnl __rcu *tunnels[4][IP6_GRE_HASH_SIZE];
7070

7171
struct net_device *fb_tunnel_dev;
7272
};
@@ -96,12 +96,12 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu);
9696
will match fallback tunnel.
9797
*/
9898

99-
#define HASH_KEY(key) (((__force u32)key^((__force u32)key>>4))&(HASH_SIZE - 1))
99+
#define HASH_KEY(key) (((__force u32)key^((__force u32)key>>4))&(IP6_GRE_HASH_SIZE - 1))
100100
static u32 HASH_ADDR(const struct in6_addr *addr)
101101
{
102102
u32 hash = ipv6_addr_hash(addr);
103103

104-
return hash_32(hash, HASH_SIZE_SHIFT);
104+
return hash_32(hash, IP6_GRE_HASH_SIZE_SHIFT);
105105
}
106106

107107
#define tunnels_r_l tunnels[3]
@@ -1089,7 +1089,7 @@ static void ip6gre_destroy_tunnels(struct net *net, struct list_head *head)
10891089

10901090
for (prio = 0; prio < 4; prio++) {
10911091
int h;
1092-
for (h = 0; h < HASH_SIZE; h++) {
1092+
for (h = 0; h < IP6_GRE_HASH_SIZE; h++) {
10931093
struct ip6_tnl *t;
10941094

10951095
t = rtnl_dereference(ign->tunnels[prio][h]);

net/ipv6/ip6_tunnel.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ MODULE_LICENSE("GPL");
6464
MODULE_ALIAS_RTNL_LINK("ip6tnl");
6565
MODULE_ALIAS_NETDEV("ip6tnl0");
6666

67-
#define HASH_SIZE_SHIFT 5
68-
#define HASH_SIZE (1 << HASH_SIZE_SHIFT)
67+
#define IP6_TUNNEL_HASH_SIZE_SHIFT 5
68+
#define IP6_TUNNEL_HASH_SIZE (1 << IP6_TUNNEL_HASH_SIZE_SHIFT)
6969

7070
static bool log_ecn_error = true;
7171
module_param(log_ecn_error, bool, 0644);
@@ -75,7 +75,7 @@ static u32 HASH(const struct in6_addr *addr1, const struct in6_addr *addr2)
7575
{
7676
u32 hash = ipv6_addr_hash(addr1) ^ ipv6_addr_hash(addr2);
7777

78-
return hash_32(hash, HASH_SIZE_SHIFT);
78+
return hash_32(hash, IP6_TUNNEL_HASH_SIZE_SHIFT);
7979
}
8080

8181
static int ip6_tnl_dev_init(struct net_device *dev);
@@ -87,7 +87,7 @@ struct ip6_tnl_net {
8787
/* the IPv6 tunnel fallback device */
8888
struct net_device *fb_tnl_dev;
8989
/* lists for storing tunnels in use */
90-
struct ip6_tnl __rcu *tnls_r_l[HASH_SIZE];
90+
struct ip6_tnl __rcu *tnls_r_l[IP6_TUNNEL_HASH_SIZE];
9191
struct ip6_tnl __rcu *tnls_wc[1];
9292
struct ip6_tnl __rcu **tnls[2];
9393
};
@@ -2031,7 +2031,7 @@ static void __net_exit ip6_tnl_destroy_tunnels(struct net *net)
20312031
if (dev->rtnl_link_ops == &ip6_link_ops)
20322032
unregister_netdevice_queue(dev, &list);
20332033

2034-
for (h = 0; h < HASH_SIZE; h++) {
2034+
for (h = 0; h < IP6_TUNNEL_HASH_SIZE; h++) {
20352035
t = rtnl_dereference(ip6n->tnls_r_l[h]);
20362036
while (t) {
20372037
/* If dev is in the same netns, it has already

net/ipv6/ip6_vti.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@
5050
#include <net/net_namespace.h>
5151
#include <net/netns/generic.h>
5252

53-
#define HASH_SIZE_SHIFT 5
54-
#define HASH_SIZE (1 << HASH_SIZE_SHIFT)
53+
#define IP6_VTI_HASH_SIZE_SHIFT 5
54+
#define IP6_VTI_HASH_SIZE (1 << IP6_VTI_HASH_SIZE_SHIFT)
5555

5656
static u32 HASH(const struct in6_addr *addr1, const struct in6_addr *addr2)
5757
{
5858
u32 hash = ipv6_addr_hash(addr1) ^ ipv6_addr_hash(addr2);
5959

60-
return hash_32(hash, HASH_SIZE_SHIFT);
60+
return hash_32(hash, IP6_VTI_HASH_SIZE_SHIFT);
6161
}
6262

6363
static int vti6_dev_init(struct net_device *dev);
@@ -69,7 +69,7 @@ struct vti6_net {
6969
/* the vti6 tunnel fallback device */
7070
struct net_device *fb_tnl_dev;
7171
/* lists for storing tunnels in use */
72-
struct ip6_tnl __rcu *tnls_r_l[HASH_SIZE];
72+
struct ip6_tnl __rcu *tnls_r_l[IP6_VTI_HASH_SIZE];
7373
struct ip6_tnl __rcu *tnls_wc[1];
7474
struct ip6_tnl __rcu **tnls[2];
7575
};
@@ -1040,7 +1040,7 @@ static void __net_exit vti6_destroy_tunnels(struct vti6_net *ip6n)
10401040
struct ip6_tnl *t;
10411041
LIST_HEAD(list);
10421042

1043-
for (h = 0; h < HASH_SIZE; h++) {
1043+
for (h = 0; h < IP6_VTI_HASH_SIZE; h++) {
10441044
t = rtnl_dereference(ip6n->tnls_r_l[h]);
10451045
while (t) {
10461046
unregister_netdevice_queue(t->dev, &list);

net/ipv6/sit.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
For comments look at net/ipv4/ip_gre.c --ANK
6363
*/
6464

65-
#define HASH_SIZE 16
65+
#define IP6_SIT_HASH_SIZE 16
6666
#define HASH(addr) (((__force u32)addr^((__force u32)addr>>4))&0xF)
6767

6868
static bool log_ecn_error = true;
@@ -78,9 +78,9 @@ static struct rtnl_link_ops sit_link_ops __read_mostly;
7878

7979
static int sit_net_id __read_mostly;
8080
struct sit_net {
81-
struct ip_tunnel __rcu *tunnels_r_l[HASH_SIZE];
82-
struct ip_tunnel __rcu *tunnels_r[HASH_SIZE];
83-
struct ip_tunnel __rcu *tunnels_l[HASH_SIZE];
81+
struct ip_tunnel __rcu *tunnels_r_l[IP6_SIT_HASH_SIZE];
82+
struct ip_tunnel __rcu *tunnels_r[IP6_SIT_HASH_SIZE];
83+
struct ip_tunnel __rcu *tunnels_l[IP6_SIT_HASH_SIZE];
8484
struct ip_tunnel __rcu *tunnels_wc[1];
8585
struct ip_tunnel __rcu **tunnels[4];
8686

@@ -1783,7 +1783,7 @@ static void __net_exit sit_destroy_tunnels(struct net *net,
17831783

17841784
for (prio = 1; prio < 4; prio++) {
17851785
int h;
1786-
for (h = 0; h < HASH_SIZE; h++) {
1786+
for (h = 0; h < IP6_SIT_HASH_SIZE; h++) {
17871787
struct ip_tunnel *t;
17881788

17891789
t = rtnl_dereference(sitn->tunnels[prio][h]);

0 commit comments

Comments
 (0)