* add a prerelease IMQ patch for 2.6.25 * reenable IMQ in the kernel config * resync patches

SVN-Revision: 11324
lede-17.01
Imre Kaloz 2008-06-02 09:10:48 +00:00
parent 7cce2d8fc3
commit c0551f41af
3 changed files with 31 additions and 31 deletions

View File

@ -469,7 +469,7 @@ CONFIG_IFB=m
# CONFIG_IGB is not set # CONFIG_IGB is not set
# CONFIG_IKCONFIG is not set # CONFIG_IKCONFIG is not set
# CONFIG_IKCONFIG_PROC is not set # CONFIG_IKCONFIG_PROC is not set
# CONFIG_IMQ is not set CONFIG_IMQ=m
# CONFIG_IMQ_BEHAVIOR_AA is not set # CONFIG_IMQ_BEHAVIOR_AA is not set
# CONFIG_IMQ_BEHAVIOR_AB is not set # CONFIG_IMQ_BEHAVIOR_AB is not set
CONFIG_IMQ_BEHAVIOR_BA=y CONFIG_IMQ_BEHAVIOR_BA=y

View File

@ -1,6 +1,6 @@
--- /dev/null --- /dev/null
+++ b/drivers/net/imq.c +++ b/drivers/net/imq.c
@@ -0,0 +1,409 @@ @@ -0,0 +1,410 @@
+/* +/*
+ * Pseudo-driver for the intermediate queue device. + * Pseudo-driver for the intermediate queue device.
+ * + *
@ -66,6 +66,7 @@
+#endif +#endif
+#include <linux/imq.h> +#include <linux/imq.h>
+#include <net/pkt_sched.h> +#include <net/pkt_sched.h>
+#include <net/netfilter/nf_queue.h>
+ +
+extern int qdisc_restart1(struct net_device *dev); +extern int qdisc_restart1(struct net_device *dev);
+ +
@ -137,7 +138,7 @@
+/* called for packets kfree'd in qdiscs at places other than enqueue */ +/* called for packets kfree'd in qdiscs at places other than enqueue */
+static void imq_skb_destructor(struct sk_buff *skb) +static void imq_skb_destructor(struct sk_buff *skb)
+{ +{
+ struct nf_info *info = skb->nf_info; + struct nf_queue_entry *info = skb->nf_queue_entry;
+ +
+ if (info) { + if (info) {
+ if (info->indev) + if (info->indev)
@ -159,17 +160,17 @@
+ skb->destructor = NULL; + skb->destructor = NULL;
+ +
+ dev->trans_start = jiffies; + dev->trans_start = jiffies;
+ nf_reinject(skb, skb->nf_info, NF_ACCEPT); + nf_reinject(skb->nf_queue_entry, NF_ACCEPT);
+ return 0; + return 0;
+} +}
+ +
+static int imq_nf_queue(struct sk_buff *skb, struct nf_info *info, unsigned queue_num, void *data) +static int imq_nf_queue(struct nf_queue_entry *info, unsigned queue_num)
+{ +{
+ struct net_device *dev; + struct net_device *dev;
+ struct net_device_stats *stats; + struct net_device_stats *stats;
+ struct sk_buff *skb2 = NULL; + struct sk_buff *skb2 = NULL;
+ struct Qdisc *q; + struct Qdisc *q;
+ unsigned int index = skb->imq_flags&IMQ_F_IFMASK; + unsigned int index = info->skb->imq_flags&IMQ_F_IFMASK;
+ int ret = -1; + int ret = -1;
+ +
+ if (index > numdevs) + if (index > numdevs)
@ -177,31 +178,31 @@
+ +
+ dev = imq_devs + index; + dev = imq_devs + index;
+ if (!(dev->flags & IFF_UP)) { + if (!(dev->flags & IFF_UP)) {
+ skb->imq_flags = 0; + info->skb->imq_flags = 0;
+ nf_reinject(skb, info, NF_ACCEPT); + nf_reinject(info, NF_ACCEPT);
+ return 0; + return 0;
+ } + }
+ dev->last_rx = jiffies; + dev->last_rx = jiffies;
+ +
+ if (skb->destructor) { + if (info->skb->destructor) {
+ skb2 = skb; + skb2 = info->skb;
+ skb = skb_clone(skb, GFP_ATOMIC); + info->skb = skb_clone(info->skb, GFP_ATOMIC);
+ if (!skb) + if (!info->skb)
+ return -1; + return -1;
+ } + }
+ skb->nf_info = info; + info->skb->nf_queue_entry = info;
+ +
+ stats = (struct net_device_stats *)dev->priv; + stats = (struct net_device_stats *)dev->priv;
+ stats->rx_bytes+= skb->len; + stats->rx_bytes+= info->skb->len;
+ stats->rx_packets++; + stats->rx_packets++;
+ +
+ spin_lock_bh(&dev->queue_lock); + spin_lock_bh(&dev->queue_lock);
+ q = dev->qdisc; + q = dev->qdisc;
+ if (q->enqueue) { + if (q->enqueue) {
+ q->enqueue(skb_get(skb), q); + q->enqueue(skb_get(info->skb), q);
+ if (skb_shared(skb)) { + if (skb_shared(info->skb)) {
+ skb->destructor = imq_skb_destructor; + info->skb->destructor = imq_skb_destructor;
+ kfree_skb(skb); + kfree_skb(info->skb);
+ ret = 0; + ret = 0;
+ } + }
+ } + }
@ -214,7 +215,7 @@
+ spin_unlock_bh(&dev->queue_lock); + spin_unlock_bh(&dev->queue_lock);
+ +
+ if (skb2) + if (skb2)
+ kfree_skb(ret ? skb : skb2); + kfree_skb(ret ? info->skb : skb2);
+ +
+ return ret; + return ret;
+} +}
@ -593,8 +594,8 @@
struct sk_buff *nfct_reasm; struct sk_buff *nfct_reasm;
#endif #endif
+#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE) +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
+ unsigned char imq_flags; + unsigned char imq_flags;
+ struct nf_info *nf_info; + struct nf_queue_entry *nf_queue_entry;
+#endif +#endif
#ifdef CONFIG_BRIDGE_NETFILTER #ifdef CONFIG_BRIDGE_NETFILTER
struct nf_bridge_info *nf_bridge; struct nf_bridge_info *nf_bridge;
@ -605,7 +606,7 @@
#endif #endif
+#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE) +#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE)
+ dst->imq_flags = src->imq_flags; + dst->imq_flags = src->imq_flags;
+ dst->nf_info = src->nf_info; + dst->nf_queue_entry = src->nf_queue_entry;
+#endif +#endif
#ifdef CONFIG_BRIDGE_NETFILTER #ifdef CONFIG_BRIDGE_NETFILTER
dst->nf_bridge = src->nf_bridge; dst->nf_bridge = src->nf_bridge;
@ -709,13 +710,13 @@
+MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPL");
--- a/net/ipv4/netfilter/Kconfig --- a/net/ipv4/netfilter/Kconfig
+++ b/net/ipv4/netfilter/Kconfig +++ b/net/ipv4/netfilter/Kconfig
@@ -315,6 +315,17 @@ @@ -145,6 +145,17 @@
To compile it as a module, choose M here. If unsure, say N. To compile it as a module, choose M here. If unsure, say N.
+config IP_NF_TARGET_IMQ +config IP_NF_TARGET_IMQ
+ tristate "IMQ target support" + tristate "IMQ target support"
+ depends on IP_NF_MANGLE && IMQ + depends on IP_NF_MANGLE
+ help + help
+ This option adds a `IMQ' target which is used to specify if and + This option adds a `IMQ' target which is used to specify if and
+ to which IMQ device packets should get enqueued/dequeued. + to which IMQ device packets should get enqueued/dequeued.
@ -724,9 +725,9 @@
+ +
+ To compile it as a module, choose M here. If unsure, say N. + To compile it as a module, choose M here. If unsure, say N.
+ +
config IP_NF_TARGET_ECN config IP_NF_TARGET_REJECT
tristate "ECN target support" tristate "REJECT target support"
depends on IP_NF_MANGLE depends on IP_NF_FILTER
--- a/net/ipv4/netfilter/Makefile --- a/net/ipv4/netfilter/Makefile
+++ b/net/ipv4/netfilter/Makefile +++ b/net/ipv4/netfilter/Makefile
@@ -55,6 +55,7 @@ @@ -55,6 +55,7 @@
@ -839,7 +840,7 @@
--- a/net/sched/sch_generic.c --- a/net/sched/sch_generic.c
+++ b/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c
@@ -182,6 +182,13 @@ @@ -182,6 +182,12 @@
return ret; return ret;
} }
@ -847,7 +848,6 @@
+{ +{
+ return qdisc_restart(dev); + return qdisc_restart(dev);
+} +}
+
+EXPORT_SYMBOL(qdisc_restart1); +EXPORT_SYMBOL(qdisc_restart1);
+ +
void __qdisc_run(struct net_device *dev) void __qdisc_run(struct net_device *dev)

View File

@ -333,7 +333,7 @@
obj-$(CONFIG_NETFILTER_XTABLES) += x_tables.o xt_tcpudp.o obj-$(CONFIG_NETFILTER_XTABLES) += x_tables.o xt_tcpudp.o
--- a/net/ipv4/netfilter/Kconfig --- a/net/ipv4/netfilter/Kconfig
+++ b/net/ipv4/netfilter/Kconfig +++ b/net/ipv4/netfilter/Kconfig
@@ -277,6 +277,11 @@ @@ -288,6 +288,11 @@
depends on IP_NF_IPTABLES && NF_CONNTRACK && NF_NAT depends on IP_NF_IPTABLES && NF_CONNTRACK && NF_NAT
default NF_NAT && NF_CONNTRACK_IRC default NF_NAT && NF_CONNTRACK_IRC