Giter Club home page Giter Club logo

Comments (5)

thombashi avatar thombashi commented on May 30, 2024

Thank you for your report.

Certainly, these are not a preferable behavior.
I think that there are two problems:

  1. tcshow only display the last tc setting
  2. tcset allow multiple shaping rules for the same device and the same network
    • --add option should allow only when different rules for the different devices/networks

I will fix 2. in the future release, and 1. will never happen if I fix 2.

from tcconfig.

twdkeule avatar twdkeule commented on May 30, 2024

Well 1. can still occur if you make a script with --tc-script and apply that, or when you run tc by itself.
It would be very nice if tcshow would parse the output of tc qdisc show, so it would always be correct. However, this might take it too far.

I am also a bit confused what the --add option does. What would be the difference between

➜  ~ sudo tcset --device lo --rate 10M
➜  ~ sudo tcset --device lo --delay 10

and

➜  ~ sudo tcset --device lo --rate 10M
➜  ~ sudo tcset --device lo --delay 10 --add

from tcconfig.

thombashi avatar thombashi commented on May 30, 2024

I've fixed the 2. at tcconfig 0.12.0.

Well 1. can still occur if you make a script with --tc-script and apply that, or when you run tc by itself.
It would be very nice if tcshow would parse the output of tc qdisc show, so it would always be correct. However, this might take it too far.

You are absolutely right. However, that is out of scope (at least for now).
tcshow only aims to show the settings by tcset (too many things to consider to create general purpose tc setting display tool)

I am also a bit confused what the --add option does. What would be the difference between

Purpose --add option is to set multiple shaping rules to a device as follows:

# tcset --device eth0 --network 192.168.0.0/24 --delay 10
# tcset --device eth0 --network 192.168.1.0/24 --delay 50
[NOTICE] tcconfig: failed to 'tc qdisc add': qdisc already exists (dev eth0, handle=1a1a:, algo=htb). execute with --overwrite option if you want to overwrite the existing rules. execute with --add option if you want to add a new rule in addition to the existing rules.
# tcset --device eth0 --network 192.168.1.0/24 --delay 50 --add
# tcshow --device eth0
{
    "eth0": {
        "outgoing": {
            "dst-network=192.168.1.0/24, protocol=ip": {
                "delay": "50.0",
                "rate": "1G"
            },
            "dst-network=192.168.0.0/24, protocol=ip": {
                "delay": "10.0",
                "rate": "1G"
            }
        },
        "incoming": {}
    }
}

from tcconfig.

twdkeule avatar twdkeule commented on May 30, 2024

Thanks, now I get it.

from tcconfig.

thombashi avatar thombashi commented on May 30, 2024

I'll close the issue then.
Thanks,

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.