Commit ff420c56 authored by Paolo Abeni's avatar Paolo Abeni
Browse files

Merge branch 'multi-queue-aware-sch_cake'

 says:

====================
Multi-queue aware sch_cake

This series adds a multi-queue aware variant of the sch_cake scheduler,
called 'cake_mq'. Using this makes it possible to scale the rate shaper
of sch_cake across multiple CPUs, while still enforcing a single global
rate on the interface.

The approach taken in this patch series is to implement a separate qdisc
called 'cake_mq', which is based on the existing 'mq' qdisc, but differs
in a couple of aspects:

- It will always install a cake instance on each hardware queue (instead
  of using the default qdisc for each queue like 'mq' does).

- The cake instances on the queues will share their configuration, which
  can only be modified through the parent cake_mq instance.

Doing things this way simplifies user configuration by centralising
all configuration through the cake_mq qdisc (which also serves as an
obvious way of opting into the multi-queue aware behaviour). The cake_mq
qdisc takes all the same configuration parameters as the cake qdisc.

An earlier version of this work was presented at this year's Netdevconf:
https://netdevconf.info/0x19/sessions/talk/mq-cake-scaling-software-rate-limiting-across-cpu-cores.html

The patch series is structured as follows:

- Patch 1 exports the mq qdisc functions for reuse.

- Patch 2 factors out the sch_cake configuration variables into a
  separate struct that can be shared between instances.

- Patch 3 adds the basic cake_mq qdisc, reusing the exported mq code

- Patch 4 adds configuration sharing across the cake instances installed
  under cake_mq

- Patch 5 adds the shared shaper state that enables the multi-core rate
  shaping

- Patch 6 adds selftests for cake_mq

A patch to iproute2 to make it aware of the cake_mq qdisc were submitted
separately with a previous patch version:

https://lore.kernel.org/r/20260105162902.1432940-1-toke@redhat.com
====================

Link: https://patch.msgid.link/20260109-mq-cake-sub-qdisc-v8-0-8d613fece5d8@redhat.com


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents de746f8f 8d61f1a9
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -2207,6 +2207,9 @@ attribute-sets:
      -
        name: blue-timer-us
        type: s32
      -
        name: active-queues
        type: u32
  -
    name: cake-tin-stats-attrs
    name-prefix: tca-cake-tin-stats-
+1 −0
Original line number Diff line number Diff line
@@ -25454,6 +25454,7 @@ L: netdev@vger.kernel.org
S:	Maintained
F:	include/net/pkt_cls.h
F:	include/net/pkt_sched.h
F:	include/net/sch_priv.h
F:	include/net/tc_act/
F:	include/uapi/linux/pkt_cls.h
F:	include/uapi/linux/pkt_sched.h

include/net/sch_priv.h

0 → 100644
+27 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __NET_SCHED_PRIV_H
#define __NET_SCHED_PRIV_H

#include <net/sch_generic.h>

struct mq_sched {
	struct Qdisc		**qdiscs;
};

int mq_init_common(struct Qdisc *sch, struct nlattr *opt,
		   struct netlink_ext_ack *extack,
		   const struct Qdisc_ops *qdisc_ops);
void mq_destroy_common(struct Qdisc *sch);
void mq_attach(struct Qdisc *sch);
void mq_dump_common(struct Qdisc *sch, struct sk_buff *skb);
struct netdev_queue *mq_select_queue(struct Qdisc *sch,
				     struct tcmsg *tcm);
struct Qdisc *mq_leaf(struct Qdisc *sch, unsigned long cl);
unsigned long mq_find(struct Qdisc *sch, u32 classid);
int mq_dump_class(struct Qdisc *sch, unsigned long cl,
		  struct sk_buff *skb, struct tcmsg *tcm);
int mq_dump_class_stats(struct Qdisc *sch, unsigned long cl,
			struct gnet_dump *d);
void mq_walk(struct Qdisc *sch, struct qdisc_walker *arg);

#endif
+1 −0
Original line number Diff line number Diff line
@@ -1036,6 +1036,7 @@ enum {
	TCA_CAKE_STATS_DROP_NEXT_US,
	TCA_CAKE_STATS_P_DROP,
	TCA_CAKE_STATS_BLUE_TIMER_US,
	TCA_CAKE_STATS_ACTIVE_QUEUES,
	__TCA_CAKE_STATS_MAX
};
#define TCA_CAKE_STATS_MAX (__TCA_CAKE_STATS_MAX - 1)
+378 −136

File changed.

Preview size limit exceeded, changes collapsed.

Loading