Skip to contentSkip to conversation

Possible to add netfilter hooks to IFB driver?

DISCUSSION Brad Johnson 5 participants 6 messages Sep 3, 2013 – Jan 8, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

I would like to add netfilter hooks to the IFB driver so I can do iptables -j IFB (just like we can with IMQ). But I would like to know first if there are any reasons this can not work. Please advise if this is possible, and if so any tips would be appreciated.

Cheers,
Brad

#1 lore raw
Quoted 4 lines · On Tue, 03 Sep 2013 16:26:09 -0500 Brad Johnson <[email protected]> wrote:

I would like to add netfilter hooks to the IFB driver so I can do iptables -j IFB (just like we can with IMQ). But I would like to know first if there are any reasons this can not work. Please advise if this is possible, and if so any tips would be appreciated.

I would like to have the same feature for ingress shaping via connection marking. But this page says "wont go back to putting netfilter hooks" but have a "contrack related action":
http://www.linuxfoundation.org/collaborate/workgroups/networking/ifb
http://thread.gmane.org/gmane.linux.network/21224

I don't know if someone made a patch for either implementation.

Best regards,
Alban

#2 lore raw
In reply to Brad Johnson
Quoted 7 lines · On Tue, 03 Sep 2013 16:26:09 -0500 Brad Johnson <[email protected]> wrote:

I would like to add netfilter hooks to the IFB driver so I can do iptables -j IFB (just like we can with IMQ). But I would like to know first if there are any reasons this can not work. Please advise if this is possible, and if so any tips would be appreciated.

Cheers,
Brad

The risk is creating the same races that made IMQ unacceptable.

#3 lore raw
Quoted 3 lines · Stephen Hemminger

The risk is creating the same races that made IMQ unacceptable. --

I believe openwrt nowadays uses a TC action which runs the packet through prerouting then pulls in the mark off the ct entry into the skb, so ingress+IFB can take action on it.

Perhaps a cleaned up version of this would be suitable for upstream?

#4 lore raw
Quoted 9 lines · On Mon, 6 Jan 2014 15:51:37 -0700 Andrew Collins <[email protected]> wrote:
Quoted 3 lines · Stephen Hemminger

The risk is creating the same races that made IMQ unacceptable. --

I believe openwrt nowadays uses a TC action which runs the packet through prerouting then pulls in the mark off the ct entry into the skb, so ingress+IFB can take action on it.

Thanks for the info. I guess the implementation is this one:

https://dev.openwrt.org/browser/trunk/target/linux/generic/patches-3.12/621-sched_act_connmark.patch
https://dev.openwrt.org/browser/trunk/package/network/utils/iproute2/patches/210-add-act_connmark.patch
https://dev.openwrt.org/browser/trunk/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh#L343

Quoted 1 line

Perhaps a cleaned up version of this would be suitable for upstream?

I don't know but this seems a useful feature to me.

Best regards,
Alban

#5 lore raw
Quoted 15 lines · Alban Crequy
Quoted 9 lines · On Mon, 6 Jan 2014 15:51:37 -0700 Andrew Collins <[email protected]> wrote:
Quoted 3 lines · Stephen Hemminger

The risk is creating the same races that made IMQ unacceptable. --

I believe openwrt nowadays uses a TC action which runs the packet through prerouting then pulls in the mark off the ct entry into the skb, so ingress+IFB can take action on it.

Thanks for the info. I guess the implementation is this one:

Quoted 8 lines

https://dev.openwrt.org/browser/trunk/target/linux/generic/patches-3.12/621-sched_act_connmark.patch
https://dev.openwrt.org/browser/trunk/package/network/utils/iproute2/patches/210-add-act_connmark.patch
https://dev.openwrt.org/browser/trunk/package/network/config/qos-scripts/files/usr/lib/qos/generate.sh#L343

Quoted 1 line

Perhaps a cleaned up version of this would be suitable for upstream?

I don't know but this seems a useful feature to me.

I like that approach - discussion was had here on netdev about a year ago refer to:
http://marc.info/?t=135591832200007&r=1&w=2
since it is a long thread, jump to here:
http://marc.info/?l=linux-netdev&m=135634890120552&w=2

I believe Pablo brought it up at the last netfilter meeting and there was no disagreement to get it going.
I dont know if kids still use these expressions - but send him some virtual beer and he may return the love.

cheers,
jamal