From ec195c6603fbc94097a7d9a65886e6f9dd3368e0 Mon Sep 17 00:00:00 2001 From: Siger Yang Date: Wed, 17 Aug 2022 19:00:39 +0800 Subject: [PATCH 1/2] zebra: use default NS directly in tc dplane Signed-off-by: Siger Yang --- zebra/zebra_dplane.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 2fc1fad8ba17..3cfdfd21e5bd 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -2775,14 +2775,13 @@ int dplane_ctx_tc_init(struct zebra_dplane_ctx *ctx, enum dplane_op_e op) { int ret = EINVAL; - struct zebra_vrf *zvrf = NULL; struct zebra_ns *zns = NULL; ctx->zd_op = op; ctx->zd_status = ZEBRA_DPLANE_REQUEST_SUCCESS; /* TODO: init traffic control qdisc */ - zns = zvrf ? zvrf->zns : zebra_ns_lookup(NS_DEFAULT); + zns = zebra_ns_lookup(NS_DEFAULT); dplane_ctx_ns_init(ctx, zns, true); From 4c9b85ac7a6b9fa3c55228b31071185e39c4c6f7 Mon Sep 17 00:00:00 2001 From: Siger Yang Date: Wed, 17 Aug 2022 19:02:13 +0800 Subject: [PATCH 2/2] zebra: fix ctab calculation typo in tc netlink Signed-off-by: Siger Yang --- zebra/tc_netlink.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zebra/tc_netlink.c b/zebra/tc_netlink.c index 89ce075454b0..4fb0241d1d47 100644 --- a/zebra/tc_netlink.c +++ b/zebra/tc_netlink.c @@ -294,7 +294,7 @@ static ssize_t netlink_tclass_msg_encode(int cmd, struct zebra_dplane_ctx *ctx, htb_opt.cbuffer = cbuffer; tc_calc_rate_table(&htb_opt.rate, rtab, mtu); - tc_calc_rate_table(&htb_opt.ceil, rtab, mtu); + tc_calc_rate_table(&htb_opt.ceil, ctab, mtu); htb_opt.ceil.mpu = htb_opt.rate.mpu = 0; htb_opt.ceil.overhead = htb_opt.rate.overhead = 0;