Skip to content

Commit

Permalink
cni: make sure mq and fq
Browse files Browse the repository at this point in the history
Signed-off-by: l1b0k <[email protected]>
  • Loading branch information
l1b0k committed Nov 28, 2024
1 parent 59d33ee commit 0377a34
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions plugin/datapath/policy_router_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ func (d *PolicyRoute) Setup(ctx context.Context, cfg *types.SetupConfig, netNS n
}

if cfg.BandwidthMode == types.BandwidthModeEDT && cfg.Egress > 0 {
err = ensureMQ(ctx, eni)
err = ensureMQFQ(ctx, eni)
if err != nil {
return err
}
Expand Down Expand Up @@ -496,7 +496,7 @@ func (d *PolicyRoute) Teardown(ctx context.Context, cfg *types.TeardownCfg, netN
return utils.DelEgressPriority(ctx, link, cfg.ContainerIPNet)
}

func ensureMQ(ctx context.Context, link netlink.Link) error {
func ensureMQFQ(ctx context.Context, link netlink.Link) error {
mq := &netlink.GenericQdisc{
QdiscAttrs: netlink.QdiscAttrs{
LinkIndex: link.Attrs().Index,
Expand All @@ -520,6 +520,10 @@ func ensureMQ(ctx context.Context, link netlink.Link) error {
continue
}

_, ok := qd.(*netlink.Fq)
if !ok {
continue
}
found = true
}
if found {
Expand Down

0 comments on commit 0377a34

Please sign in to comment.