Skip to content

Comments

default.sh: fix USE_MQ logic#183

Closed
jkoeppeler wants to merge 13 commits intotohojo:mainfrom
jkoeppeler:fix-default-use-mq
Closed

default.sh: fix USE_MQ logic#183
jkoeppeler wants to merge 13 commits intotohojo:mainfrom
jkoeppeler:fix-default-use-mq

Conversation

@jkoeppeler
Copy link

Before USE_MQ would be always set to zero if default.sh was included by a script that did not set SUPPORT_MQ. Once USE_MQ was set to zero, it could never be set to 1 again. This patch inverts this logic, such that whenever SUPPORT_MQ is set, USE_MQ is also set.

Before USE_MQ would be always set to zero if default.sh was included by
a script that did not set SUPPORT_MQ. Once USE_MQ was set to zero, it
could never be set to 1 again. This patch inverts this logic, such that
whenever SUPPORT_MQ is set, USE_MQ is also set.

Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
@jkoeppeler
Copy link
Author

Before merge, let me just test it again, just to be sure.

@moeller0
Copy link
Collaborator

moeller0 commented Feb 17, 2026 via email

Jonas Köppeler added 2 commits February 18, 2026 10:59
Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
ip command in busybox does not support creation of multi queue ifb
devices and will silently create a single queue device. Thus
verifying cake_mq will always fail. To correctly verify cake_mq, try to
install cake_mq on the real interface instead.

Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
src/functions.sh Outdated
#cake_mq needs to be tested on a multi-queue device
#ip command in busybox does not support creating a multi tx queue ifb device
#thus test cake_mq on the real interface.
cake_mq) dev=$IFACE ;;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is no good - replacing the qdisc on the physical interface has side effects, so we shouldn't be doing that for testing.

Instead, we'll need to try the real attachment with cake_mq, and if that fails, fall back to regular cake.

Maybe a helper function, like:

install_cake()
{
  local iface
  local qdisc
  local res
  iface=$1
  shift

  qdisc=$(select_cake $iface)
  $TC qdisc replace dev $iface root $qdisc "$@"
  res=$?
  if [ "$res" -ne "0" ] && [ "$qdisc" = "cake_mq" ]; then
    $TC qdisc replace dev $iface root cake "$@"
    res=$?
  fi
  return $res
}

And then call it from the .qos scripts in place of the tc qdisc calls...

Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
Jonas Köppeler added 3 commits February 18, 2026 17:29
This reverts commit ebf63be.

Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
Jonas Köppeler added 2 commits February 18, 2026 17:34
Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
Jonas Köppeler added 4 commits February 19, 2026 09:25
Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
This reverts commit 1d7ea82.

Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
Signed-off-by: Jonas Köppeler <j.koeppeler@tu-berlin.de>
@moeller0
Copy link
Collaborator

Just to discuss this fully, and to understand the rationale against it. Why not simply use the $QDISC variable to let the user explicitly choose between cake and mq-cake. And make the choice of the IFB number of queues directly dependent on $QDISC being mq-cake. If that fails we simply use the already existing and hopefully working error reporting (we might add a pointer to install iputils-ip to work around busybox)?
This trades in the really convenient change of defaulting all existing instances to mq-cake, but that in itself will make sure that existing configurations should just continue to work without subtle side effects from mq-cake, no?

@jkoeppeler
Copy link
Author

I think what I also like about this, is that it is more explicit, which qdisc is currently installed. But maybe we should then add iputils-ip as a dependency. Only if people have iputils-ip installed cake_mq will appear as "available qdisc".

@jkoeppeler
Copy link
Author

@moeller0 I created a second version, that will use the QDISC variable and removes the other configuration variables in #185.

@tohojo
Copy link
Owner

tohojo commented Feb 23, 2026

Closing in favour of #184

@tohojo tohojo closed this Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants