Skip to content

Commit 86f8515

Browse files
Daniel Borkmannummakynes
authored andcommitted
net: netprio: rename config to be more consistent with cgroup configs
While we're at it and introduced CGROUP_NET_CLASSID, lets also make NETPRIO_CGROUP more consistent with the rest of cgroups and rename it into CONFIG_CGROUP_NET_PRIO so that for networking, we now have CONFIG_CGROUP_NET_{PRIO,CLASSID}. This not only makes the CONFIG option consistent among networking cgroups, but also among cgroups CONFIG conventions in general as the vast majority has a prefix of CONFIG_CGROUP_<SUBSYS>. Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Cc: Zefan Li <lizefan@huawei.com> Cc: cgroups@vger.kernel.org Acked-by: Li Zefan <lizefan@huawei.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
1 parent fe1217c commit 86f8515

8 files changed

Lines changed: 14 additions & 20 deletions

File tree

‎include/linux/cgroup_subsys.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ SUBSYS(blkio)
4343
SUBSYS(perf)
4444
#endif
4545

46-
#if IS_SUBSYS_ENABLED(CONFIG_NETPRIO_CGROUP)
46+
#if IS_SUBSYS_ENABLED(CONFIG_CGROUP_NET_PRIO)
4747
SUBSYS(net_prio)
4848
#endif
4949

‎include/linux/netdevice.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1444,7 +1444,7 @@ struct net_device {
14441444
/* max exchange id for FCoE LRO by ddp */
14451445
unsigned int fcoe_ddp_xid;
14461446
#endif
1447-
#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
1447+
#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
14481448
struct netprio_map __rcu *priomap;
14491449
#endif
14501450
/* phy device may attach itself for hardware timestamping */

‎include/net/netprio_cgroup.h‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313

1414
#ifndef _NETPRIO_CGROUP_H
1515
#define _NETPRIO_CGROUP_H
16+
1617
#include <linux/cgroup.h>
1718
#include <linux/hardirq.h>
1819
#include <linux/rcupdate.h>
1920

20-
21-
#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
21+
#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
2222
struct netprio_map {
2323
struct rcu_head rcu;
2424
u32 priomap_len;
@@ -27,8 +27,7 @@ struct netprio_map {
2727

2828
void sock_update_netprioidx(struct sock *sk);
2929

30-
#if IS_BUILTIN(CONFIG_NETPRIO_CGROUP)
31-
30+
#if IS_BUILTIN(CONFIG_CGROUP_NET_PRIO)
3231
static inline u32 task_netprioidx(struct task_struct *p)
3332
{
3433
struct cgroup_subsys_state *css;
@@ -40,9 +39,7 @@ static inline u32 task_netprioidx(struct task_struct *p)
4039
rcu_read_unlock();
4140
return idx;
4241
}
43-
44-
#elif IS_MODULE(CONFIG_NETPRIO_CGROUP)
45-
42+
#elif IS_MODULE(CONFIG_CGROUP_NET_PRIO)
4643
static inline u32 task_netprioidx(struct task_struct *p)
4744
{
4845
struct cgroup_subsys_state *css;
@@ -56,16 +53,13 @@ static inline u32 task_netprioidx(struct task_struct *p)
5653
return idx;
5754
}
5855
#endif
59-
60-
#else /* !CONFIG_NETPRIO_CGROUP */
61-
56+
#else /* !CONFIG_CGROUP_NET_PRIO */
6257
static inline u32 task_netprioidx(struct task_struct *p)
6358
{
6459
return 0;
6560
}
6661

6762
#define sock_update_netprioidx(sk)
6863

69-
#endif /* CONFIG_NETPRIO_CGROUP */
70-
64+
#endif /* CONFIG_CGROUP_NET_PRIO */
7165
#endif /* _NET_CLS_CGROUP_H */

‎include/net/sock.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ struct sock {
395395
unsigned short sk_ack_backlog;
396396
unsigned short sk_max_ack_backlog;
397397
__u32 sk_priority;
398-
#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
398+
#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
399399
__u32 sk_cgrp_prioidx;
400400
#endif
401401
struct pid *sk_peer_pid;

‎net/Kconfig‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,12 @@ config XPS
238238
depends on SMP
239239
default y
240240

241-
config NETPRIO_CGROUP
241+
config CGROUP_NET_PRIO
242242
tristate "Network priority cgroup"
243243
depends on CGROUPS
244244
---help---
245245
Cgroup subsystem for use in assigning processes to network priorities on
246-
a per-interface basis
246+
a per-interface basis.
247247

248248
config CGROUP_NET_CLASSID
249249
boolean "Network classid cgroup"

‎net/core/Makefile‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ obj-$(CONFIG_FIB_RULES) += fib_rules.o
2121
obj-$(CONFIG_TRACEPOINTS) += net-traces.o
2222
obj-$(CONFIG_NET_DROP_MONITOR) += drop_monitor.o
2323
obj-$(CONFIG_NETWORK_PHY_TIMESTAMPING) += timestamping.o
24-
obj-$(CONFIG_NETPRIO_CGROUP) += netprio_cgroup.o
24+
obj-$(CONFIG_CGROUP_NET_PRIO) += netprio_cgroup.o
2525
obj-$(CONFIG_CGROUP_NET_CLASSID) += netclassid_cgroup.o

‎net/core/dev.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2747,7 +2747,7 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,
27472747
return rc;
27482748
}
27492749

2750-
#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
2750+
#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
27512751
static void skb_update_prio(struct sk_buff *skb)
27522752
{
27532753
struct netprio_map *map = rcu_dereference_bh(skb->dev->priomap);

‎net/core/sock.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1308,7 +1308,7 @@ static void sk_prot_free(struct proto *prot, struct sock *sk)
13081308
module_put(owner);
13091309
}
13101310

1311-
#if IS_ENABLED(CONFIG_NETPRIO_CGROUP)
1311+
#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
13121312
void sock_update_netprioidx(struct sock *sk)
13131313
{
13141314
if (in_interrupt())

0 commit comments

Comments
 (0)