diff mbox series

[iproute2] man/tc-mirred: don't recommend modprobe

Message ID 20240111193451.48833-1-stephen@networkplumber.org (mailing list archive)
State Rejected
Delegated to: Stephen Hemminger
Headers show
Series [iproute2] man/tc-mirred: don't recommend modprobe | expand

Checks

Context Check Description
netdev/tree_selection success Not a local patch

Commit Message

Stephen Hemminger Jan. 11, 2024, 7:34 p.m. UTC
Use ip link add instead of explicit modprobe.
Kernel will do correct module loading if necessary.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 man/man8/tc-mirred.8 | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Jiri Pirko Jan. 12, 2024, 12:44 p.m. UTC | #1
Thu, Jan 11, 2024 at 08:34:44PM CET, stephen@networkplumber.org wrote:
>Use ip link add instead of explicit modprobe.
>Kernel will do correct module loading if necessary.
>
>Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>---
> man/man8/tc-mirred.8 | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
>diff --git a/man/man8/tc-mirred.8 b/man/man8/tc-mirred.8
>index 38833b452d92..2d9795b1b16f 100644
>--- a/man/man8/tc-mirred.8
>+++ b/man/man8/tc-mirred.8
>@@ -84,8 +84,7 @@ interface, it is possible to send ingress traffic through an instance of
> 
> .RS
> .EX
>-# modprobe ifb
>-# ip link set ifb0 up
>+# ip link add dev ifb0 type ifb

RTNETLINK answers: File exists

You can't add "ifb0" like this, it is created implicitly on module probe
time. Pick a different name.


> # tc qdisc add dev ifb0 root sfq
> # tc qdisc add dev eth0 handle ffff: ingress
> # tc filter add dev eth0 parent ffff: u32 \\
>-- 
>2.43.0
>
>
Stephen Hemminger Jan. 12, 2024, 5:09 p.m. UTC | #2
On Fri, 12 Jan 2024 13:44:47 +0100
Jiri Pirko <jiri@resnulli.us> wrote:

> Thu, Jan 11, 2024 at 08:34:44PM CET, stephen@networkplumber.org wrote:
> >Use ip link add instead of explicit modprobe.
> >Kernel will do correct module loading if necessary.
> >
> >Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> >---
> > man/man8/tc-mirred.8 | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> >diff --git a/man/man8/tc-mirred.8 b/man/man8/tc-mirred.8
> >index 38833b452d92..2d9795b1b16f 100644
> >--- a/man/man8/tc-mirred.8
> >+++ b/man/man8/tc-mirred.8
> >@@ -84,8 +84,7 @@ interface, it is possible to send ingress traffic through an instance of
> > 
> > .RS
> > .EX
> >-# modprobe ifb
> >-# ip link set ifb0 up
> >+# ip link add dev ifb0 type ifb  
> 
> RTNETLINK answers: File exists
> 
> You can't add "ifb0" like this, it is created implicitly on module probe
> time. Pick a different name.

Right.
Looks like ifb is behaving differently than other devices.
For example, doing modprobe of dummy creates no device.
Jiri Pirko Jan. 12, 2024, 6:21 p.m. UTC | #3
Fri, Jan 12, 2024 at 06:09:15PM CET, stephen@networkplumber.org wrote:
>On Fri, 12 Jan 2024 13:44:47 +0100
>Jiri Pirko <jiri@resnulli.us> wrote:
>
>> Thu, Jan 11, 2024 at 08:34:44PM CET, stephen@networkplumber.org wrote:
>> >Use ip link add instead of explicit modprobe.
>> >Kernel will do correct module loading if necessary.
>> >
>> >Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
>> >---
>> > man/man8/tc-mirred.8 | 3 +--
>> > 1 file changed, 1 insertion(+), 2 deletions(-)
>> >
>> >diff --git a/man/man8/tc-mirred.8 b/man/man8/tc-mirred.8
>> >index 38833b452d92..2d9795b1b16f 100644
>> >--- a/man/man8/tc-mirred.8
>> >+++ b/man/man8/tc-mirred.8
>> >@@ -84,8 +84,7 @@ interface, it is possible to send ingress traffic through an instance of
>> > 
>> > .RS
>> > .EX
>> >-# modprobe ifb
>> >-# ip link set ifb0 up
>> >+# ip link add dev ifb0 type ifb  
>> 
>> RTNETLINK answers: File exists
>> 
>> You can't add "ifb0" like this, it is created implicitly on module probe
>> time. Pick a different name.
>
>Right.
>Looks like ifb is behaving differently than other devices.
>For example, doing modprobe of dummy creates no device.

Older drivers did do this. Bonding modprobe also created bond0 in
the past. Now it does not. I guess ifb behaviour could be changed as
well.

>
>
Stephen Hemminger Jan. 12, 2024, 6:42 p.m. UTC | #4
On Fri, 12 Jan 2024 19:21:34 +0100
Jiri Pirko <jiri@resnulli.us> wrote:

> >> 
> >> You can't add "ifb0" like this, it is created implicitly on module probe
> >> time. Pick a different name.  
> >
> >Right.
> >Looks like ifb is behaving differently than other devices.
> >For example, doing modprobe of dummy creates no device.  
> 
> Older drivers did do this. Bonding modprobe also created bond0 in
> the past. Now it does not. I guess ifb behaviour could be changed as
> well.

In most distros, for bond and dummy, there is this from systemd.conf


options bonding max_bonds=0
options dummy numdummies=0
diff mbox series

Patch

diff --git a/man/man8/tc-mirred.8 b/man/man8/tc-mirred.8
index 38833b452d92..2d9795b1b16f 100644
--- a/man/man8/tc-mirred.8
+++ b/man/man8/tc-mirred.8
@@ -84,8 +84,7 @@  interface, it is possible to send ingress traffic through an instance of
 
 .RS
 .EX
-# modprobe ifb
-# ip link set ifb0 up
+# ip link add dev ifb0 type ifb
 # tc qdisc add dev ifb0 root sfq
 # tc qdisc add dev eth0 handle ffff: ingress
 # tc filter add dev eth0 parent ffff: u32 \\