Giter Club home page Giter Club logo

Comments (8)

thombashi avatar thombashi commented on May 30, 2024 1

Please let me confirm your suggestion especially the latter part.

changing the logic of --change option.

Does it means to change the logic as follows?

Before (current behavior)

  • Already exist a shaping rule -> Changing the rule parameter
  • NOT exist a shaping rule -> Exit with error

After

  • Already exist a shaping rule -> Changing the rule parameter (no change)
  • NOT exist a shaping rule -> Add a new rule

from tcconfig.

thombashi avatar thombashi commented on May 30, 2024 1

@dastergon
Thank you for your confirmation.
It sure seems to be one of the common usages.
I would implement the feature in the next release.

from tcconfig.

thombashi avatar thombashi commented on May 30, 2024 1

@dastergon
Sorry to bother you.
I believe the problem fixed at tcconfig 0.16.1.
Could you try this version?

# tcdel -d ens33 -a
# tcset --direction outgoing --dst-network 192.168.122.202 --delay 12milliseconds --rate 1Gbps --device ens33 --change
# tcset --direction incoming --dst-network 192.168.122.202 --delay 12milliseconds --device ens33 --rate 1Gbps --change
# tcset --direction outgoing --dst-network 192.168.122.203 --delay 12milliseconds --rate 1Gbps --device ens33 --change
# tcset --direction incoming --dst-network 192.168.122.203 --delay 12milliseconds --device ens33 --rate 1Gbps --change
# tcshow -d ens33
{
    "ens33": {
        "outgoing": {
            "dst-network=192.168.122.202/32, protocol=ip": {
                "filter_id": "800::800",
                "delay": "12.0ms",
                "rate": "1G"
            },
            "dst-network=192.168.122.203/32, protocol=ip": {
                "filter_id": "800::801",
                "delay": "12.0ms",
                "rate": "1G"
            }
        },
        "incoming": {
            "dst-network=192.168.122.202/32, protocol=ip": {
                "filter_id": "800::800",
                "delay": "12.0ms",
                "rate": "1G"
            },
            "dst-network=192.168.122.203/32, protocol=ip": {
                "filter_id": "800::801",
                "delay": "12.0ms",
                "rate": "1G"
            }
        }
    }
}

from tcconfig.

dastergon avatar dastergon commented on May 30, 2024

@thombashi exactly! Add a new rule but do not affect existing rules(i.e., --overwrite behavior).

from tcconfig.

thombashi avatar thombashi commented on May 30, 2024

@dastergon
I have changed the --change option behavior as described in the above comment.
Please try tcconfig 0.16.0.

# tcshow -d ens33
{
    "ens33": {
        "outgoing": {},
        "incoming": {}
    }
}
# tcset -d ens33 --delay 10ms --change
# tcshow -d ens33
{
    "ens33": {
        "outgoing": {
            "protocol=ip": {
                "filter_id": "800::800",
                "delay": "10.0ms",
                "rate": "1G"
            }
        },
        "incoming": {}
    }
}

from tcconfig.

dastergon avatar dastergon commented on May 30, 2024

@thombashi

I have an issue when I try to create multiple entries with the --change option.

How to reproduce

tcset --direction outgoing --dst-network 192.168.122.202 --delay 12milliseconds --rate 10Gbps --device ens3 --change
tcset --direction incoming --dst-network 192.168.122.202 --delay 12milliseconds --device ens3 --rate 10Gbps --change

The commands work as expected:

tcshow -d ens3
{
    "ens3": {
        "outgoing": {
            "dst-network=192.168.122.202/32, protocol=ip": {
                "delay": "12.0ms",
                "rate": "10G",
                "filter_id": "800::800"
            }
        },
        "incoming": {
            "dst-network=192.168.122.202/32, protocol=ip": {
                "delay": "12.0ms",
                "rate": "10G",
                "filter_id": "800::800"
            }
        }
    }
}

But when I try to add a new entry for a different network:

tcset --direction outgoing --dst-network 192.168.122.203 --delay 12milliseconds --rate 10Gbps --device ens3 --change; tcset --direction incoming --dst-network 192.168.122.203 --delay 12milliseconds --device ens3 --rate 10Gbps --change;

I get the following error:

[NOTICE] tcconfig: failed to 'tc qdisc add': qdisc already exists (dev ens3, handle=1602:, algo=htb). try to execute with: (a) --overwrite option if you want to overwrite the existing rule. (b) --add option if you want to add a new rule in addition to the existing rules. (c) --change option if you want to change the existing rule parameter.
[NOTICE] tcconfig: failed to add ip link: ip link already exists. try to execute with: (a) --overwrite option if you want to overwrite the existing rule. (b) --add option if you want to add a new rule in addition to the existing rules. (c) --change option if you want to change the existing rule parameter.
[NOTICE] tcconfig: failed to 'tc qdisc add': ingress qdisc already exists. try to execute with: (a) --overwrite option if you want to overwrite the existing rule. (b) --add option if you want to add a new rule in addition to the existing rules. (c) --change option if you want to change the existing rule parameter.
[NOTICE] tcconfig: failed to 'tc qdisc add': qdisc already exists (dev ifb5634, handle=1602:, algo=htb). try to execute with: (a) --overwrite option if you want to overwrite the existing rule. (b) --add option if you want to add a new rule in addition to the existing rules. (c) --change option if you want to change the existing rule parameter.

from tcconfig.

dastergon avatar dastergon commented on May 30, 2024

@thombashi It works now! Thanks!

from tcconfig.

thombashi avatar thombashi commented on May 30, 2024

@dastergon
Thank you for confirming.
I will close the issue then.

from tcconfig.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.