Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netns: make struct pernet_operations::id unsigned int

Make struct pernet_operations::id unsigned.

There are 2 reasons to do so:

1)
This field is really an index into an zero based array and
thus is unsigned entity. Using negative value is out-of-bound
access by definition.

2)
On x86_64 unsigned 32-bit data which are mixed with pointers
via array indexing or offsets added or subtracted to pointers
are preffered to signed 32-bit data.

"int" being used as an array index needs to be sign-extended
to 64-bit before being used.

void f(long *p, int i)
{
g(p[i]);
}

roughly translates to

movsx rsi, esi
mov rdi, [rsi+...]
call g

MOVSX is 3 byte instruction which isn't necessary if the variable is
unsigned because x86_64 is zero extending by default.

Now, there is net_generic() function which, you guessed it right, uses
"int" as an array index:

static inline void *net_generic(const struct net *net, int id)
{
...
ptr = ng->ptr[id - 1];
...
}

And this function is used a lot, so those sign extensions add up.

Patch snipes ~1730 bytes on allyesconfig kernel (without all junk
messing with code generation):

add/remove: 0/0 grow/shrink: 70/598 up/down: 396/-2126 (-1730)

Unfortunately some functions actually grow bigger.
This is a semmingly random artefact of code generation with register
allocator being used differently. gcc decides that some variable
needs to live in new r8+ registers and every access now requires REX
prefix. Or it is shifted into r12, so [r12+0] addressing mode has to be
used which is longer than [r8]

However, overall balance is in negative direction:

add/remove: 0/0 grow/shrink: 70/598 up/down: 396/-2126 (-1730)
function old new delta
nfsd4_lock 3886 3959 +73
tipc_link_build_proto_msg 1096 1140 +44
mac80211_hwsim_new_radio 2776 2808 +32
tipc_mon_rcv 1032 1058 +26
svcauth_gss_legacy_init 1413 1429 +16
tipc_bcbase_select_primary 379 392 +13
nfsd4_exchange_id 1247 1260 +13
nfsd4_setclientid_confirm 782 793 +11
...
put_client_renew_locked 494 480 -14
ip_set_sockfn_get 730 716 -14
geneve_sock_add 829 813 -16
nfsd4_sequence_done 721 703 -18
nlmclnt_lookup_host 708 686 -22
nfsd4_lockt 1085 1063 -22
nfs_get_client 1077 1050 -27
tcf_bpf_init 1106 1076 -30
nfsd4_encode_fattr 5997 5930 -67
Total: Before=154856051, After=154854321, chg -0.00%

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Alexey Dobriyan and committed by
David S. Miller
c7d03a00 e68b6e50

+80 -81
+1 -1
drivers/infiniband/core/cma.c
··· 116 116 static LIST_HEAD(listen_any_list); 117 117 static DEFINE_MUTEX(lock); 118 118 static struct workqueue_struct *cma_wq; 119 - static int cma_pernet_id; 119 + static unsigned int cma_pernet_id; 120 120 121 121 struct cma_pernet { 122 122 struct idr tcp_ps;
+1 -1
drivers/net/bonding/bond_main.c
··· 199 199 atomic_t netpoll_block_tx = ATOMIC_INIT(0); 200 200 #endif 201 201 202 - int bond_net_id __read_mostly; 202 + unsigned int bond_net_id __read_mostly; 203 203 204 204 static __be32 arp_target[BOND_MAX_ARP_TARGETS]; 205 205 static int arp_ip_count;
+1 -1
drivers/net/geneve.c
··· 43 43 struct list_head sock_list; 44 44 }; 45 45 46 - static int geneve_net_id; 46 + static unsigned int geneve_net_id; 47 47 48 48 union geneve_addr { 49 49 struct sockaddr_in sin;
+1 -1
drivers/net/gtp.c
··· 77 77 struct hlist_head *addr_hash; 78 78 }; 79 79 80 - static int gtp_net_id __read_mostly; 80 + static unsigned int gtp_net_id __read_mostly; 81 81 82 82 struct gtp_net { 83 83 struct list_head gtp_dev_list;
+1 -1
drivers/net/ppp/ppp_generic.c
··· 204 204 static atomic_t channel_count = ATOMIC_INIT(0); 205 205 206 206 /* per-net private data for this module */ 207 - static int ppp_net_id __read_mostly; 207 + static unsigned int ppp_net_id __read_mostly; 208 208 struct ppp_net { 209 209 /* units to ppp mapping */ 210 210 struct idr units_idr;
+1 -1
drivers/net/ppp/pppoe.c
··· 95 95 static const struct ppp_channel_ops pppoe_chan_ops; 96 96 97 97 /* per-net private data for this module */ 98 - static int pppoe_net_id __read_mostly; 98 + static unsigned int pppoe_net_id __read_mostly; 99 99 struct pppoe_net { 100 100 /* 101 101 * we could use _single_ hash table for all
+1 -1
drivers/net/vxlan.c
··· 52 52 module_param(log_ecn_error, bool, 0644); 53 53 MODULE_PARM_DESC(log_ecn_error, "Log packets received with corrupted ECN"); 54 54 55 - static int vxlan_net_id; 55 + static unsigned int vxlan_net_id; 56 56 static struct rtnl_link_ops vxlan_link_ops; 57 57 58 58 static const u8 all_zeros_mac[ETH_ALEN + 2];
+1 -1
drivers/net/wireless/mac80211_hwsim.c
··· 250 250 cp->magic = 0; 251 251 } 252 252 253 - static int hwsim_net_id; 253 + static unsigned int hwsim_net_id; 254 254 255 255 static int hwsim_netgroup; 256 256
+1 -1
fs/lockd/netns.h
··· 15 15 struct list_head nsm_handles; 16 16 }; 17 17 18 - extern int lockd_net_id; 18 + extern unsigned int lockd_net_id; 19 19 20 20 #endif
+1 -1
fs/lockd/svc.c
··· 57 57 static struct svc_rqst *nlmsvc_rqst; 58 58 unsigned long nlmsvc_timeout; 59 59 60 - int lockd_net_id; 60 + unsigned int lockd_net_id; 61 61 62 62 /* 63 63 * These can be set at insmod time (useful for NFS as root filesystem),
+1 -1
fs/nfs/inode.c
··· 2015 2015 destroy_workqueue(wq); 2016 2016 } 2017 2017 2018 - int nfs_net_id; 2018 + unsigned int nfs_net_id; 2019 2019 EXPORT_SYMBOL_GPL(nfs_net_id); 2020 2020 2021 2021 static int nfs_net_init(struct net *net)
+1 -1
fs/nfs/netns.h
··· 35 35 #endif 36 36 }; 37 37 38 - extern int nfs_net_id; 38 + extern unsigned int nfs_net_id; 39 39 40 40 #endif
+1 -1
fs/nfs_common/grace.c
··· 9 9 #include <net/netns/generic.h> 10 10 #include <linux/fs.h> 11 11 12 - static int grace_net_id; 12 + static unsigned int grace_net_id; 13 13 static DEFINE_SPINLOCK(grace_lock); 14 14 15 15 /**
+1 -1
fs/nfsd/netns.h
··· 124 124 /* Simple check to find out if a given net was properly initialized */ 125 125 #define nfsd_netns_ready(nn) ((nn)->sessionid_hashtbl) 126 126 127 - extern int nfsd_net_id; 127 + extern unsigned int nfsd_net_id; 128 128 #endif /* __NFSD_NETNS_H__ */
+1 -1
fs/nfsd/nfsctl.c
··· 1201 1201 } 1202 1202 #endif 1203 1203 1204 - int nfsd_net_id; 1204 + unsigned int nfsd_net_id; 1205 1205 1206 1206 static __net_init int nfsd_init_net(struct net *net) 1207 1207 {
+1 -1
include/net/bonding.h
··· 681 681 } 682 682 683 683 /* exported from bond_main.c */ 684 - extern int bond_net_id; 684 + extern unsigned int bond_net_id; 685 685 extern const struct bond_parm_tbl bond_lacp_tbl[]; 686 686 extern const struct bond_parm_tbl xmit_hashtype_tbl[]; 687 687 extern const struct bond_parm_tbl arp_validate_tbl[];
+3 -3
include/net/ip_tunnels.h
··· 129 129 #endif 130 130 struct ip_tunnel_prl_entry __rcu *prl; /* potential router list */ 131 131 unsigned int prl_count; /* # of entries in PRL */ 132 - int ip_tnl_net_id; 132 + unsigned int ip_tnl_net_id; 133 133 struct gro_cells gro_cells; 134 134 bool collect_md; 135 135 bool ignore_df; ··· 248 248 void ip_tunnel_dellink(struct net_device *dev, struct list_head *head); 249 249 struct net *ip_tunnel_get_link_net(const struct net_device *dev); 250 250 int ip_tunnel_get_iflink(const struct net_device *dev); 251 - int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, 251 + int ip_tunnel_init_net(struct net *net, unsigned int ip_tnl_net_id, 252 252 struct rtnl_link_ops *ops, char *devname); 253 253 254 254 void ip_tunnel_delete_net(struct ip_tunnel_net *itn, struct rtnl_link_ops *ops); ··· 275 275 struct ip_tunnel_parm *p); 276 276 int ip_tunnel_newlink(struct net_device *dev, struct nlattr *tb[], 277 277 struct ip_tunnel_parm *p); 278 - void ip_tunnel_setup(struct net_device *dev, int net_id); 278 + void ip_tunnel_setup(struct net_device *dev, unsigned int net_id); 279 279 280 280 struct ip_tunnel_encap_ops { 281 281 size_t (*encap_hlen)(struct ip_tunnel_encap *e);
+1 -1
include/net/net_namespace.h
··· 291 291 int (*init)(struct net *net); 292 292 void (*exit)(struct net *net); 293 293 void (*exit_batch)(struct list_head *net_exit_list); 294 - int *id; 294 + unsigned int *id; 295 295 size_t size; 296 296 }; 297 297
+1 -1
include/net/netfilter/nf_conntrack_l4proto.h
··· 98 98 const struct nla_policy *nla_policy; 99 99 } ctnl_timeout; 100 100 #endif 101 - int *net_id; 101 + unsigned int *net_id; 102 102 /* Init l4proto pernet data */ 103 103 int (*init_net)(struct net *net, u_int16_t proto); 104 104
+1 -1
include/net/netfilter/nf_conntrack_synproxy.h
··· 54 54 struct synproxy_stats __percpu *stats; 55 55 }; 56 56 57 - extern int synproxy_net_id; 57 + extern unsigned int synproxy_net_id; 58 58 static inline struct synproxy_net *synproxy_pernet(struct net *net) 59 59 { 60 60 return net_generic(net, synproxy_net_id);
+1 -1
include/net/netns/generic.h
··· 31 31 void *ptr[0]; 32 32 }; 33 33 34 - static inline void *net_generic(const struct net *net, int id) 34 + static inline void *net_generic(const struct net *net, unsigned int id) 35 35 { 36 36 struct net_generic *ng; 37 37 void *ptr;
+1 -1
kernel/audit.c
··· 126 126 127 127 /* The netlink socket. */ 128 128 static struct sock *audit_sock; 129 - static int audit_net_id; 129 + static unsigned int audit_net_id; 130 130 131 131 /* Hash for inode-based rules */ 132 132 struct list_head audit_inode_hash[AUDIT_INODE_BUCKETS];
+1 -1
net/8021q/vlan.c
··· 44 44 45 45 /* Global VLAN variables */ 46 46 47 - int vlan_net_id __read_mostly; 47 + unsigned int vlan_net_id __read_mostly; 48 48 49 49 const char vlan_fullname[] = "802.1Q VLAN Support"; 50 50 const char vlan_version[] = DRV_VERSION;
+1 -1
net/8021q/vlan.h
··· 159 159 160 160 extern struct rtnl_link_ops vlan_link_ops; 161 161 162 - extern int vlan_net_id; 162 + extern unsigned int vlan_net_id; 163 163 164 164 struct proc_dir_entry; 165 165
+1 -1
net/bridge/br_netfilter_hooks.c
··· 46 46 #include <linux/sysctl.h> 47 47 #endif 48 48 49 - static int brnf_net_id __read_mostly; 49 + static unsigned int brnf_net_id __read_mostly; 50 50 51 51 struct brnf_net { 52 52 bool enabled;
+1 -1
net/caif/caif_dev.c
··· 52 52 struct caif_device_entry_list caifdevs; 53 53 }; 54 54 55 - static int caif_net_id; 55 + static unsigned int caif_net_id; 56 56 static int q_high = 50; /* Percent */ 57 57 58 58 struct cfcnfg *get_cfcnfg(struct net *net)
+3 -4
net/core/net_namespace.c
··· 55 55 return ng; 56 56 } 57 57 58 - static int net_assign_generic(struct net *net, int id, void *data) 58 + static int net_assign_generic(struct net *net, unsigned int id, void *data) 59 59 { 60 60 struct net_generic *ng, *old_ng; 61 61 ··· 122 122 static void ops_free(const struct pernet_operations *ops, struct net *net) 123 123 { 124 124 if (ops->id && ops->size) { 125 - int id = *ops->id; 126 - kfree(net_generic(net, id)); 125 + kfree(net_generic(net, *ops->id)); 127 126 } 128 127 } 129 128 ··· 880 881 } 881 882 return error; 882 883 } 883 - max_gen_ptrs = max_t(unsigned int, max_gen_ptrs, *ops->id); 884 + max_gen_ptrs = max(max_gen_ptrs, *ops->id); 884 885 } 885 886 error = __register_pernet_operations(list, ops); 886 887 if (error) {
+1 -1
net/core/pktgen.c
··· 413 413 }; 414 414 415 415 416 - static int pg_net_id __read_mostly; 416 + static unsigned int pg_net_id __read_mostly; 417 417 418 418 struct pktgen_net { 419 419 struct net *net;
+2 -2
net/ipv4/ip_gre.c
··· 113 113 static struct rtnl_link_ops ipgre_link_ops __read_mostly; 114 114 static int ipgre_tunnel_init(struct net_device *dev); 115 115 116 - static int ipgre_net_id __read_mostly; 117 - static int gre_tap_net_id __read_mostly; 116 + static unsigned int ipgre_net_id __read_mostly; 117 + static unsigned int gre_tap_net_id __read_mostly; 118 118 119 119 static void ipgre_err(struct sk_buff *skb, u32 info, 120 120 const struct tnl_ptk_info *tpi)
+2 -2
net/ipv4/ip_tunnel.c
··· 994 994 } 995 995 EXPORT_SYMBOL(ip_tunnel_get_iflink); 996 996 997 - int ip_tunnel_init_net(struct net *net, int ip_tnl_net_id, 997 + int ip_tunnel_init_net(struct net *net, unsigned int ip_tnl_net_id, 998 998 struct rtnl_link_ops *ops, char *devname) 999 999 { 1000 1000 struct ip_tunnel_net *itn = net_generic(net, ip_tnl_net_id); ··· 1196 1196 EXPORT_SYMBOL_GPL(ip_tunnel_uninit); 1197 1197 1198 1198 /* Do least required initialization, rest of init is done in tunnel_init call */ 1199 - void ip_tunnel_setup(struct net_device *dev, int net_id) 1199 + void ip_tunnel_setup(struct net_device *dev, unsigned int net_id) 1200 1200 { 1201 1201 struct ip_tunnel *tunnel = netdev_priv(dev); 1202 1202 tunnel->ip_tnl_net_id = net_id;
+1 -1
net/ipv4/ip_vti.c
··· 46 46 47 47 static struct rtnl_link_ops vti_link_ops __read_mostly; 48 48 49 - static int vti_net_id __read_mostly; 49 + static unsigned int vti_net_id __read_mostly; 50 50 static int vti_tunnel_init(struct net_device *dev); 51 51 52 52 static int vti_input(struct sk_buff *skb, int nexthdr, __be32 spi,
+1 -1
net/ipv4/ipip.c
··· 121 121 module_param(log_ecn_error, bool, 0644); 122 122 MODULE_PARM_DESC(log_ecn_error, "Log packets received with corrupted ECN"); 123 123 124 - static int ipip_net_id __read_mostly; 124 + static unsigned int ipip_net_id __read_mostly; 125 125 126 126 static int ipip_tunnel_init(struct net_device *dev); 127 127 static struct rtnl_link_ops ipip_link_ops __read_mostly;
+1 -1
net/ipv4/netfilter/ipt_CLUSTERIP.c
··· 62 62 static const struct file_operations clusterip_proc_fops; 63 63 #endif 64 64 65 - static int clusterip_net_id __read_mostly; 65 + static unsigned int clusterip_net_id __read_mostly; 66 66 67 67 struct clusterip_net { 68 68 struct list_head configs;
+1 -1
net/ipv6/ip6_gre.c
··· 64 64 #define IP6_GRE_HASH_SIZE_SHIFT 5 65 65 #define IP6_GRE_HASH_SIZE (1 << IP6_GRE_HASH_SIZE_SHIFT) 66 66 67 - static int ip6gre_net_id __read_mostly; 67 + static unsigned int ip6gre_net_id __read_mostly; 68 68 struct ip6gre_net { 69 69 struct ip6_tnl __rcu *tunnels[4][IP6_GRE_HASH_SIZE]; 70 70
+1 -1
net/ipv6/ip6_tunnel.c
··· 83 83 static void ip6_tnl_dev_setup(struct net_device *dev); 84 84 static struct rtnl_link_ops ip6_link_ops __read_mostly; 85 85 86 - static int ip6_tnl_net_id __read_mostly; 86 + static unsigned int ip6_tnl_net_id __read_mostly; 87 87 struct ip6_tnl_net { 88 88 /* the IPv6 tunnel fallback device */ 89 89 struct net_device *fb_tnl_dev;
+1 -1
net/ipv6/ip6_vti.c
··· 64 64 static void vti6_dev_setup(struct net_device *dev); 65 65 static struct rtnl_link_ops vti6_link_ops __read_mostly; 66 66 67 - static int vti6_net_id __read_mostly; 67 + static unsigned int vti6_net_id __read_mostly; 68 68 struct vti6_net { 69 69 /* the vti6 tunnel fallback device */ 70 70 struct net_device *fb_tnl_dev;
+1 -1
net/ipv6/sit.c
··· 76 76 __be32 *v4dst); 77 77 static struct rtnl_link_ops sit_link_ops __read_mostly; 78 78 79 - static int sit_net_id __read_mostly; 79 + static unsigned int sit_net_id __read_mostly; 80 80 struct sit_net { 81 81 struct ip_tunnel __rcu *tunnels_r_l[IP6_SIT_HASH_SIZE]; 82 82 struct ip_tunnel __rcu *tunnels_r[IP6_SIT_HASH_SIZE];
+1 -1
net/ipv6/xfrm6_tunnel.c
··· 44 44 u32 spi; 45 45 }; 46 46 47 - static int xfrm6_tunnel_net_id __read_mostly; 47 + static unsigned int xfrm6_tunnel_net_id __read_mostly; 48 48 static inline struct xfrm6_tunnel_net *xfrm6_tunnel_pernet(struct net *net) 49 49 { 50 50 return net_generic(net, xfrm6_tunnel_net_id);
+1 -1
net/key/af_key.c
··· 36 36 #define _X2KEY(x) ((x) == XFRM_INF ? 0 : (x)) 37 37 #define _KEY2X(x) ((x) == 0 ? XFRM_INF : (x)) 38 38 39 - static int pfkey_net_id __read_mostly; 39 + static unsigned int pfkey_net_id __read_mostly; 40 40 struct netns_pfkey { 41 41 /* List of all pfkey sockets. */ 42 42 struct hlist_head table;
+1 -1
net/netfilter/ipset/ip_set_core.c
··· 36 36 bool is_destroyed; /* all sets are destroyed */ 37 37 }; 38 38 39 - static int ip_set_net_id __read_mostly; 39 + static unsigned int ip_set_net_id __read_mostly; 40 40 41 41 static inline struct ip_set_net *ip_set_pernet(struct net *net) 42 42 {
+1 -1
net/netfilter/ipvs/ip_vs_core.c
··· 70 70 #endif 71 71 EXPORT_SYMBOL(ip_vs_new_conn_out); 72 72 73 - static int ip_vs_net_id __read_mostly; 73 + static unsigned int ip_vs_net_id __read_mostly; 74 74 /* netns cnt used for uniqueness */ 75 75 static atomic_t ipvs_netns_cnt = ATOMIC_INIT(0); 76 76
+1 -1
net/netfilter/nf_conntrack_proto_dccp.c
··· 385 385 }; 386 386 387 387 /* this module per-net specifics */ 388 - static int dccp_net_id __read_mostly; 388 + static unsigned int dccp_net_id __read_mostly; 389 389 struct dccp_net { 390 390 struct nf_proto_net pn; 391 391 int dccp_loose;
+1 -1
net/netfilter/nf_conntrack_proto_gre.c
··· 53 53 [GRE_CT_REPLIED] = 180*HZ, 54 54 }; 55 55 56 - static int proto_gre_net_id __read_mostly; 56 + static unsigned int proto_gre_net_id __read_mostly; 57 57 struct netns_proto_gre { 58 58 struct nf_proto_net nf; 59 59 rwlock_t keymap_lock;
+1 -1
net/netfilter/nf_conntrack_proto_sctp.c
··· 144 144 } 145 145 }; 146 146 147 - static int sctp_net_id __read_mostly; 147 + static unsigned int sctp_net_id __read_mostly; 148 148 struct sctp_net { 149 149 struct nf_proto_net pn; 150 150 unsigned int timeouts[SCTP_CONNTRACK_MAX];
+1 -1
net/netfilter/nf_conntrack_proto_udplite.c
··· 35 35 [UDPLITE_CT_REPLIED] = 180*HZ, 36 36 }; 37 37 38 - static int udplite_net_id __read_mostly; 38 + static unsigned int udplite_net_id __read_mostly; 39 39 struct udplite_net { 40 40 struct nf_proto_net pn; 41 41 unsigned int timeouts[UDPLITE_CT_MAX];
+1 -1
net/netfilter/nf_synproxy_core.c
··· 24 24 #include <net/netfilter/nf_conntrack_synproxy.h> 25 25 #include <net/netfilter/nf_conntrack_zones.h> 26 26 27 - int synproxy_net_id; 27 + unsigned int synproxy_net_id; 28 28 EXPORT_SYMBOL_GPL(synproxy_net_id); 29 29 30 30 bool
+1 -1
net/netfilter/xt_hashlimit.c
··· 49 49 struct proc_dir_entry *ip6t_hashlimit; 50 50 }; 51 51 52 - static int hashlimit_net_id; 52 + static unsigned int hashlimit_net_id; 53 53 static inline struct hashlimit_net *hashlimit_pernet(struct net *net) 54 54 { 55 55 return net_generic(net, hashlimit_net_id);
+1 -1
net/netfilter/xt_recent.c
··· 95 95 #endif 96 96 }; 97 97 98 - static int recent_net_id __read_mostly; 98 + static unsigned int recent_net_id __read_mostly; 99 99 100 100 static inline struct recent_net *recent_pernet(struct net *net) 101 101 {
+1 -1
net/openvswitch/datapath.c
··· 58 58 #include "vport-internal_dev.h" 59 59 #include "vport-netdev.h" 60 60 61 - int ovs_net_id __read_mostly; 61 + unsigned int ovs_net_id __read_mostly; 62 62 63 63 static struct genl_family dp_packet_genl_family; 64 64 static struct genl_family dp_flow_genl_family;
+1 -1
net/openvswitch/datapath.h
··· 144 144 bool xt_label; 145 145 }; 146 146 147 - extern int ovs_net_id; 147 + extern unsigned int ovs_net_id; 148 148 void ovs_lock(void); 149 149 void ovs_unlock(void); 150 150
+1 -1
net/phonet/pn_dev.c
··· 44 44 struct phonet_routes routes; 45 45 }; 46 46 47 - static int phonet_net_id __read_mostly; 47 + static unsigned int phonet_net_id __read_mostly; 48 48 49 49 static struct phonet_net *phonet_pernet(struct net *net) 50 50 {
+1 -1
net/rds/tcp.c
··· 366 366 .t_mp_capable = 1, 367 367 }; 368 368 369 - static int rds_tcp_netid; 369 + static unsigned int rds_tcp_netid; 370 370 371 371 /* per-network namespace private data for this module */ 372 372 struct rds_tcp_net {
+1 -1
net/sched/act_bpf.c
··· 33 33 bool is_ebpf; 34 34 }; 35 35 36 - static int bpf_net_id; 36 + static unsigned int bpf_net_id; 37 37 static struct tc_action_ops act_bpf_ops; 38 38 39 39 static int tcf_bpf(struct sk_buff *skb, const struct tc_action *act,
+1 -1
net/sched/act_connmark.c
··· 30 30 31 31 #define CONNMARK_TAB_MASK 3 32 32 33 - static int connmark_net_id; 33 + static unsigned int connmark_net_id; 34 34 static struct tc_action_ops act_connmark_ops; 35 35 36 36 static int tcf_connmark(struct sk_buff *skb, const struct tc_action *a,
+1 -1
net/sched/act_csum.c
··· 42 42 [TCA_CSUM_PARMS] = { .len = sizeof(struct tc_csum), }, 43 43 }; 44 44 45 - static int csum_net_id; 45 + static unsigned int csum_net_id; 46 46 static struct tc_action_ops act_csum_ops; 47 47 48 48 static int tcf_csum_init(struct net *net, struct nlattr *nla,
+1 -1
net/sched/act_gact.c
··· 25 25 26 26 #define GACT_TAB_MASK 15 27 27 28 - static int gact_net_id; 28 + static unsigned int gact_net_id; 29 29 static struct tc_action_ops act_gact_ops; 30 30 31 31 #ifdef CONFIG_GACT_PROB
+1 -1
net/sched/act_ife.c
··· 35 35 36 36 #define IFE_TAB_MASK 15 37 37 38 - static int ife_net_id; 38 + static unsigned int ife_net_id; 39 39 static int max_metacnt = IFE_META_MAX + 1; 40 40 static struct tc_action_ops act_ife_ops; 41 41
+2 -2
net/sched/act_ipt.c
··· 30 30 31 31 #define IPT_TAB_MASK 15 32 32 33 - static int ipt_net_id; 33 + static unsigned int ipt_net_id; 34 34 static struct tc_action_ops act_ipt_ops; 35 35 36 - static int xt_net_id; 36 + static unsigned int xt_net_id; 37 37 static struct tc_action_ops act_xt_ops; 38 38 39 39 static int ipt_init_target(struct xt_entry_target *t, char *table,
+1 -1
net/sched/act_mirred.c
··· 70 70 [TCA_MIRRED_PARMS] = { .len = sizeof(struct tc_mirred) }, 71 71 }; 72 72 73 - static int mirred_net_id; 73 + static unsigned int mirred_net_id; 74 74 static struct tc_action_ops act_mirred_ops; 75 75 76 76 static bool dev_is_mac_header_xmit(const struct net_device *dev)
+1 -1
net/sched/act_nat.c
··· 31 31 32 32 #define NAT_TAB_MASK 15 33 33 34 - static int nat_net_id; 34 + static unsigned int nat_net_id; 35 35 static struct tc_action_ops act_nat_ops; 36 36 37 37 static const struct nla_policy nat_policy[TCA_NAT_MAX + 1] = {
+1 -1
net/sched/act_pedit.c
··· 25 25 26 26 #define PEDIT_TAB_MASK 15 27 27 28 - static int pedit_net_id; 28 + static unsigned int pedit_net_id; 29 29 static struct tc_action_ops act_pedit_ops; 30 30 31 31 static const struct nla_policy pedit_policy[TCA_PEDIT_MAX + 1] = {
+1 -1
net/sched/act_police.c
··· 55 55 56 56 /* Each policer is serialized by its individual spinlock */ 57 57 58 - static int police_net_id; 58 + static unsigned int police_net_id; 59 59 static struct tc_action_ops act_police_ops; 60 60 61 61 static int tcf_act_police_walker(struct net *net, struct sk_buff *skb,
+1 -1
net/sched/act_simple.c
··· 26 26 27 27 #define SIMP_TAB_MASK 7 28 28 29 - static int simp_net_id; 29 + static unsigned int simp_net_id; 30 30 static struct tc_action_ops act_simp_ops; 31 31 32 32 #define SIMP_MAX_DATA 32
+1 -1
net/sched/act_skbedit.c
··· 29 29 30 30 #define SKBEDIT_TAB_MASK 15 31 31 32 - static int skbedit_net_id; 32 + static unsigned int skbedit_net_id; 33 33 static struct tc_action_ops act_skbedit_ops; 34 34 35 35 static int tcf_skbedit(struct sk_buff *skb, const struct tc_action *a,
+1 -1
net/sched/act_skbmod.c
··· 22 22 23 23 #define SKBMOD_TAB_MASK 15 24 24 25 - static int skbmod_net_id; 25 + static unsigned int skbmod_net_id; 26 26 static struct tc_action_ops act_skbmod_ops; 27 27 28 28 #define MAX_EDIT_LEN ETH_HLEN
+1 -1
net/sched/act_tunnel_key.c
··· 22 22 23 23 #define TUNNEL_KEY_TAB_MASK 15 24 24 25 - static int tunnel_key_net_id; 25 + static unsigned int tunnel_key_net_id; 26 26 static struct tc_action_ops act_tunnel_key_ops; 27 27 28 28 static int tunnel_key_act(struct sk_buff *skb, const struct tc_action *a,
+1 -1
net/sched/act_vlan.c
··· 21 21 22 22 #define VLAN_TAB_MASK 15 23 23 24 - static int vlan_net_id; 24 + static unsigned int vlan_net_id; 25 25 static struct tc_action_ops act_vlan_ops; 26 26 27 27 static int tcf_vlan(struct sk_buff *skb, const struct tc_action *a,
+1 -1
net/sunrpc/netns.h
··· 34 34 struct proc_dir_entry *use_gssp_proc; 35 35 }; 36 36 37 - extern int sunrpc_net_id; 37 + extern unsigned int sunrpc_net_id; 38 38 39 39 int ip_map_cache_create(struct net *); 40 40 void ip_map_cache_destroy(struct net *);
+1 -1
net/sunrpc/sunrpc_syms.c
··· 24 24 25 25 #include "netns.h" 26 26 27 - int sunrpc_net_id; 27 + unsigned int sunrpc_net_id; 28 28 EXPORT_SYMBOL_GPL(sunrpc_net_id); 29 29 30 30 static __net_init int sunrpc_init_net(struct net *net)
+1 -1
net/tipc/core.c
··· 47 47 #include <linux/module.h> 48 48 49 49 /* configurable TIPC parameters */ 50 - int tipc_net_id __read_mostly; 50 + unsigned int tipc_net_id __read_mostly; 51 51 int sysctl_tipc_rmem[3] __read_mostly; /* min/default/max */ 52 52 53 53 static int __net_init tipc_init_net(struct net *net)
+1 -1
net/tipc/core.h
··· 74 74 #define MAX_BEARERS 3 75 75 #define TIPC_DEF_MON_THRESHOLD 32 76 76 77 - extern int tipc_net_id __read_mostly; 77 + extern unsigned int tipc_net_id __read_mostly; 78 78 extern int sysctl_tipc_rmem[3] __read_mostly; 79 79 extern int sysctl_tipc_named_timeout __read_mostly; 80 80